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

Удаление DrawingBase по ID graphicObject

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@47960 954022d7-b5bf-4e40-9824-e11837661b57
parent ddfa0c1a
...@@ -4046,14 +4046,11 @@ function DrawingObjects() { ...@@ -4046,14 +4046,11 @@ function DrawingObjects() {
var obj = _this.createDrawingObject(); var obj = _this.createDrawingObject();
obj.graphicObject = graphic; obj.graphicObject = graphic;
graphic.setDrawingBase(obj); graphic.setDrawingBase(obj);
History.Create_NewPoint();
History.Add(g_oUndoRedoDrawingObject, historyitem_DrawingObject_Add, worksheet.model.getId(), null, obj);
obj.graphicObject.select(_this.controller); obj.graphicObject.select(_this.controller);
aObjects.push(obj); aObjects.push(obj);
_this.showDrawingObjects(false); _this.showDrawingObjects(false);
worksheet.model.workbook.handlers.trigger("asc_onEndAddShape"); worksheet.model.workbook.handlers.trigger("asc_onEndAddShape");
_this.lockDrawingObject(obj.id, true, true); _this.lockDrawingObject(obj.id, true, true);
} }
...@@ -4109,10 +4106,10 @@ function DrawingObjects() { ...@@ -4109,10 +4106,10 @@ function DrawingObjects() {
} }
} }
_this.deleteDrawingObjectById = function(id) { _this.deleteDrawingBase = function(graphicId) {
for (var i = 0; i < _this.countDrawingObjects(); i++) { for (var i = 0; i < _this.countDrawingObjects(); i++) {
if ( aObjects[i].id == id ) { if ( aObjects[i].graphicObject.Id == graphicId ) {
aObjects.splice(i, 1); aObjects.splice(i, 1);
break; break;
} }
......
...@@ -180,7 +180,7 @@ DrawingObjectsController.prototype = ...@@ -180,7 +180,7 @@ DrawingObjectsController.prototype =
group.setChildOffsets(0, 0); group.setChildOffsets(0, 0);
for(i = 0; i < grouped_objects.length; ++i) for(i = 0; i < grouped_objects.length; ++i)
{ {
this.drawingObjects.deleteDrawingObjectById(grouped_objects[i].drawingBase.id); this.drawingObjects.deleteDrawingBase(grouped_objects[i].Id);
grouped_objects[i].setDrawingBase(null); grouped_objects[i].setDrawingBase(null);
grouped_objects[i].setPosition(grouped_objects[i].x - min_x, grouped_objects[i].y - min_y); grouped_objects[i].setPosition(grouped_objects[i].x - min_x, grouped_objects[i].y - min_y);
grouped_objects[i].setGroup(group); grouped_objects[i].setGroup(group);
......
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