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

Fix #20603

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@50033 954022d7-b5bf-4e40-9824-e11837661b57
parent c6da0d3b
......@@ -4100,35 +4100,37 @@ function DrawingObjects() {
// Graphic object
//-----------------------------------------------------------------------------------
_this.addGraphicObject = function(graphic, position) {
_this.addGraphicObject = function(graphic, position, lockByDefault) {
var obj = _this.createDrawingObject();
obj.graphicObject = graphic;
graphic.setDrawingBase(obj);
var drawingObject = _this.createDrawingObject();
drawingObject.graphicObject = graphic;
graphic.setDrawingBase(drawingObject);
var ret;
if (isRealNumber(position)) {
aObjects.splice(position, 0, obj);
aObjects.splice(position, 0, drawingObject);
ret = position;
}
else {
ret = aObjects.length;
aObjects.push(obj);
aObjects.push(drawingObject);
}
obj.setGraphicObjectCoords();
obj.setActive();
drawingObject.setGraphicObjectCoords();
drawingObject.setActive();
_this.showDrawingObjects(false);
_this.sendGraphicObjectProps();
worksheet.model.workbook.handlers.trigger("asc_onEndAddShape");
_this.objectLocker.reset();
_this.objectLocker.addObjectId(obj.graphicObject.Id);
_this.objectLocker.checkObjects( function(result) {} );
if ( lockByDefault ) {
_this.objectLocker.reset();
_this.objectLocker.addObjectId(drawingObject.graphicObject.Id);
_this.objectLocker.checkObjects( function(result) {} );
}
var boundsChecker = _this.getBoundsChecker(obj);
var boundsChecker = _this.getBoundsChecker(drawingObject);
aBoundsCheckers.push(boundsChecker);
return ret;
......
......@@ -192,7 +192,7 @@ CChartAsGroup.prototype =
{
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_Add_To_Drawing_Objects, null, null, new UndoRedoDataGraphicObjects(this.Id, new UndoRedoDataClosePath()), null);
this.select(this.drawingObjects.controller);
this.drawingObjects.addGraphicObject(this);
this.drawingObjects.addGraphicObject(this, null, true);
},
......
......@@ -1133,7 +1133,7 @@ CGroupShape.prototype =
addToDrawingObjects: function(pos)
{
var position = this.drawingObjects.addGraphicObject(this, pos);
var position = this.drawingObjects.addGraphicObject(this, pos, true);
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_Add_To_Drawing_Objects, null, null, new UndoRedoDataGraphicObjects(this.Id, new UndoRedoDataGOSingleProp(position, null)), null);
},
......
......@@ -131,7 +131,7 @@ CImageShape.prototype =
addToDrawingObjects: function(pos)
{
var position = this.drawingObjects.addGraphicObject(this, pos);
var position = this.drawingObjects.addGraphicObject(this, pos, true);
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_Add_To_Drawing_Objects, null, null, new UndoRedoDataGraphicObjects(this.Id, new UndoRedoDataGOSingleProp(position, null)), null);
},
......
......@@ -232,7 +232,7 @@ CShape.prototype =
addToDrawingObjects: function(pos)
{
var position = this.drawingObjects.addGraphicObject(this, pos);
var position = this.drawingObjects.addGraphicObject(this, pos, true);
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_Add_To_Drawing_Objects, null, null, new UndoRedoDataGraphicObjects(this.Id, new UndoRedoDataGOSingleProp(position, null)), null);
},
......
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