diff options
Diffstat (limited to 'sw/source/uibase/shells/grfsh.cxx')
-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; |