diff options
author | Henry Castro <hcastro@collabora.com> | 2018-11-13 22:31:25 -0400 |
---|---|---|
committer | Jan Holesovsky <kendy@collabora.com> | 2018-12-10 12:27:16 +0100 |
commit | 8c998edfec9a18decb5793f5547339389b10fc68 (patch) | |
tree | 7f01e7c8b4afe511fabf3f66b38662fe311fa7b6 | |
parent | 452d6ea1556fe208d26fac0443ae68ff5ad17877 (diff) |
add parameter TransformRotationDeltaAngle to .uno:TransformDialog
Change-Id: Ib22ba6956afedf1eea055e0ac3a78c53b4ee5861
-rw-r--r-- | include/svx/svxids.hrc | 1 | ||||
-rw-r--r-- | svx/sdi/svx.sdi | 2 | ||||
-rw-r--r-- | svx/source/svdraw/svdedtv1.cxx | 10 | ||||
-rw-r--r-- | sw/source/uibase/shells/frmsh.cxx | 26 |
4 files changed, 28 insertions, 11 deletions
diff --git a/include/svx/svxids.hrc b/include/svx/svxids.hrc index 8d0e22a22179..8649f2ba2317 100644 --- a/include/svx/svxids.hrc +++ b/include/svx/svxids.hrc @@ -252,6 +252,7 @@ #define SID_ATTR_TRANSFORM_ROT_X ( SID_SVX_START + 93 ) #define SID_ATTR_TRANSFORM_ROT_Y ( SID_SVX_START + 94 ) #define SID_ATTR_TRANSFORM_ANGLE ( SID_SVX_START + 95 ) +#define SID_ATTR_TRANSFORM_DELTA_ANGLE ( SID_SVX_START + 96 ) #define SID_SIZE_ALL ( SID_SVX_START + 101 ) #define SID_DRAW_LINE ( SID_SVX_START + 102 ) #define SID_DRAW_XLINE ( SID_SVX_START + 103 ) diff --git a/svx/sdi/svx.sdi b/svx/sdi/svx.sdi index d6311e5d7e22..f303263c5879 100644 --- a/svx/sdi/svx.sdi +++ b/svx/sdi/svx.sdi @@ -8523,7 +8523,7 @@ SvxULSpaceItem TopBottomMargin SID_ATTR_ULSPACE SfxVoidItem TransformDialog SID_ATTR_TRANSFORM -(SfxUInt32Item TransformRotationAngle SID_ATTR_TRANSFORM_ANGLE,SfxUInt32Item TransformRotationX SID_ATTR_TRANSFORM_ROT_X,SfxUInt32Item TransformRotationY SID_ATTR_TRANSFORM_ROT_Y) +(SfxUInt32Item TransformRotationDeltaAngle SID_ATTR_TRANSFORM_DELTA_ANGLE,SfxUInt32Item TransformRotationAngle SID_ATTR_TRANSFORM_ANGLE,SfxUInt32Item TransformRotationX SID_ATTR_TRANSFORM_ROT_X,SfxUInt32Item TransformRotationY SID_ATTR_TRANSFORM_ROT_Y) [ AutoUpdate = FALSE, FastCall = TRUE, diff --git a/svx/source/svdraw/svdedtv1.cxx b/svx/source/svdraw/svdedtv1.cxx index 32c1885a112e..c72860a2283f 100644 --- a/svx/source/svdraw/svdedtv1.cxx +++ b/svx/source/svdraw/svdedtv1.cxx @@ -1517,8 +1517,14 @@ void SdrEditView::SetGeoAttrToMarked(const SfxItemSet& rAttr) } // rotation - if (SfxItemState::SET==rAttr.GetItemState(SID_ATTR_TRANSFORM_ANGLE,true,&pPoolItem)) { - nRotateAngle=static_cast<const SfxInt32Item*>(pPoolItem)->GetValue()-nOldRotateAngle; + if (SfxItemState::SET == rAttr.GetItemState(SID_ATTR_TRANSFORM_DELTA_ANGLE, true, &pPoolItem)) { + nRotateAngle = static_cast<const SfxInt32Item*>(pPoolItem)->GetValue() + nOldRotateAngle; + bRotate = (nRotateAngle != 0); + } + + // rotation + if (SfxItemState::SET == rAttr.GetItemState(SID_ATTR_TRANSFORM_ANGLE, true, &pPoolItem)) { + nRotateAngle = static_cast<const SfxInt32Item*>(pPoolItem)->GetValue() - nOldRotateAngle; bRotate = (nRotateAngle != 0); } diff --git a/sw/source/uibase/shells/frmsh.cxx b/sw/source/uibase/shells/frmsh.cxx index 9e4761cd9da4..90b90e6bcbf0 100644 --- a/sw/source/uibase/shells/frmsh.cxx +++ b/sw/source/uibase/shells/frmsh.cxx @@ -364,20 +364,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 = 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 (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 ) |