Commit 345dee37 authored by Sergey Luzyanin's avatar Sergey Luzyanin

Added oleObject's properties into asc_CImgProperty

parent a57b12c0
......@@ -519,7 +519,7 @@ function CheckSpPrXfrm2(object)
function getObjectsByTypesFromArr(arr, bGrouped)
{
var ret = {shapes: [], images: [], groups: [], charts: [], tables: []};
var ret = {shapes: [], images: [], groups: [], charts: [], tables: [], oleObjects: []};
var selected_objects = arr;
for(var i = 0; i < selected_objects.length; ++i)
{
......@@ -533,11 +533,15 @@ function getObjectsByTypesFromArr(arr, bGrouped)
break;
}
case AscDFH.historyitem_type_ImageShape:
case AscDFH.historyitem_type_OleObject:
{
ret.images.push(drawing);
break;
}
case AscDFH.historyitem_type_OleObject:
{
ret.oleObjects.push(drawing);
break;
}
case AscDFH.historyitem_type_GroupShape:
{
ret.groups.push(drawing);
......@@ -547,7 +551,8 @@ function getObjectsByTypesFromArr(arr, bGrouped)
ret.shapes = ret.shapes.concat(by_types.shapes);
ret.images = ret.images.concat(by_types.images);
ret.charts = ret.charts.concat(by_types.charts);
ret.tables = ret.tables.concat(by_types.charts);
ret.tables = ret.tables.concat(by_types.tables);
ret.oleObjects = ret.oleObjects.concat(by_types.oleObjects);
}
break;
}
......@@ -2370,6 +2375,17 @@ DrawingObjectsController.prototype =
}
objects_by_type.charts[i].checkDrawingBaseCoords();
}
for(i = 0; i < objects_by_type.oleObjects.length; ++i)
{
CheckSpPrXfrm(objects_by_type.oleObjects[i]);
objects_by_type.oleObjects[i].spPr.xfrm.setExtX(props.Width);
objects_by_type.oleObjects[i].spPr.xfrm.setExtY(props.Height);
if(objects_by_type.oleObjects[i].group)
{
checkObjectInArray(aGroups, objects_by_type.oleObjects[i].group.getMainGroup());
}
objects_by_type.oleObjects[i].checkDrawingBaseCoords();
}
}
}
......@@ -6542,6 +6558,51 @@ DrawingObjectsController.prototype =
}
break;
}
case AscDFH.historyitem_type_OleObject:
{
var pluginData = new Asc.CPluginData();
pluginData.setAttribute("data", drawing.m_sData);
pluginData.setAttribute("guid", drawing.m_sApplicationId);
pluginData.setAttribute("width", drawing.extX);
pluginData.setAttribute("height", drawing.extY);
pluginData.setAttribute("widthPix", drawing.m_nPixWidth);
pluginData.setAttribute("heightPix", drawing.m_nPixHeight);
pluginData.setAttribute("objectId", drawing.Id);
new_image_props =
{
ImageUrl: null,
w: drawing.extX,
h: drawing.extY,
locked: locked,
x: drawing.x,
y: drawing.y,
lockAspect: lockAspect,
pluginGuid: drawing.m_sApplicationId,
pluginData: pluginData
};
if(!image_props)
image_props = new_image_props;
else
{
image_props.ImageUrl = null;
if(image_props.w != null && image_props.w !== new_image_props.w)
image_props.w = null;
if(image_props.h != null && image_props.h !== new_image_props.h)
image_props.h = null;
if(image_props.x != null && image_props.x !== new_image_props.x)
image_props.x = null;
if(image_props.y != null && image_props.y !== new_image_props.y)
image_props.y = null;
if(image_props.locked || new_image_props.locked)
image_props.locked = true;
if(image_props.lockAspect || new_image_props.lockAspect)
image_props.lockAspect = false;
new_image_props.pluginGuid = null;
new_image_props.pluginData = undefined;
}
break;
}
case AscDFH.historyitem_type_ChartSpace:
{
var type_subtype = drawing.getTypeSubType();
......
......@@ -1745,6 +1745,10 @@
this.severalChartStyles = obj.severalChartStyles != undefined ? obj.severalChartStyles : undefined;
this.verticalTextAlign = obj.verticalTextAlign != undefined ? obj.verticalTextAlign : undefined;
this.vert = obj.vert != undefined ? obj.vert : undefined;
//oleObjects
this.pluginGuid = obj.pluginGuid != undefined ? obj.pluginGuid : undefined;
this.pluginData = obj.pluginData != undefined ? obj.pluginData : undefined;
}
else {
this.CanBeFlow = true;
......@@ -1775,6 +1779,10 @@
this.severalChartStyles = undefined;
this.verticalTextAlign = undefined;
this.vert = undefined;
//oleObjects
this.pluginGuid = undefined;
this.pluginData = undefined;
}
}
......@@ -1912,6 +1920,23 @@
return new asc_CImageSize( parseInt(_w), parseInt(_h), bIsCorrect);
}
return new asc_CImageSize( 50, 50, false );
},
//oleObjects
asc_getPluginGuid: function(){
return this.pluginGuid;
},
asc_putPluginGuid: function(v){
this.pluginGuid = v;
},
asc_getPluginData: function(){
return this.pluginData;
},
asc_putPluginData: function(v){
this.pluginData = v;
}
};
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment