diff options
author | Maxim Monastirsky <momonasmon@gmail.com> | 2018-09-14 00:22:00 +0300 |
---|---|---|
committer | Maxim Monastirsky <momonasmon@gmail.com> | 2018-09-14 15:06:45 +0200 |
commit | eb0a38c178179493f4c86314f78c5de75d18a482 (patch) | |
tree | e824d4d0d9b08692a277b3b22a1da46b9db014e5 | |
parent | a4503017dfcf0c919b8f81bd8cdbc44bade3f774 (diff) |
tdf#119836 tdf#118840 Toggle behavior for some draw commands
Keeping a function active after a subsequent click only makes sense
for shape drawing, as it's used to lock the function so more that one
shape can be drawn in a row. Otherwise just do what users expect, and
turn the function off.
Affected commands:
.uno:Mirror
.uno:Crop
.uno:InteractiveTransparence
.uno:InteractiveGradient
.uno:Shear
.uno:CrookRotate
.uno:CrookSlant
.uno:CrookStretch
.uno:ConvertInto3DLathe
.uno:ZoomMode
.uno:ZoomPanning
Change-Id: Ic441cd72423cbc0570c4a070402b474e85b5084b
Reviewed-on: https://gerrit.libreoffice.org/60472
Tested-by: Jenkins
Reviewed-by: Heiko Tietze <tietze.heiko@gmail.com>
Tested-by: Heiko Tietze <tietze.heiko@gmail.com>
-rw-r--r-- | sd/source/ui/view/drviewse.cxx | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/sd/source/ui/view/drviewse.cxx b/sd/source/ui/view/drviewse.cxx index eaf4612ef6b9..6245206d2c0a 100644 --- a/sd/source/ui/view/drviewse.cxx +++ b/sd/source/ui/view/drviewse.cxx @@ -304,16 +304,13 @@ void DrawViewShell::FuPermanent(SfxRequest& rReq) case SID_OBJECT_CROOK_STRETCH: case SID_CONVERT_TO_3D_LATHE: { - short nSlotId = rReq.GetSlot(); + sal_uInt16 nSlotId = rReq.GetSlot(); - if( nSlotId == sal_uInt16(SID_OBJECT_ROTATE) ) + // toggle function + if( nOldSId == nSlotId ) { - // toggle rotation - if( nOldSId == nSlotId ) - { - nSlotId = SID_OBJECT_SELECT; - rReq.SetSlot( nSlotId ); - } + nSlotId = SID_OBJECT_SELECT; + rReq.SetSlot( nSlotId ); } if (nSlotId == SID_OBJECT_CROOK_ROTATE || @@ -544,8 +541,15 @@ void DrawViewShell::FuPermanent(SfxRequest& rReq) case SID_ZOOM_MODE: case SID_ZOOM_PANNING: { - mbZoomOnPage = false; - SetCurrentFunction( FuZoom::Create(this, GetActiveWindow(), mpDrawView.get(), GetDoc(), rReq ) ); + if (nOldSId != nSId) + { + mbZoomOnPage = false; + SetCurrentFunction( FuZoom::Create(this, GetActiveWindow(), mpDrawView.get(), GetDoc(), rReq ) ); + } + else + { + GetViewFrame()->GetDispatcher()->Execute(SID_OBJECT_SELECT, SfxCallMode::ASYNCHRON); + } rReq.Done(); } break; |