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

Bug 25975 - Не отменяется добавление автофигуры клавишей Escape

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@61147 954022d7-b5bf-4e40-9824-e11837661b57
parent 2c33fb28
...@@ -4161,12 +4161,16 @@ DrawingObjectsController.prototype = ...@@ -4161,12 +4161,16 @@ DrawingObjectsController.prototype =
} }
else else
{ {
this.resetSelection(); if(!this.checkEndAddShape())
var ws = drawingObjectsController.drawingObjects.getWorksheet(); {
var isChangeSelectionShape = ws._checkSelectionShape();
if (isChangeSelectionShape) { this.resetSelection();
ws._drawSelection(); var ws = drawingObjectsController.drawingObjects.getWorksheet();
ws._updateSelectionNameAndInfo(); var isChangeSelectionShape = ws._checkSelectionShape();
if (isChangeSelectionShape) {
ws._drawSelection();
ws._updateSelectionNameAndInfo();
}
} }
} }
bRetValue = true; bRetValue = true;
...@@ -4449,6 +4453,29 @@ DrawingObjectsController.prototype = ...@@ -4449,6 +4453,29 @@ DrawingObjectsController.prototype =
return bRetValue; return bRetValue;
}, },
checkEndAddShape: function()
{
if(this.curState instanceof StartAddNewShape
|| this.curState instanceof SplineBezierState
|| this.curState instanceof PolyLineAddState
|| this.curState instanceof AddPolyLine2State
|| this.arrTrackObjects.length > 0)
{
this.changeCurrentState(new NullState(this));
if( this.arrTrackObjects.length > 0)
{
this.clearTrackObjects();
this.updateOverlay();
}
if(asc["editor"])
{
asc["editor"].asc_endAddShape();
}
return true;
}
return false;
},
/*onKeyPress: function(e) /*onKeyPress: function(e)
{ {
this.curState.onKeyPress(e); this.curState.onKeyPress(e);
......
...@@ -762,6 +762,7 @@ ...@@ -762,6 +762,7 @@
// Перехватим Esc и отключим дефалтовую обработку // Перехватим Esc и отключим дефалтовую обработку
stop(); stop();
t.handlers.trigger("stopFormatPainter"); t.handlers.trigger("stopFormatPainter");
t.handlers.trigger("stopAddShape");
return result; return result;
case 144: //Num Lock case 144: //Num Lock
......
...@@ -335,8 +335,11 @@ ...@@ -335,8 +335,11 @@
"getGraphicsInfo": function () {return self._onGetGraphicsInfo.apply(self, arguments);}, "getGraphicsInfo": function () {return self._onGetGraphicsInfo.apply(self, arguments);},
"getSelectedGraphicObjects": function () {return self._onGetSelectedGraphicObjects.apply(self, arguments);}, "getSelectedGraphicObjects": function () {return self._onGetSelectedGraphicObjects.apply(self, arguments);},
"updateSelectionShape": function () {return self._onUpdateSelectionShape.apply(self, arguments);}, "updateSelectionShape": function () {return self._onUpdateSelectionShape.apply(self, arguments);},
"canReceiveKeyPress": function () {return self.getWorksheet().objectRender.controller.canReceiveKeyPress()}, "canReceiveKeyPress": function () {return self.getWorksheet().objectRender.controller.canReceiveKeyPress();},
"stopAddShape": function () {
self.getWorksheet().objectRender.controller.checkEndAddShape();
},
// Frozen anchor // Frozen anchor
"moveFrozenAnchorHandle": function () {self._onMoveFrozenAnchorHandle.apply(self, arguments);}, "moveFrozenAnchorHandle": function () {self._onMoveFrozenAnchorHandle.apply(self, arguments);},
"moveFrozenAnchorHandleDone": function () {self._onMoveFrozenAnchorHandleDone.apply(self, arguments);}, "moveFrozenAnchorHandleDone": function () {self._onMoveFrozenAnchorHandleDone.apply(self, arguments);},
......
...@@ -1672,9 +1672,30 @@ CPresentation.prototype = ...@@ -1672,9 +1672,30 @@ CPresentation.prototype =
} }
else if ( e.KeyCode == 27 ) // Esc else if ( e.KeyCode == 27 ) // Esc
{ {
if(editor.sync_EndAddShape)
{
editor.sync_EndAddShape();
}
if(this.Slides[this.CurPage]) if(this.Slides[this.CurPage])
{ {
var oDrawingObjects = this.Slides[this.CurPage].graphicObjects; var oDrawingObjects = this.Slides[this.CurPage].graphicObjects;
if(oDrawingObjects.curState instanceof StartAddNewShape
|| oDrawingObjects.curState instanceof SplineBezierState
|| oDrawingObjects.curState instanceof PolyLineAddState
|| oDrawingObjects.curState instanceof AddPolyLine2State
|| oDrawingObjects.arrTrackObjects.length > 0)
{
oDrawingObjects.changeCurrentState(new NullState(oDrawingObjects));
if( oDrawingObjects.arrTrackObjects.length > 0)
{
oDrawingObjects.clearTrackObjects();
oDrawingObjects.updateOverlay();
}
editor.sync_EndAddShape();
this.Update_CursorType( 0, 0, new CMouseEventHandler() );
return;
}
var oTargetTextObject = getTargetTextObject(oDrawingObjects); var oTargetTextObject = getTargetTextObject(oDrawingObjects);
var bNeedRedraw; var bNeedRedraw;
......
...@@ -9321,6 +9321,12 @@ CDocument.prototype = ...@@ -9321,6 +9321,12 @@ CDocument.prototype =
editor.sync_PaintFormatCallback( c_oAscFormatPainterState.kOff ); editor.sync_PaintFormatCallback( c_oAscFormatPainterState.kOff );
this.Update_CursorType( this.CurPos.RealX, this.CurPos.RealY, this.CurPage, new CMouseEventHandler() ); this.Update_CursorType( this.CurPos.RealX, this.CurPos.RealY, this.CurPage, new CMouseEventHandler() );
} }
else if(editor.isStartAddShape)
{
editor.sync_StartAddShapeCallback( false );
editor.sync_EndAddShape();
this.Update_CursorType( this.CurPos.RealX, this.CurPos.RealY, this.CurPage, new CMouseEventHandler() );
}
else if ( docpostype_DrawingObjects === this.CurPos.Type || (docpostype_HdrFtr === this.CurPos.Type && null != this.HdrFtr.CurHdrFtr && docpostype_DrawingObjects === this.HdrFtr.CurHdrFtr.Content.CurPos.Type ) ) else if ( docpostype_DrawingObjects === this.CurPos.Type || (docpostype_HdrFtr === this.CurPos.Type && null != this.HdrFtr.CurHdrFtr && docpostype_DrawingObjects === this.HdrFtr.CurHdrFtr.Content.CurPos.Type ) )
{ {
this.DrawingObjects.resetSelection2(); this.DrawingObjects.resetSelection2();
......
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