summaryrefslogtreecommitdiff
path: root/sw/source/uibase/shells/frmsh.cxx
diff options
context:
space:
mode:
authorArmin Le Grand <Armin.Le.Grand@cib.de>2017-09-22 15:28:33 +0200
committerArmin Le Grand <Armin.Le.Grand@cib.de>2017-10-20 14:13:20 +0200
commita42b0985c7619efdc934bb1cf19e5e2c2b6faea2 (patch)
treeb91427e905792292220b01aba45fc80d66d19349 /sw/source/uibase/shells/frmsh.cxx
parent2e001b40ad0d19c8db528bb4df739e289163779d (diff)
RotGrfFlyFrame: Initial adaptions
To allow free rotation of Graphic FlyFrames in Writer, several adaptions are necessary. This change takes care of all needed changes to internally support a freely definable rotation angle for that case. Save/Load round trip is working, the graphic does no longer get modified and added in 90-degree-changed state to the object, the original will be preserved. Support for needed slot in core/ui is implemented. Rotation can be applied from Menus/Toolbars in the known 90/180 degree steps. Added a slot/Button/command to reset rotation in these cases. Added support in Sidebar to rotate using the rotation wheel and/or numeric field. These fields and support added to Image TabPage, too, fully functional. Missing now is a solution for displaying the rotated Graphic. For now, it just gets rotated, but this will not be the final state of this change. Change-Id: I6f3b85ebb5be2b4ad3311c536d54f27a37a494e7 RotGrfFlyFrame: Linux build adaptions Change-Id: I365287ecd6525b1972e8436d61332f7121d88649
Diffstat (limited to 'sw/source/uibase/shells/frmsh.cxx')
-rw-r--r--sw/source/uibase/shells/frmsh.cxx17
1 files changed, 17 insertions, 0 deletions
diff --git a/sw/source/uibase/shells/frmsh.cxx b/sw/source/uibase/shells/frmsh.cxx
index c995c01987ce..9e4761cd9da4 100644
--- a/sw/source/uibase/shells/frmsh.cxx
+++ b/sw/source/uibase/shells/frmsh.cxx
@@ -85,6 +85,7 @@
#define SwFrameShell
#include <sfx2/msg.hxx>
#include <swslots.hxx>
+#include <grfatr.hxx>
using ::editeng::SvxBorderLine;
using namespace ::com::sun::star;
@@ -363,6 +364,22 @@ void SwFrameShell::Execute(SfxRequest &rReq)
bApplyNewSize = true;
}
+ // RotGrfFlyFrame: Get Value and disable is in SwGrfShell::GetAttrStateForRotation, but the
+ // value setter uses SID_ATTR_TRANSFORM and a group of three values. Rotation is
+ // added now, so use it in this central place. Do no forget to convert angle from
+ // 100th degrees in SID_ATTR_TRANSFORM_ANGLE to 10th degrees in RES_GRFATR_ROTATION
+ if (pArgs && SfxItemState::SET == pArgs->GetItemState(SID_ATTR_TRANSFORM_ANGLE, false, &pItem))
+ {
+ const sal_uInt32 nNewRot(static_cast<const SfxUInt32Item*>(pItem)->GetValue() / 10);
+ SfxItemSet aSet(rSh.GetAttrPool(), svl::Items<RES_GRFATR_ROTATION, RES_GRFATR_ROTATION>{} );
+ rSh.GetCurAttr(aSet);
+ const SwRotationGrf& rRotation = static_cast<const SwRotationGrf&>(aSet.Get(RES_GRFATR_ROTATION));
+ const sal_uInt32 nOldRot(rRotation.GetValue());
+
+ // RotGrfFlyFrame: Rotation change here, SwFlyFrameAttrMgr aMgr is available
+ aMgr.SetRotation(nOldRot, nNewRot, rRotation.GetUnrotatedSize());
+ }
+
if ( bApplyNewSize )
{
aMgr.SetSize( aNewSize );