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

правка бага 21477 - Падение приложения при передаче автофигуры "произвольная линия"

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@50850 954022d7-b5bf-4e40-9824-e11837661b57
parent 0b190ad2
...@@ -628,7 +628,7 @@ CGraphicObjects.prototype = { ...@@ -628,7 +628,7 @@ CGraphicObjects.prototype = {
{ {
images.push(selected_object); images.push(selected_object);
} }
else if(typeof selected_object.isGroup()) else if(typeof selected_object.isGroup === "function" && selected_object.isGroup())
{ {
groups.push(selected_object); groups.push(selected_object);
} }
......
...@@ -3853,14 +3853,18 @@ function SplineBezierState2(drawingObjectsController, drawingObjects, startX, st ...@@ -3853,14 +3853,18 @@ function SplineBezierState2(drawingObjectsController, drawingObjects, startX, st
{ {
if(e.ClickCount >= 2) if(e.ClickCount >= 2)
{ {
History.Create_NewPoint();
var sp = this.spline.createShape(null, this.drawingObjects); var sp = this.spline.createShape(null, this.drawingObjects);
var p = editor.WordControl.m_oLogicDocument; var p = editor.WordControl.m_oLogicDocument;
if(p.Document_Is_SelectionLocked(changestype_AddShape, sp) === false) if(p.Document_Is_SelectionLocked(changestype_AddShape, sp) === false)
{ {
History.Create_NewPoint();
this.drawingObjects.addToSpTreeToPos(this.drawingObjects.cSld.spTree.length, sp); this.drawingObjects.addToSpTreeToPos(this.drawingObjects.cSld.spTree.length, sp);
p.Recalculate(); p.Recalculate();
} }
else
{
History.Undo();
}
this.drawingObjectsController.clearTrackObjects(); this.drawingObjectsController.clearTrackObjects();
...@@ -3915,14 +3919,19 @@ function SplineBezierState3(drawingObjectsController, drawingObjects, startX, st ...@@ -3915,14 +3919,19 @@ function SplineBezierState3(drawingObjectsController, drawingObjects, startX, st
{ {
if(e.ClickCount >= 2) if(e.ClickCount >= 2)
{ {
History.Create_NewPoint();
var sp = this.spline.createShape(this.drawingObjects); var sp = this.spline.createShape(this.drawingObjects);
var p = editor.WordControl.m_oLogicDocument; var p = editor.WordControl.m_oLogicDocument;
if(p.Document_Is_SelectionLocked(changestype_AddShape, sp) === false) if(p.Document_Is_SelectionLocked(changestype_AddShape, sp) === false)
{ {
History.Create_NewPoint();
this.drawingObjects.addToSpTreeToPos(this.drawingObjects.cSld.spTree.length, sp); this.drawingObjects.addToSpTreeToPos(this.drawingObjects.cSld.spTree.length, sp);
p.Recalculate(); p.Recalculate();
} }
else
{
History.Undo();
}
this.drawingObjectsController.clearTrackObjects(); this.drawingObjectsController.clearTrackObjects();
...@@ -4011,14 +4020,18 @@ function SplineBezierState4(drawingObjectsController, drawingObjects, spline) ...@@ -4011,14 +4020,18 @@ function SplineBezierState4(drawingObjectsController, drawingObjects, spline)
{ {
if(e.ClickCount >= 2) if(e.ClickCount >= 2)
{ {
History.Create_NewPoint();
var sp = this.spline.createShape(this.drawingObjects); var sp = this.spline.createShape(this.drawingObjects);
var p = editor.WordControl.m_oLogicDocument; var p = editor.WordControl.m_oLogicDocument;
if(p.Document_Is_SelectionLocked(changestype_AddShape, sp) === false) if(p.Document_Is_SelectionLocked(changestype_AddShape, sp) === false)
{ {
History.Create_NewPoint();
this.drawingObjects.addToSpTreeToPos(this.drawingObjects.cSld.spTree.length, sp); this.drawingObjects.addToSpTreeToPos(this.drawingObjects.cSld.spTree.length, sp);
p.Recalculate(); p.Recalculate();
} }
else
{
History.Undo();
}
this.drawingObjectsController.clearTrackObjects(); this.drawingObjectsController.clearTrackObjects();
...@@ -4126,14 +4139,18 @@ function SplineBezierState5(drawingObjectsController, drawingObjects, startX, st ...@@ -4126,14 +4139,18 @@ function SplineBezierState5(drawingObjectsController, drawingObjects, startX, st
{ {
if(e.ClickCount >= 2) if(e.ClickCount >= 2)
{ {
History.Create_NewPoint();
var sp = this.spline.createShape(this.drawingObjects); var sp = this.spline.createShape(this.drawingObjects);
var p = editor.WordControl.m_oLogicDocument; var p = editor.WordControl.m_oLogicDocument;
if(p.Document_Is_SelectionLocked(changestype_AddShape, sp) === false) if(p.Document_Is_SelectionLocked(changestype_AddShape, sp) === false)
{ {
History.Create_NewPoint();
this.drawingObjects.addToSpTreeToPos(this.drawingObjects.cSld.spTree.length, sp); this.drawingObjects.addToSpTreeToPos(this.drawingObjects.cSld.spTree.length, sp);
p.Recalculate(); p.Recalculate();
} }
else
{
History.Undo();
}
this.drawingObjectsController.clearTrackObjects(); this.drawingObjectsController.clearTrackObjects();
this.drawingObjects.OnUpdateOverlay(); this.drawingObjects.OnUpdateOverlay();
...@@ -4311,14 +4328,19 @@ function PolyLineAddState2(drawingObjectsController, drawingObjects, minDistance ...@@ -4311,14 +4328,19 @@ function PolyLineAddState2(drawingObjectsController, drawingObjects, minDistance
{ {
if(this.polyline.arrPoint.length > 1) if(this.polyline.arrPoint.length > 1)
{ {
History.Create_NewPoint();
var sp = this.polyline.createShape(); var sp = this.polyline.createShape();
var p = editor.WordControl.m_oLogicDocument; var p = editor.WordControl.m_oLogicDocument;
if(p.Document_Is_SelectionLocked(changestype_AddShape, sp) === false) if(p.Document_Is_SelectionLocked(changestype_AddShape, sp) === false)
{ {
History.Create_NewPoint();
this.drawingObjects.addToSpTreeToPos(this.drawingObjects.cSld.spTree.length, sp); this.drawingObjects.addToSpTreeToPos(this.drawingObjects.cSld.spTree.length, sp);
p.Recalculate(); p.Recalculate();
} }
else
{
History.Undo();
}
} }
...@@ -4460,14 +4482,19 @@ function AddPolyLine2State3(drawingObjectsController, drawingObjects, polyline) ...@@ -4460,14 +4482,19 @@ 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)
{ {
History.Create_NewPoint();
var sp = this.polyline.createShape(); var sp = this.polyline.createShape();
var p = editor.WordControl.m_oLogicDocument; var p = editor.WordControl.m_oLogicDocument;
if(p.Document_Is_SelectionLocked(changestype_AddShape, sp) === false) if(p.Document_Is_SelectionLocked(changestype_AddShape, sp) === false)
{ {
History.Create_NewPoint();
this.drawingObjects.addToSpTreeToPos(this.drawingObjects.cSld.spTree.length, sp); this.drawingObjects.addToSpTreeToPos(this.drawingObjects.cSld.spTree.length, sp);
p.Recalculate(); p.Recalculate();
} }
else
{
History.Undo();
}
this.drawingObjectsController.clearTrackObjects(); this.drawingObjectsController.clearTrackObjects();
this.drawingObjects.OnUpdateOverlay(); this.drawingObjects.OnUpdateOverlay();
......
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