Commit 98baac2c 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@68741 954022d7-b5bf-4e40-9824-e11837661b57
parent 60eb53e9
...@@ -651,7 +651,7 @@ DrawingObjectsController.prototype = ...@@ -651,7 +651,7 @@ DrawingObjectsController.prototype =
object.selectionSetStart(e, x, y, pageIndex); object.selectionSetStart(e, x, y, pageIndex);
this.changeCurrentState(new TextAddState(this, object)); this.changeCurrentState(new TextAddState(this, object, x, y));
return true; return true;
} }
else else
......
...@@ -249,7 +249,7 @@ function handleGroup(drawing, drawingObjectsController, e, x, y, group, pageInde ...@@ -249,7 +249,7 @@ function handleGroup(drawing, drawingObjectsController, e, x, y, group, pageInde
cur_grouped_object.selectTitle(title, pageIndex); cur_grouped_object.selectTitle(title, pageIndex);
cur_grouped_object.selection.textSelection = title; cur_grouped_object.selection.textSelection = title;
title.selectionSetStart(e, x, y, pageIndex); title.selectionSetStart(e, x, y, pageIndex);
drawingObjectsController.changeCurrentState(new TextAddState(drawingObjectsController, title)); drawingObjectsController.changeCurrentState(new TextAddState(drawingObjectsController, title, x, y));
if(e.ClickCount <= 1) if(e.ClickCount <= 1)
{ {
drawingObjectsController.updateSelectionState(); drawingObjectsController.updateSelectionState();
...@@ -330,7 +330,7 @@ function handleChart(drawing, drawingObjectsController, e, x, y, group, pageInde ...@@ -330,7 +330,7 @@ function handleChart(drawing, drawingObjectsController, e, x, y, group, pageInde
drawing.selection.textSelection = title; drawing.selection.textSelection = title;
} }
title.selectionSetStart(e, x, y, pageIndex); title.selectionSetStart(e, x, y, pageIndex);
drawingObjectsController.changeCurrentState(new TextAddState(drawingObjectsController, title)); drawingObjectsController.changeCurrentState(new TextAddState(drawingObjectsController, title, x, y));
if(e.ClickCount <= 1) if(e.ClickCount <= 1)
{ {
drawingObjectsController.updateSelectionState(); drawingObjectsController.updateSelectionState();
...@@ -432,7 +432,7 @@ function handleInlineChart(drawing, drawingObjectsController, e, x, y, pageIndex ...@@ -432,7 +432,7 @@ function handleInlineChart(drawing, drawingObjectsController, e, x, y, pageIndex
drawing.selectTitle(title, pageIndex); drawing.selectTitle(title, pageIndex);
drawing.selection.textSelection = title; drawing.selection.textSelection = title;
title.selectionSetStart(e, x, y, pageIndex); title.selectionSetStart(e, x, y, pageIndex);
drawingObjectsController.changeCurrentState(new TextAddState(drawingObjectsController, title)); drawingObjectsController.changeCurrentState(new TextAddState(drawingObjectsController, title, x, y));
if(e.ClickCount <= 1) if(e.ClickCount <= 1)
{ {
drawingObjectsController.updateSelectionState(); drawingObjectsController.updateSelectionState();
...@@ -590,7 +590,7 @@ function handleFloatTable(drawing, drawingObjectsController, e, x, y, group, pag ...@@ -590,7 +590,7 @@ function handleFloatTable(drawing, drawingObjectsController, e, x, y, group, pag
drawingObjectsController.selectObject(group, pageIndex); drawingObjectsController.selectObject(group, pageIndex);
drawingObjectsController.selection.groupSelection = group; drawingObjectsController.selection.groupSelection = group;
} }
drawingObjectsController.changeCurrentState(new TextAddState(drawingObjectsController, drawing)); drawingObjectsController.changeCurrentState(new TextAddState(drawingObjectsController, drawing, x, y));
return true; return true;
} }
else else
......
...@@ -1230,10 +1230,12 @@ ChangeAdjInGroupState.prototype = ...@@ -1230,10 +1230,12 @@ ChangeAdjInGroupState.prototype =
onMouseUp: MoveInGroupState.prototype.onMouseUp onMouseUp: MoveInGroupState.prototype.onMouseUp
}; };
function TextAddState(drawingObjects, majorObject) function TextAddState(drawingObjects, majorObject, startX, startY)
{ {
this.drawingObjects =drawingObjects; this.drawingObjects = drawingObjects;
this.majorObject = majorObject; this.majorObject = majorObject;
this.startX = startX;
this.startY = startY;
} }
TextAddState.prototype = TextAddState.prototype =
...@@ -1252,6 +1254,15 @@ TextAddState.prototype = ...@@ -1252,6 +1254,15 @@ TextAddState.prototype =
this.onMouseUp(e, x, y, pageIndex); this.onMouseUp(e, x, y, pageIndex);
return; return;
} }
if(isRealNumber(this.startX) && isRealNumber(this.startY))
{
if(Math.abs(this.startX - x) < 0.001 && Math.abs(this.startY - y) < 0.001)
{
return;
}
this.startX = undefined;
this.startY = undefined;
}
this.majorObject.selectionSetEnd(e, x, y, pageIndex); this.majorObject.selectionSetEnd(e, x, y, pageIndex);
if(!(this.majorObject.getObjectType() === historyitem_type_GraphicFrame && this.majorObject.graphicObject.Selection.Type2 === table_Selection_Border)) if(!(this.majorObject.getObjectType() === historyitem_type_GraphicFrame && this.majorObject.graphicObject.Selection.Type2 === table_Selection_Border))
this.drawingObjects.updateSelectionState(); this.drawingObjects.updateSelectionState();
......
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