From a92733b33f969acffe57ea51f603bc98d7c15395 Mon Sep 17 00:00:00 2001 From: Henry Castro Date: Tue, 13 Nov 2018 22:31:25 -0400 Subject: add parameter TransformRotationDeltaAngle to .uno:TransformDialog Change-Id: Ib22ba6956afedf1eea055e0ac3a78c53b4ee5861 --- include/svx/svxids.hrc | 1 + svx/sdi/svx.sdi | 2 +- svx/source/svdraw/svdedtv1.cxx | 10 ++++++++-- 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 9662124b339a..da6e743e272e 100644 --- a/include/svx/svxids.hrc +++ b/include/svx/svxids.hrc @@ -240,6 +240,7 @@ class SfxStringItem; #define SID_ATTR_TRANSFORM_ROT_X TypedWhichId( SID_SVX_START + 93 ) #define SID_ATTR_TRANSFORM_ROT_Y TypedWhichId( SID_SVX_START + 94 ) #define SID_ATTR_TRANSFORM_ANGLE TypedWhichId( SID_SVX_START + 95 ) +#define SID_ATTR_TRANSFORM_DELTA_ANGLE TypedWhichId( 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 8ef5efab6432..694b9d01d172 100644 --- a/svx/sdi/svx.sdi +++ b/svx/sdi/svx.sdi @@ -8504,7 +8504,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 1acf37cd3771..9b30ccc4417d 100644 --- a/svx/source/svdraw/svdedtv1.cxx +++ b/svx/source/svdraw/svdedtv1.cxx @@ -1504,8 +1504,14 @@ void SdrEditView::SetGeoAttrToMarked(const SfxItemSet& rAttr) } // rotation - if (SfxItemState::SET==rAttr.GetItemState(SID_ATTR_TRANSFORM_ANGLE,true,&pPoolItem)) { - nRotateAngle=static_cast(pPoolItem)->GetValue()-nOldRotateAngle; + if (SfxItemState::SET == rAttr.GetItemState(SID_ATTR_TRANSFORM_DELTA_ANGLE, true, &pPoolItem)) { + nRotateAngle = static_cast(pPoolItem)->GetValue() + nOldRotateAngle; + bRotate = (nRotateAngle != 0); + } + + // rotation + if (SfxItemState::SET == rAttr.GetItemState(SID_ATTR_TRANSFORM_ANGLE, true, &pPoolItem)) { + nRotateAngle = static_cast(pPoolItem)->GetValue() - nOldRotateAngle; bRotate = (nRotateAngle != 0); } 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(pItem)->GetValue() / 10); SfxItemSet aSet(rSh.GetAttrPool(), svl::Items{} ); 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(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(pItem)->GetValue() / 10); + + // RotGrfFlyFrame: Rotation change here, SwFlyFrameAttrMgr aMgr is available + aMgr.SetRotation(nOldRot, nNewRot, rRotation.GetUnrotatedSize()); + } } if ( bApplyNewSize ) -- cgit