diff options
author | giacco <filippo.giacche@gmail.com> | 2016-10-20 10:03:44 +0200 |
---|---|---|
committer | jan iversen <jani@documentfoundation.org> | 2016-12-23 18:29:37 +0000 |
commit | 5f116966de4c0d007c2a420b7adc74d72e728b89 (patch) | |
tree | e64d178e0e7ba65b99ad60c9dab364d10b1694b3 /sw/source | |
parent | 5c983bc2ab020b0dbbd8f58e66b9a6fd8508bfde (diff) |
tdf#87700 command to rotate 180 degrees
added command to rotate an image 180 degrees in Writer
Change-Id: I4a1e40f4c3475aceb24edd44691a74372f61b49a
Reviewed-on: https://gerrit.libreoffice.org/30074
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Reviewed-by: Heiko Tietze <tietze.heiko@googlemail.com>
Reviewed-by: jan iversen <jani@documentfoundation.org>
Tested-by: jan iversen <jani@documentfoundation.org>
Diffstat (limited to 'sw/source')
-rw-r--r-- | sw/source/uibase/shells/grfsh.cxx | 29 |
1 files changed, 26 insertions, 3 deletions
diff --git a/sw/source/uibase/shells/grfsh.cxx b/sw/source/uibase/shells/grfsh.cxx index 73064dff0787..953fd25f9327 100644 --- a/sw/source/uibase/shells/grfsh.cxx +++ b/sw/source/uibase/shells/grfsh.cxx @@ -849,6 +849,10 @@ void SwGrfShell::ExecuteRotation(SfxRequest &rReq) { aRotation = 2700; } + else if (rReq.GetSlot() == SID_ROTATE_GRAPHIC_180) + { + aRotation = 1800; + } else { return; @@ -863,12 +867,23 @@ void SwGrfShell::ExecuteRotation(SfxRequest &rReq) rShell.ReRead(OUString(), OUString(), const_cast<const Graphic*>(&aGraphic)); SwFlyFrameAttrMgr aManager(false, &rShell, rShell.IsFrameSelected() ? Frmmgr_Type::NONE : Frmmgr_Type::GRF); - const long nRotatedWidth = aManager.GetSize().Height(); - const long nRotatedHeight = aManager.GetSize().Width(); + long nRotatedWidth = 0; + long nRotatedHeight = 0; + if(rReq.GetSlot() == SID_ROTATE_GRAPHIC_180) + { + nRotatedWidth = aManager.GetSize().Width(); + nRotatedHeight = aManager.GetSize().Height(); + + } + else + { + nRotatedWidth = aManager.GetSize().Height(); + nRotatedHeight = aManager.GetSize().Width(); + + } Size aSize(nRotatedWidth, nRotatedHeight); aManager.SetSize(aSize); aManager.UpdateFlyFrame(); - SfxItemSet aSet( rShell.GetAttrPool(), RES_GRFATR_CROPGRF, RES_GRFATR_CROPGRF ); rShell.GetCurAttr( aSet ); SwCropGrf aCrop( static_cast<const SwCropGrf&>( aSet.Get(RES_GRFATR_CROPGRF) ) ); @@ -888,6 +903,13 @@ void SwGrfShell::ExecuteRotation(SfxRequest &rReq) aCrop.SetRight( aCropRectangle.Top() ); aCrop.SetBottom( aCropRectangle.Right() ); } + else if (rReq.GetSlot() == SID_ROTATE_GRAPHIC_180) + { + aCrop.SetLeft( aCropRectangle.Right() ); + aCrop.SetTop( aCropRectangle.Bottom() ); + aCrop.SetRight( aCropRectangle.Left() ); + aCrop.SetBottom( aCropRectangle.Top() ); + } rShell.SetAttrItem(aCrop); @@ -911,6 +933,7 @@ void SwGrfShell::GetAttrStateForRotation(SfxItemSet &rSet) { case SID_ROTATE_GRAPHIC_LEFT: case SID_ROTATE_GRAPHIC_RIGHT: + case SID_ROTATE_GRAPHIC_180: if( rShell.GetGraphicType() == GraphicType::NONE ) { bDisable = true; |