cui/source/tabpages/transfrm.cxx | 5 +++-- include/svx/svxids.hrc | 3 ++- sd/source/core/typemap.cxx | 1 + svx/sdi/svx.sdi | 4 ++-- svx/sdi/svxitems.sdi | 1 + svx/source/sidebar/possize/PosSizePropertyPanel.cxx | 5 +++-- svx/source/svdraw/svdedtv1.cxx | 4 ++-- sw/source/ui/frmdlg/frmpage.cxx | 5 +++-- sw/source/uibase/shells/frmsh.cxx | 3 ++- sw/source/uibase/shells/grfsh.cxx | 7 ++++--- sw/source/uibase/shells/slotadd.cxx | 1 + 11 files changed, 24 insertions(+), 15 deletions(-)
New commits: commit cc66c52faac53b682732cc184fcd64e04100dfab Author: Noel Grandin <noelgran...@gmail.com> AuthorDate: Sun Dec 27 20:26:00 2020 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Mon Dec 28 07:23:31 2020 +0100 use SdrAngleItem for SID_ATTR_TRANSFORM_ANGLE as a precursor to introdcing a strong_int type for hundredths of a degree Change-Id: Ie2d7ad3b48d01defb43bf2e11e6494c4b999de0e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108378 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/cui/source/tabpages/transfrm.cxx b/cui/source/tabpages/transfrm.cxx index cec57ecbbbe7..8845af0d27cd 100644 --- a/cui/source/tabpages/transfrm.cxx +++ b/cui/source/tabpages/transfrm.cxx @@ -30,6 +30,7 @@ #include <svx/sderitm.hxx> #include <svx/svxids.hrc> #include <svx/transfrmhelper.hxx> +#include <svx/sdangitm.hxx> #include <svtools/unitconv.hxx> #include <transfrm.hxx> @@ -250,7 +251,7 @@ bool SvxAngleTabPage::FillItemSet(SfxItemSet* rSet) const double fTmpX((GetCoreValue(*m_xMtrPosX, ePoolUnit) + maAnchor.getX()) * fUIScale); const double fTmpY((GetCoreValue(*m_xMtrPosY, ePoolUnit) + maAnchor.getY()) * fUIScale); - rSet->Put(SfxInt32Item(GetWhich(SID_ATTR_TRANSFORM_ANGLE), m_xCtlAngle->GetRotation())); + rSet->Put(SdrAngleItem(GetWhich(SID_ATTR_TRANSFORM_ANGLE), m_xCtlAngle->GetRotation())); rSet->Put(SfxInt32Item(GetWhich(SID_ATTR_TRANSFORM_ROT_X), basegfx::fround(fTmpX))); rSet->Put(SfxInt32Item(GetWhich(SID_ATTR_TRANSFORM_ROT_Y), basegfx::fround(fTmpY))); @@ -290,7 +291,7 @@ void SvxAngleTabPage::Reset(const SfxItemSet* rAttrs) pItem = GetItem( *rAttrs, SID_ATTR_TRANSFORM_ANGLE ); if(pItem) { - m_xCtlAngle->SetRotation(static_cast<const SfxInt32Item*>(pItem)->GetValue()); + m_xCtlAngle->SetRotation(static_cast<const SdrAngleItem*>(pItem)->GetValue()); } else { diff --git a/include/svx/svxids.hrc b/include/svx/svxids.hrc index c057e16d81d7..91c7191dd104 100644 --- a/include/svx/svxids.hrc +++ b/include/svx/svxids.hrc @@ -51,6 +51,7 @@ class SvxLineItem; class SvxBoxInfoItem; class SfxStringItem; class SvxSetItem; +class SdrAngleItem; // member IDs @@ -249,7 +250,7 @@ class SvxSetItem; #define SID_ATTR_TRANSFORM_SIZE_POINT TypedWhichId<SfxUInt16Item>( SID_SVX_START + 92 ) #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_ANGLE TypedWhichId<SdrAngleItem>( SID_SVX_START + 95 ) #define SID_ATTR_TRANSFORM_DELTA_ANGLE TypedWhichId<SfxInt32Item>( SID_SVX_START + 96 ) // CAUTION! Range <96..100> used by SFX2 (!) #define SID_SIZE_ALL ( SID_SVX_START + 101 ) diff --git a/sd/source/core/typemap.cxx b/sd/source/core/typemap.cxx index 9353a808cbb4..046be764ba19 100644 --- a/sd/source/core/typemap.cxx +++ b/sd/source/core/typemap.cxx @@ -93,6 +93,7 @@ #include <svx/xflftrit.hxx> #include <svx/xlinjoit.hxx> #include <svx/galleryitem.hxx> +#include <svx/sdangitm.hxx> #define SFX_TYPEMAP #include <sdslots.hxx> diff --git a/svx/sdi/svx.sdi b/svx/sdi/svx.sdi index 9d31cea9643b..32fda1bedab6 100644 --- a/svx/sdi/svx.sdi +++ b/svx/sdi/svx.sdi @@ -8753,7 +8753,7 @@ SvxULSpaceItem TopBottomMargin SID_ATTR_ULSPACE SfxVoidItem TransformDialog SID_ATTR_TRANSFORM -(SfxUInt32Item TransformPosX SID_ATTR_TRANSFORM_POS_X,SfxUInt32Item TransformPosY SID_ATTR_TRANSFORM_POS_Y,SfxUInt32Item TransformWidth SID_ATTR_TRANSFORM_WIDTH, SfxUInt32Item TransformHeight SID_ATTR_TRANSFORM_HEIGHT,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) +(SfxUInt32Item TransformPosX SID_ATTR_TRANSFORM_POS_X,SfxUInt32Item TransformPosY SID_ATTR_TRANSFORM_POS_Y,SfxUInt32Item TransformWidth SID_ATTR_TRANSFORM_WIDTH, SfxUInt32Item TransformHeight SID_ATTR_TRANSFORM_HEIGHT,SfxUInt32Item TransformRotationDeltaAngle SID_ATTR_TRANSFORM_DELTA_ANGLE,SdrAngleItem TransformRotationAngle SID_ATTR_TRANSFORM_ANGLE,SfxUInt32Item TransformRotationX SID_ATTR_TRANSFORM_ROT_X,SfxUInt32Item TransformRotationY SID_ATTR_TRANSFORM_ROT_Y) [ AutoUpdate = FALSE, FastCall = TRUE, @@ -11917,7 +11917,7 @@ SfxUInt32Item TransformHeight SID_ATTR_TRANSFORM_HEIGHT -SfxUInt32Item TransformRotationAngle SID_ATTR_TRANSFORM_ANGLE +SdrAngleItem TransformRotationAngle SID_ATTR_TRANSFORM_ANGLE [ AutoUpdate = TRUE, FastCall = FALSE, diff --git a/svx/sdi/svxitems.sdi b/svx/sdi/svxitems.sdi index b30c0adcbdef..36fe52e13867 100644 --- a/svx/sdi/svxitems.sdi +++ b/svx/sdi/svxitems.sdi @@ -193,6 +193,7 @@ item SvxCellHorJustifyEnum SvxHorJustifyItem; item SvxCellVerJustifyEnum SvxVerJustifyItem; item SvxCellOrientationEnum SvxOrientationItem; item BOOL SdrOnOffItem; +item INT32 SdrAngleItem; // derived from SfxInt32Item item INT16 SdrTextFitToSizeTypeItem; // enum item String SfxStringListItem; // serialized into one concatenated string item double SvxDoubleItem; diff --git a/svx/source/sidebar/possize/PosSizePropertyPanel.cxx b/svx/source/sidebar/possize/PosSizePropertyPanel.cxx index 4d74ebcd94b8..8f34d7051889 100644 --- a/svx/source/sidebar/possize/PosSizePropertyPanel.cxx +++ b/svx/source/sidebar/possize/PosSizePropertyPanel.cxx @@ -33,6 +33,7 @@ #include <sfx2/weldutils.hxx> #include <svx/dialcontrol.hxx> #include <svx/rectenum.hxx> +#include <svx/sdangitm.hxx> #include <unotools/viewoptions.hxx> #include <unotools/localedatawrapper.hxx> #include <vcl/canvastools.hxx> @@ -452,7 +453,7 @@ IMPL_LINK_NOARG( PosSizePropertyPanel, RotationHdl, DialControl&, void ) // #i123993# Need to take UIScale into account when executing rotations const double fUIScale(mpView && mpView->GetModel() ? double(mpView->GetModel()->GetUIScale()) : 1.0); - SfxInt32Item aAngleItem( SID_ATTR_TRANSFORM_ANGLE,static_cast<sal_uInt32>(nTmp)); + SdrAngleItem aAngleItem( SID_ATTR_TRANSFORM_ANGLE,static_cast<sal_uInt32>(nTmp)); SfxInt32Item aRotXItem( SID_ATTR_TRANSFORM_ROT_X, basegfx::fround(mlRotX * fUIScale)); SfxInt32Item aRotYItem( SID_ATTR_TRANSFORM_ROT_Y, basegfx::fround(mlRotY * fUIScale)); @@ -675,7 +676,7 @@ void PosSizePropertyPanel::NotifyItemUpdate( case SID_ATTR_TRANSFORM_ANGLE: if (eState >= SfxItemState::DEFAULT) { - const SfxInt32Item* pItem = dynamic_cast< const SfxInt32Item* >(pState); + const SdrAngleItem* pItem = dynamic_cast< const SdrAngleItem* >(pState); if(pItem) { diff --git a/svx/source/svdraw/svdedtv1.cxx b/svx/source/svdraw/svdedtv1.cxx index 0beba3a215aa..c9196b7a3fff 100644 --- a/svx/source/svdraw/svdedtv1.cxx +++ b/svx/source/svdraw/svdedtv1.cxx @@ -1385,7 +1385,7 @@ SfxItemSet SdrEditView::GetGeoAttrFromMarked() const nRotateRefX=aRotateAxe.X(); nRotateRefY=aRotateAxe.Y(); } - aRetSet.Put(SfxInt32Item(SID_ATTR_TRANSFORM_ANGLE,GetMarkedObjRotate())); + aRetSet.Put(SdrAngleItem(SID_ATTR_TRANSFORM_ANGLE,GetMarkedObjRotate())); aRetSet.Put(SfxInt32Item(SID_ATTR_TRANSFORM_ROT_X,nRotateRefX)); aRetSet.Put(SfxInt32Item(SID_ATTR_TRANSFORM_ROT_Y,nRotateRefY)); @@ -1606,7 +1606,7 @@ 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; + nRotateAngle = static_cast<const SdrAngleItem*>(pPoolItem)->GetValue() - nOldRotateAngle; bRotate = (nRotateAngle != 0); } diff --git a/sw/source/ui/frmdlg/frmpage.cxx b/sw/source/ui/frmdlg/frmpage.cxx index cdb94dc6254a..b8eedd8100ae 100644 --- a/sw/source/ui/frmdlg/frmpage.cxx +++ b/sw/source/ui/frmdlg/frmpage.cxx @@ -37,6 +37,7 @@ #include <editeng/frmdiritem.hxx> #include <svx/swframeposstrings.hxx> #include <svx/swframevalidation.hxx> +#include <svx/sdangitm.hxx> #include <comphelper/classids.hxx> #include <tools/globname.hxx> #include <tools/urlobj.hxx> @@ -2353,7 +2354,7 @@ void SwGrfExtPage::Reset(const SfxItemSet *rSet) // RotGrfFlyFrame: Get RotationAngle and set at control if(SfxItemState::SET == rSet->GetItemState( SID_ATTR_TRANSFORM_ANGLE, false, &pItem)) { - m_xCtlAngle->SetRotation(static_cast<const SfxInt32Item*>(pItem)->GetValue()); + m_xCtlAngle->SetRotation(static_cast<const SdrAngleItem*>(pItem)->GetValue()); } else { @@ -2494,7 +2495,7 @@ bool SwGrfExtPage::FillItemSet( SfxItemSet *rSet ) // RotGrfFlyFrame: Safe rotation if modified if(m_xCtlAngle->IsValueModified()) { - rSet->Put(SfxInt32Item(GetWhich(SID_ATTR_TRANSFORM_ANGLE), m_xCtlAngle->GetRotation())); + rSet->Put(SdrAngleItem(GetWhich(SID_ATTR_TRANSFORM_ANGLE), m_xCtlAngle->GetRotation())); bModified = true; } diff --git a/sw/source/uibase/shells/frmsh.cxx b/sw/source/uibase/shells/frmsh.cxx index e6a758b37e5c..1d352cafb16a 100644 --- a/sw/source/uibase/shells/frmsh.cxx +++ b/sw/source/uibase/shells/frmsh.cxx @@ -36,6 +36,7 @@ #include <vcl/EnumContext.hxx> #include <svx/hlnkitem.hxx> #include <svx/svdview.hxx> +#include <svx/sdangitm.hxx> #include <vcl/commandinfoprovider.hxx> #include <sal/log.hxx> @@ -409,7 +410,7 @@ void SwFrameShell::Execute(SfxRequest &rReq) // 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); + const sal_uInt32 nNewRot(static_cast<const SdrAngleItem*>(pItem)->GetValue() / 10); // RotGrfFlyFrame: Rotation change here, SwFlyFrameAttrMgr aMgr is available aMgr.SetRotation(nOldRot, nNewRot, rRotation.GetUnrotatedSize()); diff --git a/sw/source/uibase/shells/grfsh.cxx b/sw/source/uibase/shells/grfsh.cxx index f792b9429427..76139243ca92 100644 --- a/sw/source/uibase/shells/grfsh.cxx +++ b/sw/source/uibase/shells/grfsh.cxx @@ -37,6 +37,7 @@ #include <svx/grfflt.hxx> #include <svx/compressgraphicdialog.hxx> #include <svx/tbxcolor.hxx> +#include <svx/sdangitm.hxx> #include <drawdoc.hxx> #include <view.hxx> #include <wrtsh.hxx> @@ -393,7 +394,7 @@ void SwGrfShell::Execute(SfxRequest &rReq) const SwRotationGrf& rRotation = aTmpSet.Get(RES_GRFATR_ROTATION); nCurrentRotation = rRotation.GetValue(); aUnrotatedSize = rRotation.GetUnrotatedSize(); - aSet.Put(SfxInt32Item(SID_ATTR_TRANSFORM_ANGLE, nCurrentRotation * 10)); + aSet.Put(SdrAngleItem(SID_ATTR_TRANSFORM_ANGLE, nCurrentRotation * 10)); } SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); @@ -510,7 +511,7 @@ void SwGrfShell::Execute(SfxRequest &rReq) // RotGrfFlyFrame: Get and process evtl. changed RotationAngle if ( SfxItemState::SET == pSet->GetItemState(SID_ATTR_TRANSFORM_ANGLE, false, &pItem )) { - const sal_Int32 aNewRotation((static_cast<const SfxInt32Item*>(pItem)->GetValue() / 10) % 3600); + const sal_Int32 aNewRotation((static_cast<const SdrAngleItem*>(pItem)->GetValue() / 10) % 3600); // RotGrfFlyFrame: Possible rotation change here, SwFlyFrameAttrMgr aMgr is available aMgr.SetRotation(nCurrentRotation, aNewRotation, aUnrotatedSize); @@ -989,7 +990,7 @@ void SwGrfShell::GetAttrStateForRotation(SfxItemSet &rSet) SfxItemSet aSet( rShell.GetAttrPool(), svl::Items<RES_GRFATR_ROTATION, RES_GRFATR_ROTATION>{} ); rShell.GetCurAttr( aSet ); const SwRotationGrf& rRotation = aSet.Get(RES_GRFATR_ROTATION); - rSet.Put(SfxInt32Item(SID_ATTR_TRANSFORM_ANGLE, rRotation.GetValue() * 10)); + rSet.Put(SdrAngleItem(SID_ATTR_TRANSFORM_ANGLE, rRotation.GetValue() * 10)); break; } default: diff --git a/sw/source/uibase/shells/slotadd.cxx b/sw/source/uibase/shells/slotadd.cxx index 06a134b22424..3aa3469db14d 100644 --- a/sw/source/uibase/shells/slotadd.cxx +++ b/sw/source/uibase/shells/slotadd.cxx @@ -124,6 +124,7 @@ #include <svx/xlncapit.hxx> #include <svx/xlinjoit.hxx> #include <svx/galleryitem.hxx> +#include <svx/sdangitm.hxx> #define SFX_TYPEMAP #include <sfx2/msg.hxx> _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits