summaryrefslogtreecommitdiff
path: root/sw/source/uibase/shells/frmsh.cxx
diff options
context:
space:
mode:
authorHenry Castro <hcastro@collabora.com>2018-11-13 22:31:25 -0400
committerJan Holesovsky <kendy@collabora.com>2018-12-07 11:52:31 +0100
commita92733b33f969acffe57ea51f603bc98d7c15395 (patch)
treef96f06c91c33845f59f032b43a13414fb4088628 /sw/source/uibase/shells/frmsh.cxx
parentad5fb8798b295e9ad706a3836ffb53a0630f752f (diff)
add parameter TransformRotationDeltaAngle to .uno:TransformDialog
Change-Id: Ib22ba6956afedf1eea055e0ac3a78c53b4ee5861
Diffstat (limited to 'sw/source/uibase/shells/frmsh.cxx')
-rw-r--r--sw/source/uibase/shells/frmsh.cxx26
1 files changed, 18 insertions, 8 deletions
diff --git a/sw/source/uibase/shells/frmsh.cxx b/sw/source/uibase/shells/frmsh.cxx
index b2a6d4a0885a..31a599b4defc 100644
--- a/sw/source/uibase/shells/frmsh.cxx
+++ b/sw/source/uibase/shells/frmsh.cxx
@@ -362,20 +362,30 @@ 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))
+ if (pArgs && (pArgs->HasItem(SID_ATTR_TRANSFORM_ANGLE) || pArgs->HasItem(SID_ATTR_TRANSFORM_DELTA_ANGLE)))
{
- 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 = 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 (pArgs && SfxItemState::SET == pArgs->GetItemState(SID_ATTR_TRANSFORM_DELTA_ANGLE, false, &pItem))
+ {
+ const sal_uInt32 nDeltaRot(static_cast<const SfxUInt32Item*>(pItem)->GetValue() / 10);
+ aMgr.SetRotation(nOldRot, nOldRot + nDeltaRot, rRotation.GetUnrotatedSize());
+ }
+
+ // 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);
+
+ // RotGrfFlyFrame: Rotation change here, SwFlyFrameAttrMgr aMgr is available
+ aMgr.SetRotation(nOldRot, nNewRot, rRotation.GetUnrotatedSize());
+ }
}
if ( bApplyNewSize )