Kaydet (Commit) a92733b3 authored tarafından Henry Castro's avatar Henry Castro Kaydeden (comit) Jan Holesovsky

add parameter TransformRotationDeltaAngle to .uno:TransformDialog

Change-Id: Ib22ba6956afedf1eea055e0ac3a78c53b4ee5861
üst ad5fb879
...@@ -240,6 +240,7 @@ class SfxStringItem; ...@@ -240,6 +240,7 @@ class SfxStringItem;
#define SID_ATTR_TRANSFORM_ROT_X TypedWhichId<SfxInt32Item>( SID_SVX_START + 93 ) #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_ROT_Y TypedWhichId<SfxInt32Item>( SID_SVX_START + 94 )
#define SID_ATTR_TRANSFORM_ANGLE TypedWhichId<SfxInt32Item>( SID_SVX_START + 95 ) #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_SIZE_ALL ( SID_SVX_START + 101 )
#define SID_DRAW_LINE ( SID_SVX_START + 102 ) #define SID_DRAW_LINE ( SID_SVX_START + 102 )
#define SID_DRAW_XLINE ( SID_SVX_START + 103 ) #define SID_DRAW_XLINE ( SID_SVX_START + 103 )
......
...@@ -8504,7 +8504,7 @@ SvxULSpaceItem TopBottomMargin SID_ATTR_ULSPACE ...@@ -8504,7 +8504,7 @@ SvxULSpaceItem TopBottomMargin SID_ATTR_ULSPACE
SfxVoidItem TransformDialog SID_ATTR_TRANSFORM 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, AutoUpdate = FALSE,
FastCall = TRUE, FastCall = TRUE,
......
...@@ -1504,8 +1504,14 @@ void SdrEditView::SetGeoAttrToMarked(const SfxItemSet& rAttr) ...@@ -1504,8 +1504,14 @@ void SdrEditView::SetGeoAttrToMarked(const SfxItemSet& rAttr)
} }
// rotation // rotation
if (SfxItemState::SET==rAttr.GetItemState(SID_ATTR_TRANSFORM_ANGLE,true,&pPoolItem)) { if (SfxItemState::SET == rAttr.GetItemState(SID_ATTR_TRANSFORM_DELTA_ANGLE, true, &pPoolItem)) {
nRotateAngle=static_cast<const SfxInt32Item*>(pPoolItem)->GetValue()-nOldRotateAngle; 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); bRotate = (nRotateAngle != 0);
} }
......
...@@ -362,20 +362,30 @@ void SwFrameShell::Execute(SfxRequest &rReq) ...@@ -362,20 +362,30 @@ void SwFrameShell::Execute(SfxRequest &rReq)
bApplyNewSize = true; bApplyNewSize = true;
} }
// RotGrfFlyFrame: Get Value and disable is in SwGrfShell::GetAttrStateForRotation, but the if (pArgs && (pArgs->HasItem(SID_ATTR_TRANSFORM_ANGLE) || pArgs->HasItem(SID_ATTR_TRANSFORM_DELTA_ANGLE)))
// 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>{} ); SfxItemSet aSet(rSh.GetAttrPool(), svl::Items<RES_GRFATR_ROTATION, RES_GRFATR_ROTATION>{} );
rSh.GetCurAttr(aSet); rSh.GetCurAttr(aSet);
const SwRotationGrf& rRotation = aSet.Get(RES_GRFATR_ROTATION); const SwRotationGrf& rRotation = aSet.Get(RES_GRFATR_ROTATION);
const sal_uInt32 nOldRot(rRotation.GetValue()); const sal_uInt32 nOldRot(rRotation.GetValue());
// RotGrfFlyFrame: Rotation change here, SwFlyFrameAttrMgr aMgr is available if (pArgs && SfxItemState::SET == pArgs->GetItemState(SID_ATTR_TRANSFORM_DELTA_ANGLE, false, &pItem))
aMgr.SetRotation(nOldRot, nNewRot, rRotation.GetUnrotatedSize()); {
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 ) if ( bApplyNewSize )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment