diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-01-28 15:17:04 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-01-29 18:59:53 +0100 |
commit | c3d5c9a08df77f9c0d0fd2493cf299dbad1a9dff (patch) | |
tree | f448517b6031741ab182685f3cf8ee332deac2f4 /svx | |
parent | 58c849a94234f18eac020be66117aa2378487e2f (diff) |
used TypedWhichId in the constructor of various svx *Item classes
to act as an extra check that we have the association of Item and
TypedWhichId annotations correct.
(*) requires that I add an upcasting constructor to TypedWhichId
(*) Make the field dialog stuff in writer use a new item id
FN_FIELD_DIALOG_DOC_PROPS instead of abusing the
existing SID_DOCINFO
Change-Id: Ica4aea930c80124609a063768c9af5a189df1c27
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129098
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'svx')
-rw-r--r-- | svx/source/dialog/hdft.cxx | 2 | ||||
-rw-r--r-- | svx/source/dialog/rulritem.cxx | 4 | ||||
-rw-r--r-- | svx/source/items/SmartTagItem.cxx | 2 | ||||
-rw-r--r-- | svx/source/items/algitem.cxx | 10 | ||||
-rw-r--r-- | svx/source/items/autoformathelper.cxx | 4 | ||||
-rw-r--r-- | svx/source/items/chrtitem.cxx | 12 | ||||
-rw-r--r-- | svx/source/items/clipfmtitem.cxx | 4 | ||||
-rw-r--r-- | svx/source/items/drawitem.cxx | 14 | ||||
-rw-r--r-- | svx/source/items/e3ditem.cxx | 2 | ||||
-rw-r--r-- | svx/source/items/grfitem.cxx | 4 | ||||
-rw-r--r-- | svx/source/items/hlnkitem.cxx | 4 | ||||
-rw-r--r-- | svx/source/items/numinf.cxx | 10 | ||||
-rw-r--r-- | svx/source/items/pageitem.cxx | 8 | ||||
-rw-r--r-- | svx/source/items/postattr.cxx | 25 | ||||
-rw-r--r-- | svx/source/items/rotmodit.cxx | 4 | ||||
-rw-r--r-- | svx/source/items/viewlayoutitem.cxx | 2 | ||||
-rw-r--r-- | svx/source/items/zoomslideritem.cxx | 2 | ||||
-rw-r--r-- | svx/source/mnuctrls/smarttagmenu.cxx | 2 | ||||
-rw-r--r-- | svx/source/svdraw/svdattr.cxx | 10 | ||||
-rw-r--r-- | svx/source/unodraw/UnoNameItemTable.cxx | 2 | ||||
-rw-r--r-- | svx/source/xoutdev/xattr.cxx | 14 |
21 files changed, 70 insertions, 71 deletions
diff --git a/svx/source/dialog/hdft.cxx b/svx/source/dialog/hdft.cxx index b20d60aacc35..5921d3b53c56 100644 --- a/svx/source/dialog/hdft.cxx +++ b/svx/source/dialog/hdft.cxx @@ -311,7 +311,7 @@ bool SvxHFPage::FillItemSet( SfxItemSet* rSet ) } // Flush the SetItem - SvxSetItem aSetItem( GetWhich( nId ), aSet ); + SvxSetItem aSetItem( TypedWhichId<SvxSetItem>(GetWhich( nId )), aSet ); rSet->Put( aSetItem ); return true; diff --git a/svx/source/dialog/rulritem.cxx b/svx/source/dialog/rulritem.cxx index 830475293402..2e1dac9848b8 100644 --- a/svx/source/dialog/rulritem.cxx +++ b/svx/source/dialog/rulritem.cxx @@ -134,7 +134,7 @@ SvxLongLRSpaceItem* SvxLongLRSpaceItem::Clone(SfxItemPool *) const return new SvxLongLRSpaceItem(*this); } -SvxLongLRSpaceItem::SvxLongLRSpaceItem(tools::Long lLeft, tools::Long lRight, sal_uInt16 nId) : +SvxLongLRSpaceItem::SvxLongLRSpaceItem(tools::Long lLeft, tools::Long lRight, TypedWhichId<SvxLongLRSpaceItem> nId) : SfxPoolItem (nId), mlLeft (lLeft), mlRight (lRight) @@ -253,7 +253,7 @@ SvxLongULSpaceItem* SvxLongULSpaceItem::Clone(SfxItemPool *) const return new SvxLongULSpaceItem(*this); } -SvxLongULSpaceItem::SvxLongULSpaceItem(tools::Long lLeft, tools::Long lRight, sal_uInt16 nId) : +SvxLongULSpaceItem::SvxLongULSpaceItem(tools::Long lLeft, tools::Long lRight, TypedWhichId<SvxLongULSpaceItem> nId) : SfxPoolItem (nId), mlLeft (lLeft), mlRight (lRight) diff --git a/svx/source/items/SmartTagItem.cxx b/svx/source/items/SmartTagItem.cxx index eac32b743b24..2208ee297d0e 100644 --- a/svx/source/items/SmartTagItem.cxx +++ b/svx/source/items/SmartTagItem.cxx @@ -29,7 +29,7 @@ using namespace ::com::sun::star; SfxPoolItem* SvxSmartTagItem::CreateDefault() { SAL_WARN( "svx", "No SvxSmartTagItem factory available"); return nullptr; } -SvxSmartTagItem::SvxSmartTagItem( const sal_uInt16 nId, +SvxSmartTagItem::SvxSmartTagItem( const TypedWhichId<SvxSmartTagItem> nId, const css::uno::Sequence < css::uno::Sequence< css::uno::Reference< css::smarttags::XSmartTagAction > > >& rActionComponentsSequence, const css::uno::Sequence < css::uno::Sequence< sal_Int32 > >& rActionIndicesSequence, const css::uno::Sequence< css::uno::Reference< css::container::XStringKeyMap > >& rStringKeyMaps, diff --git a/svx/source/items/algitem.cxx b/svx/source/items/algitem.cxx index 96783e822ef5..917edb1f6203 100644 --- a/svx/source/items/algitem.cxx +++ b/svx/source/items/algitem.cxx @@ -34,15 +34,15 @@ using namespace ::com::sun::star; -SfxPoolItem* SvxMarginItem::CreateDefault() { return new SvxMarginItem(0) ;} +SfxPoolItem* SvxMarginItem::CreateDefault() { return new SvxMarginItem(TypedWhichId<SvxMarginItem>(0)) ;} SvxOrientationItem::SvxOrientationItem( const SvxCellOrientation eOrientation, - const sal_uInt16 nId): + const TypedWhichId<SvxOrientationItem> nId): SfxEnumItem( nId, eOrientation ) { } -SvxOrientationItem::SvxOrientationItem( Degree100 nRotation, bool bStacked, const sal_uInt16 nId ) : +SvxOrientationItem::SvxOrientationItem( Degree100 nRotation, bool bStacked, const TypedWhichId<SvxOrientationItem> nId ) : SfxEnumItem( nId, SvxCellOrientation::Standard ) { if( bStacked ) @@ -141,7 +141,7 @@ Degree100 SvxOrientationItem::GetRotation( Degree100 nStdAngle ) const return nAngle; } -SvxMarginItem::SvxMarginItem( const sal_uInt16 nId ) : +SvxMarginItem::SvxMarginItem( const TypedWhichId<SvxMarginItem> nId ) : SfxPoolItem( nId ), @@ -157,7 +157,7 @@ SvxMarginItem::SvxMarginItem( sal_Int16 nLeft, sal_Int16 nTop, sal_Int16 nRight, sal_Int16 nBottom, - const sal_uInt16 nId ) : + const TypedWhichId<SvxMarginItem> nId ) : SfxPoolItem( nId ), nLeftMargin ( nLeft ), diff --git a/svx/source/items/autoformathelper.cxx b/svx/source/items/autoformathelper.cxx index 2d3ee9270914..0ae522fbd7ac 100644 --- a/svx/source/items/autoformathelper.cxx +++ b/svx/source/items/autoformathelper.cxx @@ -319,7 +319,7 @@ bool AutoFormatBase::LoadBlockB( SvStream& rStream, const AutoFormatVersions& rV { legacy::SvxHorJustify::Create(*m_aHorJustify, rStream, rVersions.nHorJustifyVersion); legacy::SvxVerJustify::Create(*m_aVerJustify, rStream, rVersions.nVerJustifyVersion); - SvxOrientationItem aOrientation( SvxCellOrientation::Standard, 0); + SvxOrientationItem aOrientation( SvxCellOrientation::Standard, TypedWhichId<SvxOrientationItem>(0)); legacy::SvxOrientation::Create(aOrientation, rStream, rVersions.nOrientationVersion); legacy::SvxMargin::Create(*m_aMargin, rStream, rVersions.nMarginVersion); legacy::SfxBool::Create(*m_aLinebreak, rStream, rVersions.nBoolVersion); @@ -377,7 +377,7 @@ bool AutoFormatBase::SaveBlockB( SvStream& rStream, sal_uInt16 fileVersion ) con { legacy::SvxHorJustify::Store(*m_aHorJustify, rStream, legacy::SvxHorJustify::GetVersion(fileVersion)); legacy::SvxVerJustify::Store(*m_aVerJustify, rStream, legacy::SvxVerJustify::GetVersion(fileVersion)); - SvxOrientationItem aOrientation( Degree100(m_aRotateAngle->GetValue()), m_aStacked->GetValue(), 0 ); + SvxOrientationItem aOrientation( Degree100(m_aRotateAngle->GetValue()), m_aStacked->GetValue(), TypedWhichId<SvxOrientationItem>(0) ); legacy::SvxOrientation::Store(aOrientation, rStream, legacy::SvxOrientation::GetVersion(fileVersion)); legacy::SvxMargin::Store(*m_aMargin, rStream, legacy::SvxMargin::GetVersion(fileVersion)); legacy::SfxBool::Store(*m_aLinebreak, rStream, legacy::SfxBool::GetVersion(fileVersion)); diff --git a/svx/source/items/chrtitem.cxx b/svx/source/items/chrtitem.cxx index 9ee289ea083b..6fb6e85236fc 100644 --- a/svx/source/items/chrtitem.cxx +++ b/svx/source/items/chrtitem.cxx @@ -27,10 +27,10 @@ using namespace ::com::sun::star; -SfxPoolItem* SvxDoubleItem::CreateDefault() { return new SvxDoubleItem(0.0, 0);} +SfxPoolItem* SvxDoubleItem::CreateDefault() { return new SvxDoubleItem(0.0, TypedWhichId<SvxDoubleItem>(0));} SvxChartTextOrderItem::SvxChartTextOrderItem(SvxChartTextOrder eOrder, - sal_uInt16 nId) : + TypedWhichId<SvxChartTextOrderItem> nId) : SfxEnumItem(nId, eOrder) { } @@ -98,7 +98,7 @@ bool SvxChartTextOrderItem::PutValue( const css::uno::Any& rVal, sal_uInt8 /*nMe return true; } -SvxDoubleItem::SvxDoubleItem(double fValue, sal_uInt16 nId) : +SvxDoubleItem::SvxDoubleItem(double fValue, TypedWhichId<SvxDoubleItem> nId) : SfxPoolItem(nId), fVal(fValue) { @@ -143,7 +143,7 @@ bool SvxDoubleItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberId*/ ) } SvxChartKindErrorItem::SvxChartKindErrorItem(SvxChartKindError eOrient, - sal_uInt16 nId) : + TypedWhichId<SvxChartKindErrorItem> nId) : SfxEnumItem(nId, eOrient) { } @@ -154,7 +154,7 @@ SvxChartKindErrorItem* SvxChartKindErrorItem::Clone(SfxItemPool* /*pPool*/) cons } SvxChartIndicateItem::SvxChartIndicateItem(SvxChartIndicate eOrient, - sal_uInt16 nId) : + TypedWhichId<SvxChartIndicateItem> nId) : SfxEnumItem(nId, eOrient) { } @@ -165,7 +165,7 @@ SvxChartIndicateItem* SvxChartIndicateItem::Clone(SfxItemPool* /*pPool*/) const } SvxChartRegressItem::SvxChartRegressItem(SvxChartRegress eOrient, - sal_uInt16 nId) : + TypedWhichId<SvxChartRegressItem> nId) : SfxEnumItem(nId, eOrient) { } diff --git a/svx/source/items/clipfmtitem.cxx b/svx/source/items/clipfmtitem.cxx index 8ed567cdebcd..caae609f6204 100644 --- a/svx/source/items/clipfmtitem.cxx +++ b/svx/source/items/clipfmtitem.cxx @@ -32,9 +32,9 @@ struct SvxClipboardFormatItem_Impl SvxClipboardFormatItem_Impl() {} }; -SfxPoolItem* SvxClipboardFormatItem::CreateDefault() { return new SvxClipboardFormatItem(0); }; +SfxPoolItem* SvxClipboardFormatItem::CreateDefault() { return new SvxClipboardFormatItem(TypedWhichId<SvxClipboardFormatItem>(0)); }; -SvxClipboardFormatItem::SvxClipboardFormatItem( sal_uInt16 nId ) +SvxClipboardFormatItem::SvxClipboardFormatItem( TypedWhichId<SvxClipboardFormatItem> nId ) : SfxPoolItem( nId ), pImpl( new SvxClipboardFormatItem_Impl ) { } diff --git a/svx/source/items/drawitem.cxx b/svx/source/items/drawitem.cxx index 69482d56ff2d..24a6acb395df 100644 --- a/svx/source/items/drawitem.cxx +++ b/svx/source/items/drawitem.cxx @@ -36,7 +36,7 @@ SvxColorListItem::SvxColorListItem() } -SvxColorListItem::SvxColorListItem( XColorListRef const & pTable, sal_uInt16 nW ) : +SvxColorListItem::SvxColorListItem( XColorListRef const & pTable, TypedWhichId<SvxColorListItem> nW ) : SfxPoolItem( nW ), pColorList( pTable ) { @@ -96,7 +96,7 @@ SvxGradientListItem::SvxGradientListItem() { } -SvxGradientListItem::SvxGradientListItem( XGradientListRef const & pList, sal_uInt16 nW ) : +SvxGradientListItem::SvxGradientListItem( XGradientListRef const & pList, TypedWhichId<SvxGradientListItem> nW ) : SfxPoolItem( nW ), pGradientList( pList ) { @@ -141,7 +141,7 @@ SvxHatchListItem::SvxHatchListItem() } -SvxHatchListItem::SvxHatchListItem( XHatchListRef const & pList, sal_uInt16 nW ) : +SvxHatchListItem::SvxHatchListItem( XHatchListRef const & pList, TypedWhichId<SvxHatchListItem> nW ) : SfxPoolItem( nW ), pHatchList( pList ) { @@ -185,7 +185,7 @@ SvxBitmapListItem::SvxBitmapListItem() { } -SvxBitmapListItem::SvxBitmapListItem( XBitmapListRef const & pList, sal_uInt16 nW ) : +SvxBitmapListItem::SvxBitmapListItem( XBitmapListRef const & pList, TypedWhichId<SvxBitmapListItem> nW ) : SfxPoolItem( nW ), pBitmapList( pList ) { @@ -226,7 +226,7 @@ SvxPatternListItem::SvxPatternListItem() { } -SvxPatternListItem::SvxPatternListItem( XPatternListRef const & pList, sal_uInt16 nW ) : +SvxPatternListItem::SvxPatternListItem( XPatternListRef const & pList, TypedWhichId<SvxPatternListItem> nW ) : SfxPoolItem( nW ), pPatternList( pList ) { @@ -267,7 +267,7 @@ SvxDashListItem::SvxDashListItem() { } -SvxDashListItem::SvxDashListItem( XDashListRef const & pList, sal_uInt16 nW ) : +SvxDashListItem::SvxDashListItem( XDashListRef const & pList, TypedWhichId<SvxDashListItem> nW ) : SfxPoolItem( nW ), pDashList( pList ) { @@ -308,7 +308,7 @@ SvxLineEndListItem::SvxLineEndListItem() { } -SvxLineEndListItem::SvxLineEndListItem( XLineEndListRef const & pList, sal_uInt16 nW ) : +SvxLineEndListItem::SvxLineEndListItem( XLineEndListRef const & pList, TypedWhichId<SvxLineEndListItem> nW ) : SfxPoolItem( nW ), pLineEndList( pList ) { diff --git a/svx/source/items/e3ditem.cxx b/svx/source/items/e3ditem.cxx index cd61f9ac013a..135c7efaf370 100644 --- a/svx/source/items/e3ditem.cxx +++ b/svx/source/items/e3ditem.cxx @@ -30,7 +30,7 @@ SvxB3DVectorItem::~SvxB3DVectorItem() } -SvxB3DVectorItem::SvxB3DVectorItem( sal_uInt16 _nWhich, const basegfx::B3DVector& rVal ) : +SvxB3DVectorItem::SvxB3DVectorItem( TypedWhichId<SvxB3DVectorItem> _nWhich, const basegfx::B3DVector& rVal ) : SfxPoolItem( _nWhich ), aVal( rVal ) { diff --git a/svx/source/items/grfitem.cxx b/svx/source/items/grfitem.cxx index b241738f313f..30c0977a034d 100644 --- a/svx/source/items/grfitem.cxx +++ b/svx/source/items/grfitem.cxx @@ -25,13 +25,13 @@ using namespace ::com::sun::star; -SvxGrfCrop::SvxGrfCrop( sal_uInt16 nItemId ) +SvxGrfCrop::SvxGrfCrop( TypedWhichId<SvxGrfCrop> nItemId ) : SfxPoolItem( nItemId ), nLeft( 0 ), nRight( 0 ), nTop( 0 ), nBottom( 0 ) {} SvxGrfCrop::SvxGrfCrop( sal_Int32 nL, sal_Int32 nR, - sal_Int32 nT, sal_Int32 nB, sal_uInt16 nItemId ) + sal_Int32 nT, sal_Int32 nB, TypedWhichId<SvxGrfCrop> nItemId ) : SfxPoolItem( nItemId ), nLeft( nL ), nRight( nR ), nTop( nT ), nBottom( nB ) {} diff --git a/svx/source/items/hlnkitem.cxx b/svx/source/items/hlnkitem.cxx index 7a092b36fc5a..4a8bc3290762 100644 --- a/svx/source/items/hlnkitem.cxx +++ b/svx/source/items/hlnkitem.cxx @@ -22,7 +22,7 @@ #include <svx/hlnkitem.hxx> -SfxPoolItem* SvxHyperlinkItem::CreateDefault() { return new SvxHyperlinkItem(0);} +SfxPoolItem* SvxHyperlinkItem::CreateDefault() { return new SvxHyperlinkItem(TypedWhichId<SvxHyperlinkItem>(0));} SvxHyperlinkItem::SvxHyperlinkItem( const SvxHyperlinkItem& rHyperlinkItem ): SfxPoolItem(rHyperlinkItem) @@ -39,7 +39,7 @@ SvxHyperlinkItem::SvxHyperlinkItem( const SvxHyperlinkItem& rHyperlinkItem ): }; -SvxHyperlinkItem::SvxHyperlinkItem( sal_uInt16 _nWhich, const OUString& rName, const OUString& rURL, +SvxHyperlinkItem::SvxHyperlinkItem( TypedWhichId<SvxHyperlinkItem> _nWhich, const OUString& rName, const OUString& rURL, const OUString& rTarget, const OUString& rIntName, SvxLinkInsertMode eTyp, HyperDialogEvent nEvents, SvxMacroTableDtor const *pMacroTbl ): SfxPoolItem (_nWhich), diff --git a/svx/source/items/numinf.cxx b/svx/source/items/numinf.cxx index a59d00b42074..d4bb1e915e79 100644 --- a/svx/source/items/numinf.cxx +++ b/svx/source/items/numinf.cxx @@ -20,7 +20,7 @@ #include <svx/numinf.hxx> -SvxNumberInfoItem::SvxNumberInfoItem( const sal_uInt16 nId ) : +SvxNumberInfoItem::SvxNumberInfoItem( const TypedWhichId<SvxNumberInfoItem> nId ) : SfxPoolItem ( nId ), pFormatter ( nullptr ), eValueType ( SvxNumberValueType::Undefined ), @@ -31,7 +31,7 @@ SvxNumberInfoItem::SvxNumberInfoItem( const sal_uInt16 nId ) : SvxNumberInfoItem::SvxNumberInfoItem( SvNumberFormatter* pNumFormatter, - const sal_uInt16 nId ) : + const TypedWhichId<SvxNumberInfoItem> nId ) : SfxPoolItem ( nId ), pFormatter ( pNumFormatter ), eValueType ( SvxNumberValueType::Undefined ), @@ -42,7 +42,7 @@ SvxNumberInfoItem::SvxNumberInfoItem( SvNumberFormatter* pNumFormatter, SvxNumberInfoItem::SvxNumberInfoItem( SvNumberFormatter* pNumFormatter, - const OUString& rVal, const sal_uInt16 nId ) : + const OUString& rVal, const TypedWhichId<SvxNumberInfoItem> nId ) : SfxPoolItem ( nId ), pFormatter ( pNumFormatter ), eValueType ( SvxNumberValueType::String ), @@ -53,7 +53,7 @@ SvxNumberInfoItem::SvxNumberInfoItem( SvNumberFormatter* pNumFormatter, SvxNumberInfoItem::SvxNumberInfoItem( SvNumberFormatter* pNumFormatter, - const double& rVal, const sal_uInt16 nId ) : + const double& rVal, const TypedWhichId<SvxNumberInfoItem> nId ) : SfxPoolItem ( nId ), pFormatter ( pNumFormatter ), eValueType ( SvxNumberValueType::Number ), @@ -65,7 +65,7 @@ SvxNumberInfoItem::SvxNumberInfoItem( SvNumberFormatter* pNumFormatter, SvxNumberInfoItem::SvxNumberInfoItem( SvNumberFormatter* pNumFormatter, const double& rVal, const OUString& rValueStr, - const sal_uInt16 nId ) : + const TypedWhichId<SvxNumberInfoItem> nId ) : SfxPoolItem ( nId ), pFormatter ( pNumFormatter ), eValueType ( SvxNumberValueType::Number ), diff --git a/svx/source/items/pageitem.cxx b/svx/source/items/pageitem.cxx index ad600c68fc0e..93239ea3d5b1 100644 --- a/svx/source/items/pageitem.cxx +++ b/svx/source/items/pageitem.cxx @@ -38,9 +38,9 @@ using namespace ::com::sun::star; -SfxPoolItem* SvxPageItem::CreateDefault() { return new SvxPageItem(0);} +SfxPoolItem* SvxPageItem::CreateDefault() { return new SvxPageItem(TypedWhichId<SvxPageItem>(0));} -SvxPageItem::SvxPageItem( const sal_uInt16 nId ) : SfxPoolItem( nId ), +SvxPageItem::SvxPageItem( const TypedWhichId<SvxPageItem> nId ) : SfxPoolItem( nId ), eNumType ( SVX_NUM_ARABIC ), bLandscape ( false ), @@ -250,7 +250,7 @@ bool SvxPageItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId ) } // HeaderFooterSet -SvxSetItem::SvxSetItem( const sal_uInt16 nId, const SfxItemSet& rSet ) : +SvxSetItem::SvxSetItem( const TypedWhichId<SvxSetItem> nId, const SfxItemSet& rSet ) : SfxSetItem( nId, rSet ) { @@ -262,7 +262,7 @@ SvxSetItem::SvxSetItem( const SvxSetItem& rItem ) : { } -SvxSetItem::SvxSetItem( const sal_uInt16 nId, SfxItemSet&& _pSet ) : +SvxSetItem::SvxSetItem( const TypedWhichId<SvxSetItem> nId, SfxItemSet&& _pSet ) : SfxSetItem( nId, std::move(_pSet) ) { diff --git a/svx/source/items/postattr.cxx b/svx/source/items/postattr.cxx index aabeae28d775..267c2cd9ad18 100644 --- a/svx/source/items/postattr.cxx +++ b/svx/source/items/postattr.cxx @@ -21,19 +21,19 @@ #include <svx/strings.hrc> #include <svx/dialmgr.hxx> -SfxPoolItem* SvxPostItAuthorItem::CreateDefault() { return new SvxPostItAuthorItem(0); } -SfxPoolItem* SvxPostItDateItem::CreateDefault() { return new SvxPostItDateItem(0); } -SfxPoolItem* SvxPostItTextItem::CreateDefault() { return new SvxPostItTextItem(0); } -SfxPoolItem* SvxPostItIdItem::CreateDefault() { return new SvxPostItIdItem(0); } +SfxPoolItem* SvxPostItAuthorItem::CreateDefault() { return new SvxPostItAuthorItem(TypedWhichId<SvxPostItAuthorItem>(0)); } +SfxPoolItem* SvxPostItDateItem::CreateDefault() { return new SvxPostItDateItem(TypedWhichId<SvxPostItDateItem>(0)); } +SfxPoolItem* SvxPostItTextItem::CreateDefault() { return new SvxPostItTextItem(TypedWhichId<SvxPostItTextItem>(0)); } +SfxPoolItem* SvxPostItIdItem::CreateDefault() { return new SvxPostItIdItem(TypedWhichId<SvxPostItIdItem>(0)); } -SvxPostItAuthorItem::SvxPostItAuthorItem( sal_uInt16 _nWhich ) +SvxPostItAuthorItem::SvxPostItAuthorItem( TypedWhichId<SvxPostItAuthorItem> _nWhich ) { SetWhich( _nWhich ); } SvxPostItAuthorItem::SvxPostItAuthorItem( const OUString& rAuthor, - sal_uInt16 _nWhich ) : + TypedWhichId<SvxPostItAuthorItem> _nWhich ) : SfxStringItem( _nWhich, rAuthor ) { } @@ -65,14 +65,13 @@ SvxPostItAuthorItem* SvxPostItAuthorItem::Clone( SfxItemPool * ) const return new SvxPostItAuthorItem( *this ); } -SvxPostItDateItem::SvxPostItDateItem( sal_uInt16 _nWhich ) +SvxPostItDateItem::SvxPostItDateItem( TypedWhichId<SvxPostItDateItem> _nWhich ) + : SfxStringItem(_nWhich) { - SetWhich( _nWhich ); } -SvxPostItDateItem::SvxPostItDateItem( const OUString& rDate, sal_uInt16 _nWhich ) : - +SvxPostItDateItem::SvxPostItDateItem( const OUString& rDate, TypedWhichId<SvxPostItDateItem> _nWhich ) : SfxStringItem( _nWhich, rDate ) { } @@ -105,12 +104,12 @@ SvxPostItDateItem* SvxPostItDateItem::Clone( SfxItemPool * ) const return new SvxPostItDateItem( *this ); } -SvxPostItTextItem::SvxPostItTextItem( sal_uInt16 _nWhich ) +SvxPostItTextItem::SvxPostItTextItem( TypedWhichId<SvxPostItTextItem> _nWhich ) { SetWhich( _nWhich ); } -SvxPostItTextItem::SvxPostItTextItem( const OUString& rText, sal_uInt16 _nWhich ) : +SvxPostItTextItem::SvxPostItTextItem( const OUString& rText, TypedWhichId<SvxPostItTextItem> _nWhich ) : SfxStringItem( _nWhich, rText ) { @@ -142,7 +141,7 @@ SvxPostItTextItem* SvxPostItTextItem::Clone( SfxItemPool * ) const return new SvxPostItTextItem( *this ); } -SvxPostItIdItem::SvxPostItIdItem( sal_uInt16 _nWhich ) +SvxPostItIdItem::SvxPostItIdItem( TypedWhichId<SvxPostItIdItem> _nWhich ) { SetWhich( _nWhich ); } diff --git a/svx/source/items/rotmodit.cxx b/svx/source/items/rotmodit.cxx index abd29b2ca1a3..eb559fdaeb62 100644 --- a/svx/source/items/rotmodit.cxx +++ b/svx/source/items/rotmodit.cxx @@ -26,13 +26,13 @@ using namespace ::com::sun::star; -SfxPoolItem* SvxRotateModeItem::CreateDefault() { return new SvxRotateModeItem(SVX_ROTATE_MODE_STANDARD, 0);} +SfxPoolItem* SvxRotateModeItem::CreateDefault() { return new SvxRotateModeItem(SVX_ROTATE_MODE_STANDARD, TypedWhichId<SvxRotateModeItem>(0));} // SvxRotateModeItem - orientation with turned text -SvxRotateModeItem::SvxRotateModeItem( SvxRotateMode eMode, sal_uInt16 _nWhich ) +SvxRotateModeItem::SvxRotateModeItem( SvxRotateMode eMode, TypedWhichId<SvxRotateModeItem> _nWhich ) : SfxEnumItem( _nWhich, eMode ) { } diff --git a/svx/source/items/viewlayoutitem.cxx b/svx/source/items/viewlayoutitem.cxx index 4ab6472c0774..d923133a19bc 100644 --- a/svx/source/items/viewlayoutitem.cxx +++ b/svx/source/items/viewlayoutitem.cxx @@ -38,7 +38,7 @@ SvxViewLayoutItem::SvxViewLayoutItem ( sal_uInt16 nColumns, bool bBookMode, - sal_uInt16 _nWhich + TypedWhichId<SvxViewLayoutItem> _nWhich ) : SfxUInt16Item( _nWhich, nColumns ), mbBookMode( bBookMode ) diff --git a/svx/source/items/zoomslideritem.cxx b/svx/source/items/zoomslideritem.cxx index 94bc8cce7bad..046a0359153c 100644 --- a/svx/source/items/zoomslideritem.cxx +++ b/svx/source/items/zoomslideritem.cxx @@ -35,7 +35,7 @@ constexpr OUStringLiteral ZOOMSLIDER_PARAM_MAXZOOM = u"MaxValue"; #define ZOOMSLIDER_PARAMS 4 -SvxZoomSliderItem::SvxZoomSliderItem( sal_uInt16 nCurrentZoom, sal_uInt16 nMinZoom, sal_uInt16 nMaxZoom, sal_uInt16 _nWhich ) +SvxZoomSliderItem::SvxZoomSliderItem( sal_uInt16 nCurrentZoom, sal_uInt16 nMinZoom, sal_uInt16 nMaxZoom, TypedWhichId<SvxZoomSliderItem> _nWhich ) : SfxUInt16Item( _nWhich, nCurrentZoom ), mnMinZoom( nMinZoom ), mnMaxZoom( nMaxZoom ) { } diff --git a/svx/source/mnuctrls/smarttagmenu.cxx b/svx/source/mnuctrls/smarttagmenu.cxx index 2bed24f1ff12..86f11e8d0cc4 100644 --- a/svx/source/mnuctrls/smarttagmenu.cxx +++ b/svx/source/mnuctrls/smarttagmenu.cxx @@ -101,7 +101,7 @@ void SmartTagMenuController::statusChanged( const css::frame::FeatureStateEvent& else if ( aProperty.Name == "RangeText" ) aProperty.Value >>= aRangeText; } - m_pSmartTagItem.reset( new SvxSmartTagItem( 0, aActionComponents, aActionIndices, aStringKeyMaps, xTextRange, xController, aLocale, aApplicationName, aRangeText ) ); + m_pSmartTagItem.reset( new SvxSmartTagItem( TypedWhichId<SvxSmartTagItem>(0), aActionComponents, aActionIndices, aStringKeyMaps, xTextRange, xController, aLocale, aApplicationName, aRangeText ) ); FillMenu(); } diff --git a/svx/source/svdraw/svdattr.cxx b/svx/source/svdraw/svdattr.cxx index b0df93a13855..da041583f4c9 100644 --- a/svx/source/svdraw/svdattr.cxx +++ b/svx/source/svdraw/svdattr.cxx @@ -716,7 +716,7 @@ SdrScaleItem* SdrScaleItem::Clone(SfxItemPool * /*pPool*/) const SdrOnOffItem* SdrOnOffItem::Clone(SfxItemPool* /*pPool*/) const { - return new SdrOnOffItem(Which(),GetValue()); + return new SdrOnOffItem(TypedWhichId<SdrOnOffItem>(Which()),GetValue()); } OUString SdrOnOffItem::GetValueTextByVal(bool bVal) const @@ -751,7 +751,7 @@ void SdrOnOffItem::dumpAsXml(xmlTextWriterPtr pWriter) const SdrYesNoItem* SdrYesNoItem::Clone(SfxItemPool* /*pPool*/) const { - return new SdrYesNoItem(Which(),GetValue()); + return new SdrYesNoItem(TypedWhichId<SdrYesNoItem>(Which()),GetValue()); } OUString SdrYesNoItem::GetValueTextByVal(bool bVal) const @@ -773,7 +773,7 @@ bool SdrYesNoItem::GetPresentation(SfxItemPresentation ePres, SdrPercentItem* SdrPercentItem::Clone(SfxItemPool* /*pPool*/) const { - return new SdrPercentItem(Which(),GetValue()); + return new SdrPercentItem(TypedWhichId<SdrPercentItem>(Which()),GetValue()); } bool SdrPercentItem::GetPresentation( @@ -807,7 +807,7 @@ void SdrPercentItem::dumpAsXml(xmlTextWriterPtr pWriter) const SdrAngleItem* SdrAngleItem::Clone(SfxItemPool* /*pPool*/) const { - return new SdrAngleItem(Which(),GetValue()); + return new SdrAngleItem(TypedWhichId<SdrAngleItem>(Which()),GetValue()); } bool SdrAngleItem::GetPresentation( @@ -872,7 +872,7 @@ bool SdrAngleItem::GetPresentation( SdrMetricItem* SdrMetricItem::Clone(SfxItemPool* /*pPool*/) const { - return new SdrMetricItem(Which(),GetValue()); + return new SdrMetricItem(TypedWhichId<SdrMetricItem>(Which()),GetValue()); } bool SdrMetricItem::HasMetrics() const diff --git a/svx/source/unodraw/UnoNameItemTable.cxx b/svx/source/unodraw/UnoNameItemTable.cxx index 17e952ea5d4c..71569ae7ab51 100644 --- a/svx/source/unodraw/UnoNameItemTable.cxx +++ b/svx/source/unodraw/UnoNameItemTable.cxx @@ -44,7 +44,7 @@ namespace class SampleItem : public NameOrIndex { public: - SampleItem(sal_uInt16 nWhich, const OUString& rName) : NameOrIndex(nWhich, rName) {} + SampleItem(sal_uInt16 nWhich, const OUString& rName) : NameOrIndex(TypedWhichId<NameOrIndex>(nWhich), rName) {} bool operator==(const SfxPoolItem& rCmp) const { diff --git a/svx/source/xoutdev/xattr.cxx b/svx/source/xoutdev/xattr.cxx index 2fcb40379b65..0539e19664e7 100644 --- a/svx/source/xoutdev/xattr.cxx +++ b/svx/source/xoutdev/xattr.cxx @@ -93,13 +93,13 @@ using namespace ::com::sun::star; typedef std::map<OUString, OUString> StringMap; -NameOrIndex::NameOrIndex(sal_uInt16 _nWhich, sal_Int32 nIndex) : +NameOrIndex::NameOrIndex(TypedWhichId<NameOrIndex> _nWhich, sal_Int32 nIndex) : SfxStringItem(_nWhich, OUString()), nPalIndex(nIndex) { } -NameOrIndex::NameOrIndex(sal_uInt16 _nWhich, const OUString& rName) : +NameOrIndex::NameOrIndex(TypedWhichId<NameOrIndex> _nWhich, const OUString& rName) : SfxStringItem(_nWhich, rName), nPalIndex(-1) { @@ -259,19 +259,19 @@ void NameOrIndex::dumpAsXml(xmlTextWriterPtr pWriter) const SfxPoolItem* XColorItem::CreateDefault() { return new XColorItem; } -XColorItem::XColorItem(sal_uInt16 _nWhich, sal_Int32 nIndex, const Color& rTheColor) : +XColorItem::XColorItem(TypedWhichId<XColorItem> _nWhich, sal_Int32 nIndex, const Color& rTheColor) : NameOrIndex(_nWhich, nIndex), aColor(rTheColor) { } -XColorItem::XColorItem(sal_uInt16 _nWhich, const OUString& rName, const Color& rTheColor) : +XColorItem::XColorItem(TypedWhichId<XColorItem> _nWhich, const OUString& rName, const Color& rTheColor) : NameOrIndex(_nWhich, rName), aColor(rTheColor) { } -XColorItem::XColorItem(sal_uInt16 _nWhich, const Color& rTheColor) +XColorItem::XColorItem(TypedWhichId<XColorItem> _nWhich, const Color& rTheColor) : NameOrIndex(_nWhich, OUString()) , aColor(rTheColor) { @@ -2128,7 +2128,7 @@ XFillGradientItem::XFillGradientItem(sal_Int32 nIndex, } XFillGradientItem::XFillGradientItem(const OUString& rName, - const XGradient& rTheGradient, sal_uInt16 nWhich) + const XGradient& rTheGradient, TypedWhichId<XFillGradientItem> nWhich) : NameOrIndex(nWhich, rName) , aGradient(rTheGradient) { @@ -2409,7 +2409,7 @@ std::unique_ptr<XFillGradientItem> XFillGradientItem::checkForUniqueItem( SdrMod // if the given name is not valid, replace it! if( aUniqueName != GetName() ) - return std::make_unique<XFillGradientItem>( aUniqueName, aGradient, Which() ); + return std::make_unique<XFillGradientItem>( aUniqueName, aGradient, TypedWhichId<XFillGradientItem>(Which()) ); } return nullptr; |