Commit 8f16fad1 authored by Sergey.Luzyanin's avatar Sergey.Luzyanin Committed by Alexander.Trofimov

правка бага с отсутствием картинки на скопированном листе при передаче...

правка бага с отсутствием картинки на скопированном листе при передаче изменений у другого пользователя 20874

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@53070 954022d7-b5bf-4e40-9824-e11837661b57
parent 8243d933
...@@ -2862,9 +2862,12 @@ function DrawingObjects() { ...@@ -2862,9 +2862,12 @@ function DrawingObjects() {
drawingObject.graphicObject.chart.rebuildSeries(); drawingObject.graphicObject.chart.rebuildSeries();
drawingObject.graphicObject.init(); drawingObject.graphicObject.init();
aObjects.push( drawingObject ); History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_RecalculateAfterInit2Chart, null, null,
new UndoRedoDataGraphicObjects(drawingObject.graphicObject.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
var boundsChecker = _this.getBoundsChecker(drawingObject); drawingObject.graphicObject.addToDrawingObjects();
var boundsChecker = _this.getBoundsChecker(drawingObject);
aBoundsCheckers.push(boundsChecker); aBoundsCheckers.push(boundsChecker);
} }
if (drawingObject.graphicObject instanceof CShape) { if (drawingObject.graphicObject instanceof CShape) {
...@@ -2887,6 +2890,8 @@ function DrawingObjects() { ...@@ -2887,6 +2890,8 @@ function DrawingObjects() {
} }
drawingObject.graphicObject.recalculate(aImagesSync); drawingObject.graphicObject.recalculate(aImagesSync);
//aObjects.push( drawingObject ); //aObjects.push( drawingObject );
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_RecalculateAfterInit, null, null,
new UndoRedoDataGraphicObjects(drawingObject.graphicObject.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
drawingObject.graphicObject.addToDrawingObjects(); drawingObject.graphicObject.addToDrawingObjects();
var boundsChecker = _this.getBoundsChecker(drawingObject); var boundsChecker = _this.getBoundsChecker(drawingObject);
...@@ -2912,7 +2917,11 @@ function DrawingObjects() { ...@@ -2912,7 +2917,11 @@ function DrawingObjects() {
drawingObject.graphicObject.spPr.xfrm.setExtents(metrics.extX, metrics.extY); drawingObject.graphicObject.spPr.xfrm.setExtents(metrics.extX, metrics.extY);
} }
drawingObject.graphicObject.recalculate(aImagesSync); drawingObject.graphicObject.recalculate(aImagesSync);
} History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_GroupRecalculateAfterLoad, null, null,
new UndoRedoDataGraphicObjects(drawingObject.graphicObject.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
drawingObject.graphicObject.addToDrawingObjects();
}
if (drawingObject.graphicObject instanceof CGroupShape) { if (drawingObject.graphicObject instanceof CGroupShape) {
drawingObject.graphicObject.drawingBase = drawingObject; drawingObject.graphicObject.drawingBase = drawingObject;
...@@ -2938,9 +2947,12 @@ function DrawingObjects() { ...@@ -2938,9 +2947,12 @@ function DrawingObjects() {
drawingObject.graphicObject.recalculate(aImagesSync); drawingObject.graphicObject.recalculate(aImagesSync);
if(aImagesSync.length > old_len) if(aImagesSync.length > old_len)
aObjectsSync[aObjectsSync.length] = drawingObject; aObjectsSync[aObjectsSync.length] = drawingObject;
aObjects.push( drawingObject ); History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_GroupRecalculateAfterLoad, null, null,
new UndoRedoDataGraphicObjects(drawingObject.graphicObject.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
var boundsChecker = _this.getBoundsChecker(drawingObject); drawingObject.graphicObject.addToDrawingObjects();
var boundsChecker = _this.getBoundsChecker(drawingObject);
aBoundsCheckers.push(boundsChecker); aBoundsCheckers.push(boundsChecker);
} }
} }
......
...@@ -1893,6 +1893,11 @@ CChartAsGroup.prototype = ...@@ -1893,6 +1893,11 @@ CChartAsGroup.prototype =
this.recalculate(); this.recalculate();
break; break;
} }
case historyitem_AutoShapes_RecalculateAfterInit2Chart:
{
this.init();
break;
}
} }
}, },
......
...@@ -1940,6 +1940,12 @@ CGroupShape.prototype = ...@@ -1940,6 +1940,12 @@ CGroupShape.prototype =
this.spTree.splice(data.newValue1, 0, g_oTableId.Get_ById(data.oldValue2)); this.spTree.splice(data.newValue1, 0, g_oTableId.Get_ById(data.oldValue2));
break; break;
} }
case historyitem_AutoShapes_GroupRecalculateAfterLoad:
{
this.initCharts();
this.recalculate();
break;
}
} }
}, },
...@@ -2131,6 +2137,13 @@ CGroupShape.prototype = ...@@ -2131,6 +2137,13 @@ CGroupShape.prototype =
this.addToSpTree(sp); this.addToSpTree(sp);
break; break;
} }
case CLASS_TYPE_CHART_AS_GROUP:
{
var sp = new CChartAsGroup(null, drawingObjects);
sp.readFromBinaryForCopyPaste(r, this, drawingObjects);
this.addToSpTree(sp);
break;
}
} }
} }
...@@ -2138,6 +2151,7 @@ CGroupShape.prototype = ...@@ -2138,6 +2151,7 @@ CGroupShape.prototype =
{ {
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_GroupRecalculateRedo, null, null, History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_GroupRecalculateRedo, null, null,
new UndoRedoDataGraphicObjects(this.Get_Id(), new UndoRedoDataGOSingleProp(null, null))); new UndoRedoDataGraphicObjects(this.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
this.initCharts();
this.recalculate(); this.recalculate();
} }
}, },
...@@ -2145,15 +2159,113 @@ CGroupShape.prototype = ...@@ -2145,15 +2159,113 @@ CGroupShape.prototype =
readFromBinaryForCopyPaste2: function(r, group, drawingObjects, x, y) readFromBinaryForCopyPaste2: function(r, group, drawingObjects, x, y)
{ {
this.group = group; this.setGroup(group);
this.drawingObjects = drawingObjects; this.setDrawingObjects(drawingObjects);
this.spPr.Read_FromBinary2(r); this.spPr.bwMode = r.GetBool();
r.GetBool();
this.setXfrmObject(new CXfrm());
var Reader = r;
var offX, offY, extX, extY, flipH = null, flipV = null, rot = null;
var flag = Reader.GetBool();
if(flag)
offX = Reader.GetDouble();
flag = Reader.GetBool();
if(flag)
offY = Reader.GetDouble();
flag = Reader.GetBool();
if(flag)
extX = Reader.GetDouble();
flag = Reader.GetBool();
if(flag)
extY = Reader.GetDouble();
var chExtX, chExtY, chOffX, chOffY;
flag = Reader.GetBool();
if(flag)
chOffX = Reader.GetDouble();
flag = Reader.GetBool();
if(flag)
chOffY = Reader.GetDouble();
flag = Reader.GetBool();
if(flag)
chExtX = Reader.GetDouble();
flag = Reader.GetBool();
if(flag)
chExtY = Reader.GetDouble();
flag = Reader.GetBool();
if(flag)
flipH = Reader.GetBool();
flag = Reader.GetBool();
if(flag)
flipV = Reader.GetBool();
flag = Reader.GetBool();
if(flag)
rot = Reader.GetDouble();
if(isRealNumber(offX) && isRealNumber(offY))
this.setPosition(offX, offY);
if(isRealNumber(extX) && isRealNumber(extY))
this.setExtents(extX, extY);
this.setFlips(flipH, flipV);
if(isRealNumber(rot))
this.setRotate(rot);
if(isRealNumber(chOffX) && isRealNumber(chOffY))
this.setChildOffsets(chOffX, chOffY);
if(isRealNumber(chExtX) && isRealNumber(chExtY))
this.setChildExtents(chExtX, chExtY);
var flag = Reader.GetBool();
if(flag)
{
var geometry = new CGeometry();
geometry.Read_FromBinary2(Reader);
geometry.Init(5, 5);
//this.setGeometry(geometry);
}
flag = Reader.GetBool();
if(flag)
{
var Fill = new CUniFill();
Fill.Read_FromBinary2(Reader);
// this.setUniFill(Fill);
}
flag = Reader.GetBool();
if(flag)
{
var ln = new CLn();
ln.Read_FromBinary2(Reader);
//this.setUniLine(ln);
}
var dx = 0, dy = 0; var dx = 0, dy = 0;
if(r.GetBool()) if(r.GetBool())
{ {
dx = r.GetDouble(); dx = r.GetDouble();
dy = r.GetDouble(); dy = r.GetDouble();
} }
if(isRealNumber(x) && isRealNumber(y)) if(isRealNumber(x) && isRealNumber(y))
{ {
this.setPosition(x + dx, y + dy); this.setPosition(x + dx, y + dy);
...@@ -2165,22 +2277,33 @@ CGroupShape.prototype = ...@@ -2165,22 +2277,33 @@ CGroupShape.prototype =
{ {
case CLASS_TYPE_SHAPE: case CLASS_TYPE_SHAPE:
{ {
this.spTree[i] = new CShape(null, drawingObjects); var sp = new CShape(null, drawingObjects);
this.spTree[i].readFromBinaryForCopyPaste(r, this, drawingObjects); sp.readFromBinaryForCopyPaste2(r, this, drawingObjects);
this.addToSpTree(sp);
break; break;
} }
case CLASS_TYPE_IMAGE: case CLASS_TYPE_IMAGE:
{ {
this.spTree[i] = new CImageShape(null, drawingObjects); var sp = new CImageShape(null, drawingObjects);
this.spTree[i].readFromBinaryForCopyPaste(r, this, drawingObjects); sp.readFromBinaryForCopyPaste2(r, this, drawingObjects);
this.addToSpTree(sp);
break; break;
} }
case CLASS_TYPE_GROUP: case CLASS_TYPE_GROUP:
{ {
this.spTree[i] = new CGroupShape(null, drawingObjects); var sp = new CGroupShape(null, drawingObjects);
this.spTree[i].readFromBinaryForCopyPaste(r, this, drawingObjects); sp.readFromBinaryForCopyPaste2(r, this, drawingObjects);
this.addToSpTree(sp);
break;
}
case CLASS_TYPE_CHART_AS_GROUP:
{
var sp = new CChartAsGroup(null, drawingObjects);
sp.readFromBinaryForCopyPaste2(r, this, drawingObjects);
this.addToSpTree(sp);
break; break;
} }
} }
......
...@@ -1195,6 +1195,11 @@ CImageShape.prototype = ...@@ -1195,6 +1195,11 @@ CImageShape.prototype =
this.drawingObjects.deleteDrawingBase(this.Id); this.drawingObjects.deleteDrawingBase(this.Id);
break; break;
} }
case historyitem_AutoShapes_GroupRecalculateAfterLoad:
{
this.recalculate();
break;
}
} }
}, },
...@@ -1368,9 +1373,8 @@ CImageShape.prototype = ...@@ -1368,9 +1373,8 @@ CImageShape.prototype =
readFromBinaryForCopyPaste2: function(r, group, drawingObjects, x, y) readFromBinaryForCopyPaste2: function(r, group, drawingObjects, x, y)
{ {
this.group = group; this.setGroup(group);
this.drawingObjects = drawingObjects; this.setDrawingObjects(drawingObjects);
this.setBlipFill(new CUniFill()); this.setBlipFill(new CUniFill());
this.blipFill.Read_FromBinary2(r); this.blipFill.Read_FromBinary2(r);
var dx = 0, dy = 0; var dx = 0, dy = 0;
...@@ -1379,14 +1383,98 @@ CImageShape.prototype = ...@@ -1379,14 +1383,98 @@ CImageShape.prototype =
dx = r.GetDouble(); dx = r.GetDouble();
dy = r.GetDouble(); dy = r.GetDouble();
} }
this.spPr.Read_FromBinary2(r); //this.spPr.Read_FromBinary2(r);
if(isRealNumber(x) && isRealNumber(y)) //*********************
this.spPr.bwMode = r.GetBool();
r.GetBool();
this.setXfrmObject(new CXfrm());
var Reader = r;
var offX, offY, extX, extY, flipH = null, flipV = null, rot = null;
var flag = Reader.GetBool();
if(flag)
offX = Reader.GetDouble();
flag = Reader.GetBool();
if(flag)
offY = Reader.GetDouble();
flag = Reader.GetBool();
if(flag)
extX = Reader.GetDouble();
flag = Reader.GetBool();
if(flag)
extY = Reader.GetDouble();
flag = Reader.GetBool();
flag = Reader.GetBool();
flag = Reader.GetBool();
flag = Reader.GetBool();
flag = Reader.GetBool();
if(flag)
flipH = Reader.GetBool();
flag = Reader.GetBool();
if(flag)
flipV = Reader.GetBool();
flag = Reader.GetBool();
if(flag)
rot = Reader.GetDouble();
if(isRealNumber(offX) && isRealNumber(offY))
this.setPosition(offX, offY);
if(isRealNumber(extX) && isRealNumber(extY))
this.setExtents(extX, extY);
this.setFlips(flipH, flipV);
if(isRealNumber(rot))
this.setRotate(rot);
var flag = Reader.GetBool();
if(flag)
{ {
this.setPosition(x + dx, y + dy); var geometry = new CGeometry();
geometry.Read_FromBinary2(Reader);
geometry.Init(5, 5);
this.setGeometry(geometry);
} }
if(!isRealObject(group)) flag = Reader.GetBool();
if(flag)
{
var Fill = new CUniFill();
Fill.Read_FromBinary2(Reader);
// this.setUniFill(Fill);
}
flag = Reader.GetBool();
if(flag)
{
var ln = new CLn();
ln.Read_FromBinary2(Reader);
//this.setUniLine(ln);
}
//***********************************
if(isRealNumber(x) && isRealNumber(y))
{ {
this.setPosition(x + dx, y + dy);
} }
} }
}; };
\ No newline at end of file
...@@ -300,7 +300,6 @@ Path.prototype = { ...@@ -300,7 +300,6 @@ Path.prototype = {
} }
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_Set_PathWH, null, null, History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_Set_PathWH, null, null,
new UndoRedoDataGraphicObjects(this.Get_Id(), new UndoRedoDataGOPairProps(oldValue1, oldValue2, newValue1, newValue2))); new UndoRedoDataGraphicObjects(this.Get_Id(), new UndoRedoDataGOPairProps(oldValue1, oldValue2, newValue1, newValue2)));
UndoRedoDataGOPairProps
}, },
moveTo: function(x, y) moveTo: function(x, y)
......
...@@ -3477,8 +3477,8 @@ CShape.prototype = ...@@ -3477,8 +3477,8 @@ CShape.prototype =
} }
if(r.GetBool()) if(r.GetBool())
{ {
this.txBody = new CTextBody(this); this.addTextBody(new CTextBody(this));
this.txBody.readFromBinaryForCopyPaste(r, drawingObjects.drawingDocument); this.txBody.readFromBinary(r, drawingObjects.drawingDocument);
} }
if(!isRealObject(group)) if(!isRealObject(group))
{ {
...@@ -3600,10 +3600,9 @@ CShape.prototype = ...@@ -3600,10 +3600,9 @@ CShape.prototype =
} }
if(r.GetBool()) if(r.GetBool())
{ {
this.txBody = new CTextBody(this); this.addTextBody(new CTextBody(this));
this.txBody.readFromBinaryForCopyPaste(r, drawingObjects.drawingDocument); this.txBody.readFromBinary(r, drawingObjects.drawingDocument);
} }
}, },
setStyleBinary: function(style) setStyleBinary: function(style)
......
...@@ -895,7 +895,13 @@ CTextBody.prototype = ...@@ -895,7 +895,13 @@ CTextBody.prototype =
Refresh_RecalcData2: function() Refresh_RecalcData2: function()
{ {
if(isRealObject(this.content)) if(isRealObject(this.content))
this.content.Recalculate_Page(0, true); {
if((this.shape && this.shape instanceof CShape)
|| ((this.shape instanceof CChartTitle) && this.shape.chartGroup && this.shape.chartGroup.drawingObjects))
{
this.content.Recalculate_Page(0, true);
}
}
}, },
Undo: function(type, data) Undo: function(type, data)
......
...@@ -199,6 +199,10 @@ var historyitem_AutoShapes_GeometryAddPreset = 88; ...@@ -199,6 +199,10 @@ var historyitem_AutoShapes_GeometryAddPreset = 88;
var historyitem_AutoShapes_AddToGroupSpTreeToPos = 89; var historyitem_AutoShapes_AddToGroupSpTreeToPos = 89;
var historyitem_AutoShapes_GroupRecalculateArrGraphicObjectsUndo = 90; var historyitem_AutoShapes_GroupRecalculateArrGraphicObjectsUndo = 90;
var historyitem_AutoShapes_GroupRecalculateArrGraphicObjectsRedo = 91; var historyitem_AutoShapes_GroupRecalculateArrGraphicObjectsRedo = 91;
var historyitem_AutoShapes_RecalculateAfterInit2Chart = 92;
var historyitem_AutoShapes_GroupRecalculateAfterLoad = 93;
......
...@@ -1654,6 +1654,10 @@ Workbook.prototype.copyWorksheet=function(index, insertBefore, sName, sId, bFrom ...@@ -1654,6 +1654,10 @@ Workbook.prototype.copyWorksheet=function(index, insertBefore, sName, sId, bFrom
History.TurnOn(); History.TurnOn();
History.Create_NewPoint(); History.Create_NewPoint();
History.Add(g_oUndoRedoWorkbook, historyitem_Workbook_SheetAdd, null, null, new UndoRedoData_SheetAdd(insertBefore, newSheet.getName(), wsFrom.getId(), newSheet.getId())); History.Add(g_oUndoRedoWorkbook, historyitem_Workbook_SheetAdd, null, null, new UndoRedoData_SheetAdd(insertBefore, newSheet.getName(), wsFrom.getId(), newSheet.getId()));
if(!(bFromRedo === true))
{
wsFrom.copyDrawingObjects(newSheet);
}
} }
}; };
Workbook.prototype.insertWorksheet=function(index, sheet, cwf){ Workbook.prototype.insertWorksheet=function(index, sheet, cwf){
...@@ -2298,7 +2302,19 @@ Woorksheet.prototype.clone=function(sNewId, bFromRedo){ ...@@ -2298,7 +2302,19 @@ Woorksheet.prototype.clone=function(sNewId, bFromRedo){
var range = oNewWs.getRange3(elem.bbox.r1, elem.bbox.c1, elem.bbox.r2, elem.bbox.c2); var range = oNewWs.getRange3(elem.bbox.r1, elem.bbox.c1, elem.bbox.r2, elem.bbox.c2);
range.setHyperlinkOpen(elem.data); range.setHyperlinkOpen(elem.data);
} }
if(null != this.Drawings && this.Drawings.length > 0 && !(bFromRedo === true)) if(null != this.aComments) {
for (var i = 0; i < this.aComments.length; i++) {
var comment = new asc_CCommentData(this.aComments[i]);
comment.wsId = oNewWs.getId();
comment.setId();
oNewWs.aComments.push(comment);
}
}
return oNewWs;
};
Woorksheet.prototype.copyDrawingObjects=function(oNewWs)
{
if(null != this.Drawings && this.Drawings.length > 0)
{ {
oNewWs.Drawings = []; oNewWs.Drawings = [];
var w = new CMemory(); var w = new CMemory();
...@@ -2318,11 +2334,10 @@ Woorksheet.prototype.clone=function(sNewId, bFromRedo){ ...@@ -2318,11 +2334,10 @@ Woorksheet.prototype.clone=function(sNewId, bFromRedo){
drawingObjects = new DrawingObjects(); drawingObjects = new DrawingObjects();
drawingObjects.drawingDocument = new CDrawingDocument(drawingObjects); drawingObjects.drawingDocument = new CDrawingDocument(drawingObjects);
} }
//drawingObjects.init(new WorksheetView());
for(var i = 0; i < this.Drawings.length; ++i) for(var i = 0; i < this.Drawings.length; ++i)
{ {
var obj = null; var obj = null;
var objectType = stream.GetLong(); var objectType = stream.GetLong();
switch (objectType) switch (objectType)
{ {
case CLASS_TYPE_SHAPE: case CLASS_TYPE_SHAPE:
...@@ -2354,17 +2369,7 @@ Woorksheet.prototype.clone=function(sNewId, bFromRedo){ ...@@ -2354,17 +2369,7 @@ Woorksheet.prototype.clone=function(sNewId, bFromRedo){
oNewWs.Drawings.push(drawingObject); oNewWs.Drawings.push(drawingObject);
} }
} }
//oNewWs.Drawings = this.Drawings.concat();
} }
if(null != this.aComments) {
for (var i = 0; i < this.aComments.length; i++) {
var comment = new asc_CCommentData(this.aComments[i]);
comment.wsId = oNewWs.getId();
comment.setId();
oNewWs.aComments.push(comment);
}
}
return oNewWs;
}; };
Woorksheet.prototype.init=function(){ Woorksheet.prototype.init=function(){
this.workbook.cwf[this.Id]={ cells:{} }; this.workbook.cwf[this.Id]={ cells:{} };
......
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