Commit 2ea2c6c9 authored by Sergey.Luzyanin's avatar Sergey.Luzyanin Committed by Alexander.Trofimov

поправлен баг с копирование объектов через ctrl в группе

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@51221 954022d7-b5bf-4e40-9824-e11837661b57
parent b0940832
......@@ -1775,6 +1775,11 @@ CChartAsGroup.prototype =
this.vAxisTitle = g_oTableId.Get_ById(data.newValue);
break;
}
case historyitem_AutoShapes_RecalculateAfterInit:
{
this.recalculate();
break;
}
}
},
......@@ -1910,7 +1915,7 @@ CChartAsGroup.prototype =
var r = CreateBinaryReader(bin, 0, bin.length);
var copy = new CChartAsGroup(null,this.drawingObjects);
r.GetLong();
copy.readFromBinaryForCopyPaste(r, null, this.drawingObjects, x, y);
copy.readFromBinaryForCopyPaste(r, this.group, this.drawingObjects, x, y);
return copy;
},
......
......@@ -1127,7 +1127,11 @@ CGroupShape.prototype =
var count = this.selectedObjects.length;
while(count > 0)
{
var obj = this.selectedObjects[0];
var old_group = obj.group;
obj.group = this;
this.selectedObjects[0].deselect(drawingObjectsController);
obj.group = old_group;
--count;
}
},
......@@ -1692,7 +1696,7 @@ CGroupShape.prototype =
var r = CreateBinaryReader(bin, 0, bin.length);
var copy = new CGroupShape(null,this.drawingObjects);
r.GetLong();
copy.readFromBinaryForCopyPaste(r, null, this.drawingObjects, x, y);
copy.readFromBinaryForCopyPaste(r, this.group, this.drawingObjects, x, y);
return copy;
},
......
......@@ -1263,7 +1263,7 @@ CImageShape.prototype =
var r = CreateBinaryReader(bin, 0, bin.length);
var copy = new CImageShape(null,this.drawingObjects);
r.GetLong();
copy.readFromBinaryForCopyPaste(r, null, this.drawingObjects, x, y);
copy.readFromBinaryForCopyPaste(r, this.group, this.drawingObjects, x, y);
return copy;
},
......
......@@ -847,8 +847,7 @@ CShape.prototype =
this.txBody.content.Set_ApplyToAll(false);
this.txBody.calculateContent();
this.calculateTransformTextMatrix();
this.recalculateCurPos();
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_RecalculateAfterParagraphAddRedo, null, null,
new UndoRedoDataGraphicObjects(this.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
}
......@@ -3188,7 +3187,7 @@ CShape.prototype =
var r = CreateBinaryReader(bin, 0, bin.length);
var copy = new CShape(null,this.drawingObjects, null);
r.GetLong();
copy.readFromBinaryForCopyPaste(r, null, this.drawingObjects, x, y);
copy.readFromBinaryForCopyPaste(r, this.group, this.drawingObjects, x, y);
return copy;
},
......
......@@ -3555,6 +3555,8 @@ function MoveInGroupState(drawingObjectsController, drawingObjects, group, start
var worksheet = this.drawingObjects.getWorksheet();
var isViewMode = this.drawingObjectsController.drawingObjects.isViewerMode();
var o_this = this;
var ctrlKey = e.ctrlKey;
if(!isViewMode)
{
this.drawingObjects.objectLocker.reset();
......@@ -3574,13 +3576,36 @@ function MoveInGroupState(drawingObjectsController, drawingObjects, group, start
History.Create_NewPoint();
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_GroupRecalculateUndo, null, null,
new UndoRedoDataGraphicObjects(group.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
for(var i = 0; i < track_objects2.length; ++i)
track_objects2[i].trackEnd();
group.normalize();
group.updateCoordinatesAfterInternalResize();
if(!ctrlKey)
{
for(var i = 0; i < track_objects2.length; ++i)
track_objects2[i].trackEnd();
group.normalize();
group.updateCoordinatesAfterInternalResize();
}
else
{
for(var i = 0; i < track_objects2.length; ++i)
{
var track_object = track_objects2[i];
var original_object = track_object.originalObject;
var scale_scale_coefficients = original_object.group.getResultScaleCoefficients();
var xfrm = original_object.group.spPr.xfrm;
var pos_x = track_object.x/scale_scale_coefficients.cx + xfrm.chOffX;
var pos_y = track_object.y/scale_scale_coefficients.cy + xfrm.chOffY;
var copy = original_object.copy(pos_x, pos_y);
original_object.group.addToSpTree(copy);
original_object.deselect(o_this.drawingObjectsController);
copy.select(o_this.drawingObjectsController);
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_RecalculateAfterInit, null, null,
new UndoRedoDataGraphicObjects(copy.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
}
group.normalize();
group.updateCoordinatesAfterInternalResize();
}
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_GroupRecalculateRedo, null, null,
new UndoRedoDataGraphicObjects(group.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
group.recalculateTransform();
group.recalculate();
drawingObjects.showDrawingObjects(true);
}
......
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