summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgiacco <filippo.giacche@gmail.com>2017-01-27 15:47:06 +0000
committerKatarina Behrens <Katarina.Behrens@cib.de>2017-01-27 17:09:50 +0000
commitee7e34696e3981c65dd5a13688976aead450a709 (patch)
tree153fc4d215c63a999304eb44fc417d4115acea60
parent9ee0f108ca104ec76d2d73220686fb10c89e78e8 (diff)
tdf#87700 command to rotate 180 degrees
same things, with less code Change-Id: Ied67277f1a48b58aba094f3ca650c08133e95d68 Reviewed-on: https://gerrit.libreoffice.org/33619 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Katarina Behrens <Katarina.Behrens@cib.de>
-rw-r--r--sw/source/uibase/shells/grfsh.cxx17
1 files changed, 4 insertions, 13 deletions
diff --git a/sw/source/uibase/shells/grfsh.cxx b/sw/source/uibase/shells/grfsh.cxx
index 953fd25f9327..ecbf5075b296 100644
--- a/sw/source/uibase/shells/grfsh.cxx
+++ b/sw/source/uibase/shells/grfsh.cxx
@@ -867,20 +867,11 @@ 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);
- 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();
- }
+ long nRotatedWidth = aManager.GetSize().Height();
+ long nRotatedHeight = aManager.GetSize().Width();
+ if (rReq.GetSlot() == SID_ROTATE_GRAPHIC_180)
+ std::swap(nRotatedWidth, nRotatedHeight);
Size aSize(nRotatedWidth, nRotatedHeight);
aManager.SetSize(aSize);
aManager.UpdateFlyFrame();