Commit ebfafadf 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@48588 954022d7-b5bf-4e40-9824-e11837661b57
parent 3246f938
......@@ -647,7 +647,7 @@ DrawingObjectsController.prototype =
getGraphicObjectProps: function()
{
var shape_props, image_props;
var shape_props, image_props, chart_props;
switch (this.curState.id)
{
......@@ -780,6 +780,17 @@ DrawingObjectsController.prototype =
*/
}
}
if (c_obj.isChart())
{
if (!isRealObject(chart_props))
{
chart_props = new asc_CImgProperty;
chart_props.Width = c_obj.extX;
chart_props.Height = c_obj.extY;
chart_props.ChartProperties = c_obj.chart;
}
}
/*if (c_obj.isGroup())
{
......@@ -874,6 +885,11 @@ DrawingObjectsController.prototype =
{
ret.push(image_props);
}
if (isRealObject(chart_props))
{
ret.push(chart_props);
}
var ascSelectedObjects = [];
for (var i = 0; i < ret.length; i++) {
......
......@@ -2651,19 +2651,20 @@ function BinaryWorksheetsTableWriter(memory, wb, oSharedStrings, oDrawings, aDxf
this.bs.WriteItem(c_oSer_DrawingType.To, function(){oThis.WriteFromTo(oDrawing.to);});
// if(null != oDrawing.Pos)
// this.bs.WriteItem(c_oSer_DrawingType.Pos, function(){oThis.WritePos(oDrawing.Pos);});
if(oDrawing.isChart())
if (oDrawing.isChart())
{
var oBinaryChartWriter = new BinaryChartWriter(this.memory);
this.bs.WriteItem(c_oSer_DrawingType.GraphicFrame, function(){oBinaryChartWriter.Write(oDrawing.chart);});
this.bs.WriteItem(c_oSer_DrawingType.GraphicFrame, function(){oBinaryChartWriter.Write(oDrawing.graphicObject.chart);});
}
else
else if (oDrawing.isImage())
{
if ( (null != oDrawing.imageUrl) && ("" != oDrawing.imageUrl)) {
var imageUrl = oDrawing.graphicObject.getImageUrl();
if ( (null != imageUrl) && ("" != imageUrl)) {
if (window['scriptBridge']) {
this.bs.WriteItem(c_oSer_DrawingType.Pic, function(){oThis.WritePic(oDrawing.imageUrl.replace(/^.*(\\|\/|\:)/, ''));});
this.bs.WriteItem(c_oSer_DrawingType.Pic, function(){oThis.WritePic(imageUrl.replace(/^.*(\\|\/|\:)/, ''));});
} else {
this.bs.WriteItem(c_oSer_DrawingType.Pic, function(){oThis.WritePic(oDrawing.imageUrl);});
this.bs.WriteItem(c_oSer_DrawingType.Pic, function(){oThis.WritePic(imageUrl);});
}
}
}
......
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