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

Поправлено падение при завершении добавления сплайнов и полилиний

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@51314 954022d7-b5bf-4e40-9824-e11837661b57
parent 14c3a0f4
...@@ -2406,8 +2406,6 @@ function TrackNewShapeState(drawingObjectsController, drawingObjects, presetGeom ...@@ -2406,8 +2406,6 @@ function TrackNewShapeState(drawingObjectsController, drawingObjects, presetGeom
this.drawingObjectsController.onMouseUp(e, x, y);*/ this.drawingObjectsController.onMouseUp(e, x, y);*/
} }
//лочим добавленный шейп
var worksheet = this.drawingObjects.getWorksheet();
this.drawingObjects.objectLocker.reset(); this.drawingObjects.objectLocker.reset();
this.drawingObjects.objectLocker.addObjectId(this.resultObject.Get_Id()); this.drawingObjects.objectLocker.addObjectId(this.resultObject.Get_Id());
...@@ -4130,7 +4128,8 @@ function SplineBezierState2(drawingObjectsController, drawingObjects, startX, st ...@@ -4130,7 +4128,8 @@ function SplineBezierState2(drawingObjectsController, drawingObjects, startX, st
{ {
if(e.ClickCount >= 2) if(e.ClickCount >= 2)
{ {
this.spline.createShape(null, this.drawingObjects); History.Create_NewPoint();
var shape = this.spline.createShape(null, this.drawingObjects);
asc["editor"].asc_endAddShape(); asc["editor"].asc_endAddShape();
this.drawingObjectsController.clearTrackObjects(); this.drawingObjectsController.clearTrackObjects();
...@@ -4138,6 +4137,10 @@ function SplineBezierState2(drawingObjectsController, drawingObjects, startX, st ...@@ -4138,6 +4137,10 @@ function SplineBezierState2(drawingObjectsController, drawingObjects, startX, st
this.drawingObjectsController.changeCurrentState(new NullState(this.drawingObjectsController, this.drawingObjects)); this.drawingObjectsController.changeCurrentState(new NullState(this.drawingObjectsController, this.drawingObjects));
asc["editor"].asc_endAddShape(); asc["editor"].asc_endAddShape();
this.drawingObjects.objectLocker.reset();
this.drawingObjects.objectLocker.addObjectId(shape.Get_Id());
this.drawingObjects.objectLocker.checkObjects(function(bLock){});
} }
}; };
...@@ -4185,7 +4188,8 @@ function SplineBezierState3(drawingObjectsController, drawingObjects, startX, st ...@@ -4185,7 +4188,8 @@ function SplineBezierState3(drawingObjectsController, drawingObjects, startX, st
{ {
if(e.ClickCount >= 2) if(e.ClickCount >= 2)
{ {
this.spline.createShape(this.drawingObjects); History.Create_NewPoint();
var shape = this.spline.createShape(this.drawingObjects);
asc["editor"].asc_endAddShape(); asc["editor"].asc_endAddShape();
this.drawingObjectsController.clearTrackObjects(); this.drawingObjectsController.clearTrackObjects();
...@@ -4193,6 +4197,11 @@ function SplineBezierState3(drawingObjectsController, drawingObjects, startX, st ...@@ -4193,6 +4197,11 @@ function SplineBezierState3(drawingObjectsController, drawingObjects, startX, st
this.drawingObjectsController.changeCurrentState(new NullState(this.drawingObjectsController, this.drawingObjects)); this.drawingObjectsController.changeCurrentState(new NullState(this.drawingObjectsController, this.drawingObjects));
asc["editor"].asc_endAddShape(); asc["editor"].asc_endAddShape();
this.drawingObjects.objectLocker.reset();
this.drawingObjects.objectLocker.addObjectId(shape.Get_Id());
this.drawingObjects.objectLocker.checkObjects(function(bLock){});
} }
}; };
...@@ -4274,7 +4283,8 @@ function SplineBezierState4(drawingObjectsController, drawingObjects, spline) ...@@ -4274,7 +4283,8 @@ function SplineBezierState4(drawingObjectsController, drawingObjects, spline)
{ {
if(e.ClickCount >= 2) if(e.ClickCount >= 2)
{ {
this.spline.createShape(this.drawingObjects); History.Create_NewPoint();
var shape = this.spline.createShape(this.drawingObjects);
asc["editor"].asc_endAddShape(); asc["editor"].asc_endAddShape();
this.drawingObjectsController.clearTrackObjects(); this.drawingObjectsController.clearTrackObjects();
...@@ -4282,6 +4292,10 @@ function SplineBezierState4(drawingObjectsController, drawingObjects, spline) ...@@ -4282,6 +4292,10 @@ function SplineBezierState4(drawingObjectsController, drawingObjects, spline)
this.drawingObjectsController.changeCurrentState(new NullState(this.drawingObjectsController, this.drawingObjects)); this.drawingObjectsController.changeCurrentState(new NullState(this.drawingObjectsController, this.drawingObjects));
asc["editor"].asc_endAddShape(); asc["editor"].asc_endAddShape();
this.drawingObjects.objectLocker.reset();
this.drawingObjects.objectLocker.addObjectId(shape.Get_Id());
this.drawingObjects.objectLocker.checkObjects(function(bLock){});
} }
}; };
...@@ -4382,13 +4396,18 @@ function SplineBezierState5(drawingObjectsController, drawingObjects, startX, st ...@@ -4382,13 +4396,18 @@ function SplineBezierState5(drawingObjectsController, drawingObjects, startX, st
{ {
if(e.ClickCount >= 2) if(e.ClickCount >= 2)
{ {
this.spline.createShape(this.drawingObjects); History.Create_NewPoint();
var shape = this.spline.createShape(this.drawingObjects);
asc["editor"].asc_endAddShape(); asc["editor"].asc_endAddShape();
this.drawingObjectsController.clearTrackObjects(); this.drawingObjectsController.clearTrackObjects();
this.drawingObjects.OnUpdateOverlay(); this.drawingObjects.OnUpdateOverlay();
this.drawingObjectsController.changeCurrentState(new NullState(this.drawingObjectsController, this.drawingObjects)); this.drawingObjectsController.changeCurrentState(new NullState(this.drawingObjectsController, this.drawingObjects));
asc["editor"].asc_endAddShape(); asc["editor"].asc_endAddShape();
this.drawingObjects.objectLocker.reset();
this.drawingObjects.objectLocker.addObjectId(shape.Get_Id());
this.drawingObjects.objectLocker.checkObjects(function(bLock){});
} }
}; };
...@@ -4560,7 +4579,12 @@ function PolyLineAddState2(drawingObjectsController, drawingObjects, minDistance ...@@ -4560,7 +4579,12 @@ function PolyLineAddState2(drawingObjectsController, drawingObjects, minDistance
{ {
if(this.polyline.arrPoint.length > 1) if(this.polyline.arrPoint.length > 1)
{ {
this.polyline.createShape(); History.Create_NewPoint();
var shape = this.polyline.createShape();
this.drawingObjects.objectLocker.reset();
this.drawingObjects.objectLocker.addObjectId(shape.Get_Id());
this.drawingObjects.objectLocker.checkObjects(function(bLock){});
} }
this.drawingObjectsController.clearTrackObjects(); this.drawingObjectsController.clearTrackObjects();
...@@ -4701,7 +4725,11 @@ function AddPolyLine2State3(drawingObjectsController, drawingObjects, polyline) ...@@ -4701,7 +4725,11 @@ function AddPolyLine2State3(drawingObjectsController, drawingObjects, polyline)
this.polyline.arrPoint.push({x: x, y: y}); this.polyline.arrPoint.push({x: x, y: y});
if(e.ClickCount > 1) if(e.ClickCount > 1)
{ {
this.polyline.createShape(); History.Create_NewPoint();
var shape = this.polyline.createShape();
this.drawingObjects.objectLocker.reset();
this.drawingObjects.objectLocker.addObjectId(shape.Get_Id());
this.drawingObjects.objectLocker.checkObjects(function(bLock){});
this.drawingObjectsController.clearTrackObjects(); this.drawingObjectsController.clearTrackObjects();
this.drawingObjects.OnUpdateOverlay(); this.drawingObjects.OnUpdateOverlay();
this.drawingObjectsController.changeCurrentState(new NullState(this.drawingObjectsController, this.drawingObjects)); this.drawingObjectsController.changeCurrentState(new NullState(this.drawingObjectsController, this.drawingObjects));
......
...@@ -134,9 +134,10 @@ function PolyLine (drawingObjects) ...@@ -134,9 +134,10 @@ function PolyLine (drawingObjects)
var shape = new CShape(null, this.drawingObjects); var shape = new CShape(null, this.drawingObjects);
shape.setXfrmObject(new CXfrm());
shape.setPosition(xMin, yMin); shape.setPosition(xMin, yMin);
shape.setExtents(xMax-xMin, yMax-yMin); shape.setExtents(xMax-xMin, yMax-yMin);
shape.setStyle(CreateDefaultShapeStyle()); shape.setStyleBinary(CreateDefaultShapeStyle());
var geometry = new CGeometry(); var geometry = new CGeometry();
geometry.AddPathCommand(0, undefined, bClosed ? "norm": "none", undefined, xMax - xMin, yMax-yMin); geometry.AddPathCommand(0, undefined, bClosed ? "norm": "none", undefined, xMax - xMin, yMax-yMin);
...@@ -151,10 +152,14 @@ function PolyLine (drawingObjects) ...@@ -151,10 +152,14 @@ function PolyLine (drawingObjects)
geometry.AddPathCommand(6); geometry.AddPathCommand(6);
} }
geometry.Init( xMax-xMin, yMax-yMin); geometry.Init( xMax-xMin, yMax-yMin);
shape.spPr.geometry = geometry; shape.setGeometry(geometry);
shape.recalculate(); shape.recalculate();
this.drawingObjects.addGraphicObject(shape); shape.addToDrawingObjects();
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_RecalculateAfterInit, null, null,
new UndoRedoDataGraphicObjects(shape.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
return shape;
} }
} }
......
...@@ -247,10 +247,10 @@ function Spline(drawingObjects) ...@@ -247,10 +247,10 @@ function Spline(drawingObjects)
yMin = min_y; yMin = min_y;
yMax = max_y; yMax = max_y;
var shape = new CShape(null, this.drawingObjects); var shape = new CShape(null, this.drawingObjects);
shape.setXfrmObject(new CXfrm());
shape.setPosition(xMin, yMin); shape.setPosition(xMin, yMin);
shape.setExtents(xMax-xMin, yMax-yMin); shape.setExtents(xMax-xMin, yMax-yMin);
shape.setStyle(CreateDefaultShapeStyle()); shape.setStyleBinary(CreateDefaultShapeStyle());
var geometry = new CGeometry(); var geometry = new CGeometry();
geometry.AddPathCommand(0, undefined, bClosed ? "norm": "none", undefined, xMax - xMin, yMax-yMin); geometry.AddPathCommand(0, undefined, bClosed ? "norm": "none", undefined, xMax - xMin, yMax-yMin);
...@@ -281,9 +281,13 @@ function Spline(drawingObjects) ...@@ -281,9 +281,13 @@ function Spline(drawingObjects)
geometry.AddPathCommand(6); geometry.AddPathCommand(6);
} }
geometry.Init( xMax-xMin, yMax-yMin); geometry.Init( xMax-xMin, yMax-yMin);
shape.spPr.geometry = geometry; shape.setGeometry(geometry);
shape.recalculate(); shape.recalculate();
this.drawingObjects.addGraphicObject(shape); shape.addToDrawingObjects();
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_RecalculateAfterInit, null, null,
new UndoRedoDataGraphicObjects(shape.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
return shape;
}; };
this.addPathCommand = function(pathCommand) this.addPathCommand = function(pathCommand)
......
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