summaryrefslogtreecommitdiff
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
parentad5fb8798b295e9ad706a3836ffb53a0630f752f (diff)
add parameter TransformRotationDeltaAngle to .uno:TransformDialog
Change-Id: Ib22ba6956afedf1eea055e0ac3a78c53b4ee5861
-rw-r--r--include/svx/svxids.hrc1
-rw-r--r--svx/sdi/svx.sdi2
-rw-r--r--svx/source/svdraw/svdedtv1.cxx10
-rw-r--r--sw/source/uibase/shells/frmsh.cxx26
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<SfxInt32Item>( SID_SVX_START + 93 )
#define SID_ATTR_TRANSFORM_ROT_Y TypedWhichId<SfxInt32Item>( SID_SVX_START + 94 )
#define SID_ATTR_TRANSFORM_ANGLE TypedWhichId<SfxInt32Item>( SID_SVX_START + 95 )
+#define SID_ATTR_TRANSFORM_DELTA_ANGLE TypedWhichId<SfxInt32Item>( 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<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 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 )