Commit be9500cf authored by Dmitry.Vikulov's avatar Dmitry.Vikulov Committed by Alexander.Trofimov

Свойства для шейпов и картинок

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@48073 954022d7-b5bf-4e40-9824-e11837661b57
parent 25759fa4
......@@ -4111,13 +4111,6 @@ function DrawingObjects() {
}
}
_this.getGraphicObjectProps = function() {
var props = [];
var selectedObjects = _this.controller.selectedObjects;
return props;
}
_this.insertUngroupedObjects = function(idGroup, aGraphics) {
if ( idGroup && aGraphics.length ) {
......
......@@ -2101,7 +2101,7 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS";
asc_getGraphicObjectProps: function() {
var ws = this.wb.getWorksheet();
return ws.objectRender.getGraphicObjectProps();
return ws.objectRender.controller.getGraphicObjectProps();
},
asyncImageStartLoaded: function() {
......
......@@ -322,6 +322,17 @@ var c_oAscStyleImage = {
Default : 0,
Document : 1
};
var c_oAscFill = {
FILL_TYPE_BLIP : 1,
FILL_TYPE_NOFILL : 2,
FILL_TYPE_SOLID : 3
};
var c_oAscStrokeType = {
STROKE_NONE: 0,
STROKE_COLOR: 1
};
var c_oAscCoAuthoringMeBorderColor = "rgba(22,156,0,1)";
var c_oAscCoAuthoringOtherBorderColor = "rgba(238,53,37,1)";
......
......@@ -278,5 +278,237 @@ DrawingObjectsController.prototype =
isPointInDrawingObjects: function(x, y)
{
return this.curState.isPointInDrawingObjects(x, y);
}
},
getGraphicObjectProps: function() {
var shape_props, image_props;
switch(this.curState.id)
{
/*case STATES_ID_GROUP:
case STATES_ID_TEXT_ADD_IN_GROUP:
{
var s_array = this.curState.group.selectionInfo.selectionArray;
for(var i = 0; i< s_array.length; ++i)
{
var c_obj = s_array[i];
if(c_obj.isImage() && c_obj.chart == null)
{
if(!isRealObject(image_props))
{
image_props = {fromGroup: true};
image_props.ImageUrl = c_obj.getImageUrl();
}
else
{
if(image_props.ImageUrl != null && c_obj.getImageUrl() !== image_props.ImageUrl)
image_props.ImageUrl = null;
}
}
if(c_obj.isImage() && isRealObject(c_obj.chart))
{
if(!isRealObject(chart_props))
{
chart_props = {fromGroup: true};
chart_props.ChartProperties = c_obj.chart;
}
else
{
chart_props.chart = null;
chart_props.severalCharts = true;
if(chart_props.severalChartTypes !== true)
{
if(!(chart_props.ChartProperties.type === c_obj.chart.type && chart_props.ChartProperties.subType === c_obj.chart.subType) )
chart_props.severalChartTypes = true;
}
if(chart_props.severalChartStyles !== true)
{
if(chart_props.ChartProperties.styleId !== c_obj.chart.styleId )
chart_props.severalChartStyles = true;
}
}
}
if(c_obj.isShape())
{
if(!isRealObject(shape_props))
{
shape_props = {fromGroup: true};
shape_props.ShapeProperties =
{
type: c_obj.getPresetGeom(),
fill: c_obj.getFill(),
stroke: c_obj.getStroke(),
canChangeArrows: c_obj.canChangeArrows()
};
shape_props.verticalTextAlign = c_obj.bodyPr.anchor;
}
else
{
var ShapeProperties =
{
type: c_obj.getPresetGeom(),
fill: c_obj.getFill(),
stroke: c_obj.getStroke(),
canChangeArrows: c_obj.canChangeArrows()
};
shape_props.ShapeProperties = CompareShapeProperties(ShapeProperties, shape_props.ShapeProperties);
shape_props.verticalTextAlign = undefined;
}
}
}
break;
}*/
default :
{
var s_arr = this.selectedObjects;
for(i = 0; i < s_arr.length; ++i)
{
c_obj = s_arr[i];
if (isRealObject(c_obj))
{
if (c_obj.isShape())
{
if (!isRealObject(shape_props))
{
shape_props = {};
//shape_props = s_arr[i].Get_Props(null);
shape_props.ShapeProperties =
{
type: c_obj.getPresetGeom(),
fill: c_obj.getFill(),
stroke: c_obj.getStroke(),
canChangeArrows: c_obj.canChangeArrows()
};
//shape_props.verticalTextAlign = c_obj.bodyPr.anchor;
}
else
{
ShapeProperties =
{
type: c_obj.getPresetGeom(),
fill: c_obj.getFill(),
stroke: c_obj.getStroke(),
canChangeArrows: c_obj.canChangeArrows()
};
shape_props = s_arr[i].Get_Props(shape_props);
shape_props.ShapeProperties = CompareShapeProperties(ShapeProperties, shape_props.ShapeProperties);
shape_props.verticalTextAlign = undefined;
}
}
if (c_obj.isImage())
{
if (!isRealObject(image_props))
{
image_props = {};
//image_props = s_arr[i].Get_Props(null);
image_props.ImageUrl = c_obj.getImageUrl();
}
/*else
{
image_props = s_arr[i].Get_Props(image_props);
if (image_props.ImageUrl != null && c_obj.getImageUrl() !== image_props.ImageUrl)
image_props.ImageUrl = null;
}*/
}
if (c_obj.isGroup())
{
var shape_props2 = c_obj.getShapeProps();
var image_props2 = c_obj.getImageProps2();
var chart_props2 = c_obj.getChartProps();
if(isRealObject(shape_props2))
{
if (!isRealObject(shape_props))
{
shape_props = {};
shape_props = s_arr[i].Get_Props(null);
shape_props.ShapeProperties = shape_props2.ShapeProperties;
}
else
{
shape_props = s_arr[i].Get_Props(shape_props);
shape_props.ShapeProperties = CompareShapeProperties(shape_props2.ShapeProperties, shape_props.ShapeProperties);
}
}
if (isRealObject(image_props2))
{
if(!isRealObject(image_props))
{
image_props = {};
image_props = s_arr[i].Get_Props(null);
image_props.ImageUrl = image_props2.ImageUrl;
}
else
{
image_props = s_arr[i].Get_Props(image_props);
if(image_props.ImageUrl != null && image_props2.ImageUrl !== image_props.ImageUrl)
image_props.ImageUrl = null;
}
}
if (isRealObject(chart_props2))
{
if (!isRealObject(chart_props))
{
chart_props = {};
chart_props = s_arr[i].Get_Props(null);
chart_props.ChartProperties = chart_props2.ChartProperties;
chart_props.severalCharts = chart_props2.severalCharts;
chart_props.severalChartTypes = chart_props2.severalChartTypes;
chart_props.severalChartStyles = chart_props2.severalChartStyles;
}
else
{
chart_props = s_arr[i].Get_Props(chart_props);
chart_props.severalCharts = true;
if(chart_props.severalChartTypes !== true)
{
if(chart_props2.severalChartTypes === true)
chart_props.severalChartTypes = true;
else
{
if(!(chart_props.ChartProperties.type === chart_props2.ChartProperties.type && chart_props.ChartProperties.subType === chart_props2.ChartProperties.subType) )
chart_props.severalChartTypes = true;
if(chart_props.ChartProperties.subType !== chart_props2.ChartProperties.subType )
chart_props.severalChartStyles = true;
}
}
}
}
}
}
}
break;
}
}
var ret = [];
if (isRealObject(shape_props))
{
if (shape_props.ShapeProperties)
{
var pr = shape_props.ShapeProperties;
if (pr.fill != null && pr.fill.fill != null && pr.fill.fill.type == FILL_TYPE_BLIP)
{
this.drawingDocument.DrawImageTextureFillShape(pr.fill.fill.RasterImageId);
}
shape_props.ShapeProperties = CreateAscShapePropFromProp(shape_props.ShapeProperties);
}
ret.push(shape_props);
}
if (isRealObject(image_props))
{
if (image_props.ShapeProperties)
image_props.ShapeProperties = CreateAscShapePropFromProp(image_props.ShapeProperties);
ret.push(image_props);
}
return ret;
}
};
\ No newline at end of file
......@@ -348,6 +348,12 @@ CImage.prototype =
return this.group.getFullFlipH() ? !this.flipH : this.flipH;
},
getImageUrl: function()
{
if(isRealObject(this.blipFill))
return this.blipFill.RasterImageId;
return null;
},
getFullFlipV: function()
{
......
......@@ -1097,6 +1097,57 @@ CShape.prototype =
return {kd1: 1, kd2: 1};
},
getPresetGeom: function()
{
if(this.spPr.geometry != null)
{
return this.spPr.geometry.preset;
}
else
{
return null;
}
},
getFill: function()
{
return this.brush;
},
getStroke: function()
{
if(!isRealObject(this.pen))
return null;
return this.pen;
},
canChangeArrows : function()
{
if(this.spPr.geometry == null)
{
return false;
}
var _path_list = this.spPr.geometry.pathLst;
var _path_index;
var _path_command_index;
var _path_command_arr;
for(_path_index = 0; _path_index < _path_list.length; ++_path_index)
{
_path_command_arr = _path_list[_path_index].ArrPathCommandInfo;
for(_path_command_index = 0; _path_command_index < _path_command_arr.length; ++ _path_command_index)
{
if(_path_command_arr[_path_command_index].id == 5)
{
break;
}
}
if(_path_command_index == _path_command_arr.length)
{
return true;
}
}
return false;
},
getRotateAngle: function(x, y)
{
......
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