[Libreoffice-commits] core.git: sw/source
giacco
filippo.giacche at gmail.com
Fri Jan 27 17:10:37 UTC 2017
sw/source/uibase/shells/grfsh.cxx | 17 ++++-------------
1 file changed, 4 insertions(+), 13 deletions(-)
New commits:
commit ee7e34696e3981c65dd5a13688976aead450a709
Author: giacco <filippo.giacche at gmail.com>
Date: Fri Jan 27 15:47:06 2017 +0000
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 at libreoffice.org>
Reviewed-by: Katarina Behrens <Katarina.Behrens at cib.de>
diff --git a/sw/source/uibase/shells/grfsh.cxx b/sw/source/uibase/shells/grfsh.cxx
index 953fd25..ecbf507 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();
More information about the Libreoffice-commits
mailing list