diff options
Diffstat (limited to 'include')
37 files changed, 433 insertions, 64 deletions
diff --git a/include/editeng/borderline.hxx b/include/editeng/borderline.hxx index 851c16156dee..86c6be8161be 100644 --- a/include/editeng/borderline.hxx +++ b/include/editeng/borderline.hxx @@ -28,6 +28,7 @@ #include <editeng/editengdllapi.h> #include <svtools/borderline.hxx> #include <docmodel/color/ComplexColor.hxx> +#include <o3tl/hash_combine.hxx> class IntlWrapper; @@ -253,6 +254,21 @@ public: static Color threeDDarkColor( Color aMain ); static BorderWidthImpl getWidthImpl( SvxBorderLineStyle nStyle ); + + std::size_t getHash() const + { + std::size_t seed = 0; + o3tl::hash_combine(seed, m_nWidth); + o3tl::hash_combine(seed, m_nMult); + o3tl::hash_combine(seed, m_nDiv); + o3tl::hash_combine(seed, m_aWidthImpl.getHash()); + o3tl::hash_combine(seed, m_aColor.operator::sal_uInt32()); + o3tl::hash_combine(seed, m_aComplexColor.getHash()); + o3tl::hash_combine(seed, m_nStyle); + o3tl::hash_combine(seed, m_bMirrorWidths); + o3tl::hash_combine(seed, m_bUseLeftTop); + return seed; + } }; EDITENG_DLLPUBLIC bool operator!=( const SvxBorderLine& rLeft, const SvxBorderLine& rRight ); diff --git a/include/editeng/boxitem.hxx b/include/editeng/boxitem.hxx index 6ceff99268c3..0d9ee80281ef 100644 --- a/include/editeng/boxitem.hxx +++ b/include/editeng/boxitem.hxx @@ -138,6 +138,7 @@ public: sal_uInt16 GetSmallestDistance() const; bool IsRemoveAdjacentCellBorder() const { return mbRemoveAdjCellBorder; } + const std::array<model::ComplexColor, 4>& GetTempComplexColors() const {return maTempComplexColors;} void SetDistance( sal_Int16 nNew, SvxBoxItemLine nLine ); void SetAllDistances(sal_Int16 nNew) diff --git a/include/editeng/formatbreakitem.hxx b/include/editeng/formatbreakitem.hxx index 71f33176990f..7e9b0b27661e 100644 --- a/include/editeng/formatbreakitem.hxx +++ b/include/editeng/formatbreakitem.hxx @@ -62,7 +62,7 @@ public: inline SvxFormatBreakItem::SvxFormatBreakItem( const SvxBreak eBreak, const sal_uInt16 _nWhich ) : - SfxEnumItem( _nWhich, eBreak ) + SfxEnumItem( _nWhich, SfxItemType::SvxFormatBreakItemType, eBreak ) {} diff --git a/include/editeng/langitem.hxx b/include/editeng/langitem.hxx index 4d3852141666..c84aebf3b33c 100644 --- a/include/editeng/langitem.hxx +++ b/include/editeng/langitem.hxx @@ -33,8 +33,8 @@ // MSVC hack: class SAL_DLLPUBLIC_RTTI SvxLanguageItem_Base: public SfxEnumItem<LanguageType> { protected: - explicit SvxLanguageItem_Base(sal_uInt16 nWhich, LanguageType nValue): - SfxEnumItem(nWhich, nValue) + explicit SvxLanguageItem_Base(sal_uInt16 nWhich, SfxItemType eItemType, LanguageType nValue): + SfxEnumItem(nWhich, eItemType, nValue) {} }; diff --git a/include/editeng/protitem.hxx b/include/editeng/protitem.hxx index 4f3f1c4acd22..0c3b473700d1 100644 --- a/include/editeng/protitem.hxx +++ b/include/editeng/protitem.hxx @@ -66,7 +66,7 @@ public: }; inline SvxProtectItem::SvxProtectItem( const sal_uInt16 nId ) - : SfxPoolItem( nId ) + : SfxPoolItem( nId, SfxItemType::SvxProtectItemType ) { bCntnt = bSize = bPos = false; } diff --git a/include/sfx2/app.hxx b/include/sfx2/app.hxx index 96bce367fd75..a1f8be235f95 100644 --- a/include/sfx2/app.hxx +++ b/include/sfx2/app.hxx @@ -79,7 +79,8 @@ class SFX2_DLLPUBLIC SfxLinkItem final : public SfxPoolItem { Link<SfxPoolItem const *, void> aLink; public: - SfxLinkItem( sal_uInt16 nWhichId, const Link<SfxPoolItem const *, void>& rValue ) : SfxPoolItem( nWhichId ) + SfxLinkItem( sal_uInt16 nWhichId, const Link<SfxPoolItem const *, void>& rValue ) + : SfxPoolItem( nWhichId, SfxItemType::SfxLinkItemType ) { aLink = rValue; } virtual SfxLinkItem* Clone( SfxItemPool* = nullptr ) const override diff --git a/include/sfx2/evntconf.hxx b/include/sfx2/evntconf.hxx index 6716678813d1..81d0ee391445 100644 --- a/include/sfx2/evntconf.hxx +++ b/include/sfx2/evntconf.hxx @@ -70,7 +70,8 @@ class SFX2_DLLPUBLIC SfxEventNamesItem final : public SfxPoolItem public: - SfxEventNamesItem ( const sal_uInt16 nId ) : SfxPoolItem( nId ) {} + SfxEventNamesItem ( const sal_uInt16 nId ) + : SfxPoolItem( nId, SfxItemType::SfxEventNamesItemType ) {} virtual bool operator==( const SfxPoolItem& ) const override; virtual bool GetPresentation( SfxItemPresentation ePres, diff --git a/include/sfx2/objsh.hxx b/include/sfx2/objsh.hxx index 20e497b6e4af..77270d82f597 100644 --- a/include/sfx2/objsh.hxx +++ b/include/sfx2/objsh.hxx @@ -919,12 +919,12 @@ public: static SfxPoolItem* CreateDefault(); SfxObjectShellItem() : - SfxPoolItem( 0 ), + SfxPoolItem( 0, SfxItemType::SfxObjectShellItemType ), pObjSh( nullptr ) {} SfxObjectShellItem( sal_uInt16 nWhichId, SfxObjectShell *pObjShell ): - SfxPoolItem( nWhichId ), + SfxPoolItem( nWhichId, SfxItemType::SfxObjectShellItemType ), pObjSh( pObjShell ) {} diff --git a/include/sfx2/viewfrm.hxx b/include/sfx2/viewfrm.hxx index 7e038e9d6b96..86ff3ac01d4b 100644 --- a/include/sfx2/viewfrm.hxx +++ b/include/sfx2/viewfrm.hxx @@ -267,7 +267,7 @@ class SFX2_DLLPUBLIC SfxViewFrameItem final : public SfxPoolItem public: SfxViewFrameItem( SfxViewFrame *pViewFrame ): - SfxPoolItem( 0 ), + SfxPoolItem( 0, SfxItemType::SfxViewFrameItemType ), pFrame( pViewFrame) {} diff --git a/include/svl/cenumitm.hxx b/include/svl/cenumitm.hxx index 9428e095ce29..292648d0f572 100644 --- a/include/svl/cenumitm.hxx +++ b/include/svl/cenumitm.hxx @@ -26,7 +26,7 @@ class SVL_DLLPUBLIC SfxEnumItemInterface: public SfxPoolItem { protected: - explicit SfxEnumItemInterface(sal_uInt16 which): SfxPoolItem(which) {} + explicit SfxEnumItemInterface(sal_uInt16 which, SfxItemType eItemType): SfxPoolItem(which, eItemType) {} SfxEnumItemInterface(const SfxEnumItemInterface &) = default; diff --git a/include/svl/cintitem.hxx b/include/svl/cintitem.hxx index bde59c39906b..0b3da790d1ed 100644 --- a/include/svl/cintitem.hxx +++ b/include/svl/cintitem.hxx @@ -30,8 +30,8 @@ class SVL_DLLPUBLIC CntByteItem: public SfxPoolItem public: - CntByteItem(sal_uInt16 which, sal_uInt8 nTheValue): - SfxPoolItem(which), m_nValue(nTheValue) {} + CntByteItem(sal_uInt16 which, sal_uInt8 nTheValue, SfxItemType eItemType = SfxItemType::CntByteItemType): + SfxPoolItem(which, eItemType), m_nValue(nTheValue) {} virtual bool operator ==(const SfxPoolItem & rItem) const override; @@ -66,8 +66,8 @@ class SVL_DLLPUBLIC CntUInt16Item: public SfxPoolItem public: - CntUInt16Item(sal_uInt16 which, sal_uInt16 nTheValue): - SfxPoolItem(which), m_nValue(nTheValue) + CntUInt16Item(sal_uInt16 which, sal_uInt16 nTheValue, SfxItemType eItemType = SfxItemType::CntUInt16ItemType): + SfxPoolItem(which, eItemType), m_nValue(nTheValue) {} virtual bool operator ==(const SfxPoolItem & rItem) const override; @@ -103,8 +103,8 @@ class SVL_DLLPUBLIC CntInt32Item: public SfxPoolItem public: - CntInt32Item(sal_uInt16 which, sal_Int32 nTheValue): - SfxPoolItem(which), m_nValue(nTheValue) + CntInt32Item(sal_uInt16 which, sal_Int32 nTheValue, SfxItemType eItemType = SfxItemType::CntInt32ItemType): + SfxPoolItem(which, eItemType), m_nValue(nTheValue) {} virtual bool operator ==(const SfxPoolItem & rItem) const override; @@ -140,8 +140,8 @@ class SVL_DLLPUBLIC CntUInt32Item: public SfxPoolItem public: - CntUInt32Item(sal_uInt16 which, sal_uInt32 nTheValue): - SfxPoolItem(which), m_nValue(nTheValue) + CntUInt32Item(sal_uInt16 which, sal_uInt32 nTheValue, SfxItemType eItemType = SfxItemType::CntUInt32ItemType): + SfxPoolItem(which, eItemType), m_nValue(nTheValue) {} virtual bool operator ==(const SfxPoolItem & rItem) const override; diff --git a/include/svl/custritm.hxx b/include/svl/custritm.hxx index 3159c41dfc96..0251df2ca182 100644 --- a/include/svl/custritm.hxx +++ b/include/svl/custritm.hxx @@ -31,11 +31,12 @@ class SVL_DLLPUBLIC CntUnencodedStringItem: public SfxPoolItem public: - CntUnencodedStringItem(sal_uInt16 which): SfxPoolItem(which) + CntUnencodedStringItem(sal_uInt16 which, SfxItemType eItemType = SfxItemType::CntUnencodedStringItemType) + : SfxPoolItem(which, eItemType) {} - CntUnencodedStringItem(sal_uInt16 which, OUString aTheValue): - SfxPoolItem(which), m_aValue(std::move(aTheValue)) + CntUnencodedStringItem(sal_uInt16 which, OUString aTheValue, SfxItemType eItemType = SfxItemType::CntUnencodedStringItemType): + SfxPoolItem(which, eItemType), m_aValue(std::move(aTheValue)) {} virtual bool operator ==(const SfxPoolItem & rItem) const override; diff --git a/include/svl/eitem.hxx b/include/svl/eitem.hxx index 114e451c061d..650a43204821 100644 --- a/include/svl/eitem.hxx +++ b/include/svl/eitem.hxx @@ -30,8 +30,8 @@ class SAL_DLLPUBLIC_RTTI SfxEnumItem : public SfxEnumItemInterface EnumT m_nValue; protected: - explicit SfxEnumItem(sal_uInt16 const nWhich, EnumT const nValue) - : SfxEnumItemInterface(nWhich) + explicit SfxEnumItem(sal_uInt16 const nWhich, SfxItemType eItemType, EnumT const nValue) + : SfxEnumItemInterface(nWhich, eItemType) , m_nValue(nValue) { } @@ -72,8 +72,9 @@ class SVL_DLLPUBLIC SfxBoolItem public: static SfxPoolItem* CreateDefault(); - explicit SfxBoolItem(sal_uInt16 const nWhich = 0, bool const bValue = false) - : SfxPoolItem(nWhich) + explicit SfxBoolItem(sal_uInt16 const nWhich = 0, bool const bValue = false, + SfxItemType eItemType = SfxItemType::SfxBoolItemType) + : SfxPoolItem(nWhich, eItemType) , m_bValue(bValue) { } diff --git a/include/svl/flagitem.hxx b/include/svl/flagitem.hxx index 70b968f2c95c..76226cb1aa80 100644 --- a/include/svl/flagitem.hxx +++ b/include/svl/flagitem.hxx @@ -31,7 +31,8 @@ class SVL_DLLPUBLIC SfxFlagItem: public SfxPoolItem public: - explicit SfxFlagItem( sal_uInt16 nWhich = 0, sal_uInt16 nValue = 0 ); + explicit SfxFlagItem( sal_uInt16 nWhich = 0, sal_uInt16 nValue = 0, + SfxItemType eItemType = SfxItemType::SfxFlagItemType ); virtual sal_uInt8 GetFlagCount() const; diff --git a/include/svl/intitem.hxx b/include/svl/intitem.hxx index 92999568b7f2..f189388e748e 100644 --- a/include/svl/intitem.hxx +++ b/include/svl/intitem.hxx @@ -30,8 +30,9 @@ class SVL_DLLPUBLIC SfxByteItem: public CntByteItem public: static SfxPoolItem* CreateDefault(); - explicit SfxByteItem(sal_uInt16 which = 0, sal_uInt8 nValue = 0): - CntByteItem(which, nValue) {} + explicit SfxByteItem(sal_uInt16 which = 0, sal_uInt8 nValue = 0, + SfxItemType eItemType = SfxItemType::SfxByteItemType): + CntByteItem(which, nValue, eItemType) {} virtual SfxByteItem* Clone(SfxItemPool * = nullptr) const override { return new SfxByteItem(*this); } @@ -44,8 +45,9 @@ class SVL_DLLPUBLIC SfxInt16Item: public SfxPoolItem public: static SfxPoolItem* CreateDefault(); - explicit SfxInt16Item(sal_uInt16 which = 0, sal_Int16 nTheValue = 0): - SfxPoolItem(which), m_nValue(nTheValue) + explicit SfxInt16Item(sal_uInt16 which = 0, sal_Int16 nTheValue = 0, + SfxItemType eItemType = SfxItemType::SfxInt16ItemType): + SfxPoolItem(which, eItemType), m_nValue(nTheValue) {} virtual bool operator ==(const SfxPoolItem & rItem) const override; @@ -83,8 +85,9 @@ class SVL_DLLPUBLIC SfxUInt16Item: public CntUInt16Item public: static SfxPoolItem* CreateDefault(); - explicit SfxUInt16Item(sal_uInt16 which = 0, sal_uInt16 nValue = 0): - CntUInt16Item(which, nValue) {} + explicit SfxUInt16Item(sal_uInt16 which = 0, sal_uInt16 nValue = 0, + SfxItemType eItemType = SfxItemType::SfxUInt16ItemType): + CntUInt16Item(which, nValue, eItemType) {} virtual SfxUInt16Item* Clone(SfxItemPool * = nullptr) const override { return new SfxUInt16Item(*this); } @@ -99,8 +102,9 @@ class SVL_DLLPUBLIC SfxInt32Item: public CntInt32Item public: static SfxPoolItem* CreateDefault(); - explicit SfxInt32Item(sal_uInt16 which = 0, sal_Int32 nValue = 0): - CntInt32Item(which, nValue) {} + explicit SfxInt32Item(sal_uInt16 which = 0, sal_Int32 nValue = 0, + SfxItemType eItemType = SfxItemType::SfxInt32ItemType): + CntInt32Item(which, nValue, eItemType) {} virtual SfxInt32Item* Clone(SfxItemPool * = nullptr) const override { return new SfxInt32Item(*this); } diff --git a/include/svl/macitem.hxx b/include/svl/macitem.hxx index 1c2a4cf301b7..412f5cec8ece 100644 --- a/include/svl/macitem.hxx +++ b/include/svl/macitem.hxx @@ -135,7 +135,7 @@ private: }; inline SvxMacroItem::SvxMacroItem( const sal_uInt16 nId ) - : SfxPoolItem( nId ) + : SfxPoolItem( nId, SfxItemType::SvxMacroItemType ) {} inline bool SvxMacroItem::HasMacro( SvMacroItemId nEvent ) const diff --git a/include/svl/metitem.hxx b/include/svl/metitem.hxx index 30cf75b7f864..125ee7c3dc1d 100644 --- a/include/svl/metitem.hxx +++ b/include/svl/metitem.hxx @@ -25,7 +25,8 @@ class SVL_DLLPUBLIC SfxMetricItem: public SfxInt32Item { public: - explicit SfxMetricItem( sal_uInt16 nWhich, sal_Int32 nValue ); + explicit SfxMetricItem( sal_uInt16 nWhich, sal_Int32 nValue, + SfxItemType eItemType = SfxItemType::SfxMetricItemType ); virtual void ScaleMetrics( tools::Long lMult, tools::Long lDiv ) override; virtual bool HasMetrics() const override; diff --git a/include/svl/poolitem.hxx b/include/svl/poolitem.hxx index af993096e655..22eee419ba49 100644 --- a/include/svl/poolitem.hxx +++ b/include/svl/poolitem.hxx @@ -97,6 +97,316 @@ enum class SfxItemState { SET = 0x0040 }; +enum class SfxItemType : sal_uInt16 { + SfxPoolItemType, + AffineMatrixItemType, + CntByteItemType, + CntInt32ItemType, + CntUInt16ItemType, + CntUInt32ItemType, + CntUnencodedStringItemType, + DatabaseMapItemType, + DbuTypeCollectionItemType, + DriverPoolingSettingsItemType, + InvalidOrDisabledItemType, + MediaItemType, + NameOrIndexType, + OStringListItemType, + OfaPtrItemType, + OfaXColorListItemType, + OptionalBoolItemType, + RectangleAlignmentType, + SbxItemType, + ScCondFormatItemType, + ScCondFormatDlgItemType, + ScConsolidateItemType, + ScInputStatusItemType, + ScMergeAttrType, + ScPageHFItemType, + ScPageScaleToItemType, + ScPivotItemType, + ScProtectionAttrType, + ScQueryItemType, + ScSolveItemType, + ScSortItemType, + ScSubTotalItemType, + ScTabOpItemType, + ScTpCalcItemType, + ScTpDefaultsItemType, + ScTpFormulaItemType, + ScTpPrintItemType, + ScTpViewItemType, + ScUserListItemType, + ScViewObjectModeItemType, + SdOptionsMiscItemType, + SdOptionsPrintItemType, + SdOptionsSnapItemType, + SdOptionsLayoutItemType, + SdrAngleItemType, + SdrCaptionEscDirItemType, + SdrCaptionTypeItem, + SdrCaptionTypeItemType, + SdrCircKindItemType, + SdrCustomShapeGeometryItemType, + SdrEdgeKindItemType, + SdrFractionItemType, + SdrGrafModeItem_Base, + SdrLayerIdItemType, + SdrLayerNameItemType, + SdrMeasureFormatStringItemType, + SdrMeasureKindItemType, + SdrMeasureScaleItemType, + SdrMeasureTextAutoAngleItemType, + SdrMeasureTextAutoAngleViewItemType, + SdrMeasureTextHPosItemType, + SdrMeasureTextVPosItemType, + SdrMeasureUnitItemType, + SdrResizeXAllItemType, + SdrResizeXOneItemType, + SdrResizeYAllItemType, + SdrResizeYOneItemType, + SdrScaleItemType, + SdrTextAniDirectionItemType, + SdrTextAniKindItemType, + SdrTextFitToSizeTypeItemType, + SdrTextHorzAdjustType, + SdrTextVertAdjustType, + SdrYesNoItemType, + SfxBoolItemType, + SfxByteItemType, + SfxDocumentInfoItemType, + SfxEnumItemInterface, + SfxEventNamesItemType, + SfxFlagItemType, + SfxFrameItemType, + SfxGlobalNameItemType, + SfxGrabBagItemType, + SfxHyphenRegionItemType, + SfxImageItemType, + SfxInt16ItemType, + SfxInt32ItemType, + SfxInt64ItemType, + SfxIntegerListItemType, + SfxLinkItemType, + SfxLockBytesItemType, + SfxMacroInfoItemType, + SfxMetricItemType, + SfxObjectItemType, + SfxObjectShellItemType, + SfxPointItemType, + SfxRangeItemType, + SfxRectangleItemType, + SfxRegionItemType, + SfxSetItemType, + SfxStringItemType, + SfxStringListItemType, + SfxTemplateItemType, + SfxUInt16ItemType, + SfxUnoAnyItemType, + SfxUnoFrameItemType, + SfxViewFrameItemType, + SfxVisibilityItemType, + SfxVoidItemType, + SfxWatermarkItemType, + SfxZoomItemType, + SvXMLAttrContainerItemType, + SvxAdjustItemType, + SvxAutoKernItemType, + SvxB3DVectorItemType, + SvxBitmapListItemType, + SvxBlinkItemType, + SvxBoxInfoItemType, + SvxBoxItemType, + SvxBrushItemType, + SvxBulletItemType, + SvxCaseMapItemType, + SvxCharHiddenItemType, + SvxCharReliefItemType, + SvxCharScaleWidthItem, + SvxChartColorTableItemType, + SvxChartIndicateItemType, + SvxChartKindErrorItemType, + SvxChartRegressItemType, + SvxChartTextOrderItemType, + SvxClipboardFormatItemType, + SvxColorItemType, + SvxColorListItemType, + SvxColumnItemType, + SvxContourItemType, + SvxCrossedOutItemType, + SvxDashListItemType, + SvxDoubleItemType, + SvxEmphasisMarkItemType, + SvxEscapementItemType, + SvxFieldItemType, + SvxFirstLineIndentItemType, + SvxFontHeightItemType, + SvxFontItemType, + SvxFontListItemType, + SvxForbiddenRuleItemType, + SvxFormatBreakItemType, + SvxFrameDirectionItemType, + SvxGalleryItemType, + SvxGradientListItemType, + SvxGraphicItemType, + SvxGrfCrop, + SvxGrfCropType, + SvxGridItem, + SvxGridItemType, + SvxGutterLeftMarginItemType, + SvxGutterRightMarginItemType, + SvxHangingPunctuationItemType, + SvxHatchListItemType, + SvxHorJustifyItemType, + SvxHyperlinkItemType, + SvxHyphenZoneItem, + SvxHyphenZoneItemType, + SvxJustifyMethodItemType, + SvxKerningItemType, + SvxLRSpaceItemType, + SvxLanguageItemType, + SvxLeftMarginItemType, + SvxLineEndListItemType, + SvxLineItemType, + SvxLineSpacingItemType, + SvxLongLRSpaceItemType, + SvxLongULSpaceItemType, + SvxMacroItemType, + SvxMarginItemType, + SvxNoHyphenItemType, + SvxNumBulletItemType, + SvxNumberInfoItemType, + SvxObjectItemType, + SvxOrientationItemType, + SvxOrphansItemType, + SvxPageItemType, + SvxPagePosSizeItemType, + SvxParaGridItemType, + SvxParaVertAlignItemType, + SvxPatternListItemType, + SvxPostureItemType, + SvxProtectItemType, + SvxRightMarginItemType, + SvxRotateModeItemType, + SvxScriptSetItemType, + SvxScriptSpaceItemType, + SvxSearchItemType, + SvxShadowItemType, + SvxShadowedItemType, + SvxSizeItem , + SvxSizeItemType, + SvxSmartTagItemType, + SvxTabStopItemType, + SvxTextLeftMarginItemType, + SvxTextLineItemType, + SvxTextRotateItemType, + SvxTwoLinesItemType, + SvxULSpaceItemType, + SvxVerJustifyItemType, + SvxWeightItemType, + SvxWidowsItemType, + SvxWordLineItemType, + SvxWritingModeItemType, + SwAddPrinterItemType, + SwCondCollItemType, + SwCropGrfType, + SwDocDisplayItemType, + SwDrawModeGrf_BaseType, + SwElemItemType, + SwEnvItemType, + SwFltAnchorType, + SwFltBookmarkType, + SwFltRDFMarkType, + SwFltRedlineType, + SwFltTOXType, + SwFmtAidsAutoComplItemType, + SwFormatAnchorType, + SwFormatAutoFormatType, + SwFormatChainType, + SwFormatCharFormatType, + SwFormatColType, + SwFormatContentControlType, + SwFormatContentType, + SwFormatDropType, + SwFormatFieldType, + SwFormatFillOrderType, + SwFormatFlyCntType, + SwFormatFooterType, + SwFormatFootnoteEndAtTextEndType, + SwFormatFootnoteType, + SwFormatHeaderType, + SwFormatHoriOrientType, + SwFormatINetFormatType, + SwFormatLineNumberType, + SwFormatLinebreakType, + SwFormatMetaType, + SwFormatPageDescType, + SwFormatRefMarkType, + SwFormatRubyType, + SwFormatSurroundType, + SwFormatURLType, + SwFormatVertOrientType, + SwFormatWrapInfluenceOnOjPosType, + SwGammaGrfType, + SwInvertGrfType, + SwLabItemType, + SwMirrorGrfType, + SwMsgPoolItemType, + SwPaMItemType, + SwPageFootnoteInfoItemType, + SwPtrItemType, + SwRotationGrfType, + SwShadowCursorItemType, + SwTOXMarkType, + SwTableBoxValueType, + SwTableFormulaType, + SwTextGridItemType, + SwTransparencyGrfType, + SwUINumRuleItemType, + SwWrtShellItemType, + XFillAttrSetItemType, + XFillBackgroundItemType, + XFillBmpPosItemType, + XFillBmpPosOffsetXItemType, + XFillBmpPosOffsetYItemType, + XFillBmpSizeLogItemType, + XFillBmpSizeXItemType, + XFillBmpSizeYItemType, + XFillBmpStretchItemType, + XFillBmpTileItemType, + XFillBmpTileOffsetXItemType, + XFillBmpTileOffsetYItemType, + XFillStyleItemType, + XFillTransparenceItemType, + XFillUseSlideBackgroundItemType, + XFormTextAdjustItemType, + XFormTextDistanceItemType, + XFormTextHideFormItemType, + XFormTextMirrorItem, + XFormTextOutlineItemType, + XFormTextShadowItemType, + XFormTextShadowTranspItemType, + XFormTextShadowXValItemType, + XFormTextShadowYValItemType, + XFormTextStartItemType, + XFormTextStyleItemType, + XGradientStepCountItemType, + XLineAttrSetItemType, + XLineCapItemType, + XLineEndCenterItemType, + XLineEndWidthItemType, + XLineJointItemType, + XLineStartCenterItem, + XLineStartWidthItemType, + XLineStyleItemType, + XLineTransparenceItemType, + XLineWidthItemType +#ifdef DBG_UTIL + , SwTestItemType +#endif +}; + + #ifdef DBG_UTIL SVL_DLLPUBLIC size_t getAllocatedSfxPoolItemCount(); SVL_DLLPUBLIC size_t getUsedSfxPoolItemCount(); @@ -119,6 +429,7 @@ class SVL_DLLPUBLIC SfxPoolItem mutable sal_uInt32 m_nRefCount; sal_uInt16 m_nWhich; + SfxItemType m_eItemType; #ifdef DBG_UTIL // for debugging add a serial number, will be set in the constructor @@ -193,9 +504,10 @@ private: } protected: - explicit SfxPoolItem( sal_uInt16 nWhich = 0 ); + + explicit SfxPoolItem( sal_uInt16 nWhich, SfxItemType ); SfxPoolItem( const SfxPoolItem& rCopy) - : SfxPoolItem(rCopy.m_nWhich) {} + : SfxPoolItem(rCopy.m_nWhich, rCopy.m_eItemType) {} public: virtual ~SfxPoolItem(); @@ -207,6 +519,8 @@ public: m_nWhich = nId; } sal_uInt16 Which() const { return m_nWhich; } + SfxItemType ItemType() const { return m_eItemType;} + // StaticWhichCast asserts if the TypedWhichId is not matching its type, otherwise it returns a reference. // You can use StaticWhichCast when you are sure about the type at compile time -- like a static_cast. template<class T> T& StaticWhichCast(TypedWhichId<T> nId) diff --git a/include/svl/setitem.hxx b/include/svl/setitem.hxx index 69ebea4b1d23..6468037870be 100644 --- a/include/svl/setitem.hxx +++ b/include/svl/setitem.hxx @@ -31,8 +31,10 @@ class SVL_DLLPUBLIC SfxSetItem : public SfxPoolItem SfxSetItem& operator=(const SfxSetItem&) = delete; public: - SfxSetItem(sal_uInt16 nWhich, SfxItemSet&& pSet); - SfxSetItem(sal_uInt16 nWhich, const SfxItemSet& rSet); + SfxSetItem(sal_uInt16 nWhich, SfxItemSet&& pSet, + SfxItemType eItemType = SfxItemType::SfxSetItemType); + SfxSetItem(sal_uInt16 nWhich, const SfxItemSet& rSet, + SfxItemType eItemType = SfxItemType::SfxSetItemType); SfxSetItem(const SfxSetItem&, SfxItemPool* pPool = nullptr); virtual bool operator==(const SfxPoolItem&) const override; diff --git a/include/svl/stritem.hxx b/include/svl/stritem.hxx index fe3695f7947b..1b788c05bdf5 100644 --- a/include/svl/stritem.hxx +++ b/include/svl/stritem.hxx @@ -29,10 +29,11 @@ class SVL_DLLPUBLIC SfxStringItem: public CntUnencodedStringItem public: static SfxPoolItem* CreateDefault(); - SfxStringItem(sal_uInt16 which = 0): CntUnencodedStringItem(which) {} + SfxStringItem(sal_uInt16 which = 0, SfxItemType eItemType = SfxItemType::SfxStringItemType) + : CntUnencodedStringItem(which, eItemType) {} - SfxStringItem(sal_uInt16 which, const OUString & rValue): - CntUnencodedStringItem(which, rValue) {} + SfxStringItem(sal_uInt16 which, const OUString & rValue, SfxItemType eItemType = SfxItemType::SfxStringItemType): + CntUnencodedStringItem(which, rValue, eItemType) {} virtual SfxStringItem* Clone(SfxItemPool * = nullptr) const override; diff --git a/include/svl/visitem.hxx b/include/svl/visitem.hxx index 4ae5cdd550c1..8a458bbf2f6c 100644 --- a/include/svl/visitem.hxx +++ b/include/svl/visitem.hxx @@ -31,7 +31,7 @@ class SVL_DLLPUBLIC SfxVisibilityItem final : public SfxPoolItem public: explicit SfxVisibilityItem(sal_uInt16 which, bool bVisible): - SfxPoolItem(which) + SfxPoolItem(which, SfxItemType::SfxVisibilityItemType) { m_nValue.bVisible = bVisible; } diff --git a/include/svtools/borderline.hxx b/include/svtools/borderline.hxx index 36780bddf422..90ecee6512f5 100644 --- a/include/svtools/borderline.hxx +++ b/include/svtools/borderline.hxx @@ -21,6 +21,7 @@ #include <svtools/svtdllapi.h> #include <o3tl/typed_flags_set.hxx> +#include <o3tl/hash_combine.hxx> #include <tools/long.hxx> /** @@ -73,6 +74,16 @@ public: bool IsEmpty( ) const { return (0 == m_nRate1) && (0 == m_nRate2); } bool IsDouble( ) const { return (0 != m_nRate1) && (0 != m_nRate2); } + std::size_t getHash() const + { + std::size_t seed = 0; + o3tl::hash_combine(seed, m_nFlags); + o3tl::hash_combine(seed, m_nRate1); + o3tl::hash_combine(seed, m_nRate2); + o3tl::hash_combine(seed, m_nRateGap); + return seed; + } + }; /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/grfcrop.hxx b/include/svx/grfcrop.hxx index de0cfef5b976..3eed97fbab47 100644 --- a/include/svx/grfcrop.hxx +++ b/include/svx/grfcrop.hxx @@ -30,10 +30,11 @@ class SVXCORE_DLLPUBLIC SvxGrfCrop : public SfxPoolItem { sal_Int32 nLeft, nRight, nTop, nBottom; public: - SvxGrfCrop( TypedWhichId<SvxGrfCrop> ); + SvxGrfCrop( TypedWhichId<SvxGrfCrop>, SfxItemType eType = SfxItemType::SvxGrfCropType ); SvxGrfCrop( sal_Int32 nLeft, sal_Int32 nRight, sal_Int32 nTop, sal_Int32 nBottom, - TypedWhichId<SvxGrfCrop> ); + TypedWhichId<SvxGrfCrop>, + SfxItemType eItemType = SfxItemType::SvxGrfCropType ); virtual ~SvxGrfCrop() override; SvxGrfCrop(SvxGrfCrop const &) = default; diff --git a/include/svx/hlnkitem.hxx b/include/svx/hlnkitem.hxx index 03eb8424561c..95a42c273c59 100644 --- a/include/svx/hlnkitem.hxx +++ b/include/svx/hlnkitem.hxx @@ -62,7 +62,8 @@ public: static SfxPoolItem* CreateDefault(); SvxHyperlinkItem( TypedWhichId<SvxHyperlinkItem> _nWhich = SID_HYPERLINK_GETLINK ): - SfxPoolItem(_nWhich) { eType = HLINK_DEFAULT; nMacroEvents=HyperDialogEvent::NONE; }; + SfxPoolItem(_nWhich, SfxItemType::SvxHyperlinkItemType) + { eType = HLINK_DEFAULT; nMacroEvents=HyperDialogEvent::NONE; }; SvxHyperlinkItem( const SvxHyperlinkItem& rHyperlinkItem ); SvxHyperlinkItem( TypedWhichId<SvxHyperlinkItem> nWhich, OUString aName, OUString aURL, OUString aTarget, OUString aIntName, diff --git a/include/svx/optgrid.hxx b/include/svx/optgrid.hxx index 7cdcdf8399f3..6876d0c25b30 100644 --- a/include/svx/optgrid.hxx +++ b/include/svx/optgrid.hxx @@ -69,7 +69,8 @@ class SVX_DLLPUBLIC SvxGridItem : public SvxOptionsGrid, public SfxPoolItem friend class SvxGridTabPage; public: - SvxGridItem( TypedWhichId<SvxGridItem> _nWhich) : SfxPoolItem(_nWhich){}; + SvxGridItem( TypedWhichId<SvxGridItem> _nWhich) + : SfxPoolItem(_nWhich, SfxItemType::SvxGridItemType){}; virtual SvxGridItem* Clone( SfxItemPool *pPool = nullptr ) const override; virtual bool operator==( const SfxPoolItem& ) const override; diff --git a/include/svx/sdangitm.hxx b/include/svx/sdangitm.hxx index ee4af385a171..2d778010c6cd 100644 --- a/include/svx/sdangitm.hxx +++ b/include/svx/sdangitm.hxx @@ -27,7 +27,8 @@ class SVXCORE_DLLPUBLIC SdrAngleItem: public SfxInt32Item { public: - SdrAngleItem(TypedWhichId<SdrAngleItem> nId, Degree100 nAngle): SfxInt32Item(nId,nAngle.get()) {} + SdrAngleItem(TypedWhichId<SdrAngleItem> nId, Degree100 nAngle, SfxItemType eItemType = SfxItemType::SdrAngleItemType) + : SfxInt32Item(nId,nAngle.get(), eItemType) {} virtual SdrAngleItem* Clone(SfxItemPool* pPool=nullptr) const override; virtual bool GetPresentation(SfxItemPresentation ePres, diff --git a/include/svx/sdgmoitm.hxx b/include/svx/sdgmoitm.hxx index fa205b6db2e7..9e6b66844def 100644 --- a/include/svx/sdgmoitm.hxx +++ b/include/svx/sdgmoitm.hxx @@ -29,7 +29,7 @@ class SAL_DLLPUBLIC_RTTI SdrGrafModeItem_Base: public SfxEnumItem<GraphicDrawMode> { protected: SdrGrafModeItem_Base(GraphicDrawMode eMode): - SfxEnumItem(SDRATTR_GRAFMODE, eMode) {} + SfxEnumItem(SDRATTR_GRAFMODE, SfxItemType::SdrGrafModeItem_Base, eMode) {} }; class SVXCORE_DLLPUBLIC SdrGrafModeItem final : public SdrGrafModeItem_Base diff --git a/include/svx/sdtaditm.hxx b/include/svx/sdtaditm.hxx index 79ae6bc011be..6225352e2738 100644 --- a/include/svx/sdtaditm.hxx +++ b/include/svx/sdtaditm.hxx @@ -33,7 +33,8 @@ enum class SdrTextAniDirection class SVXCORE_DLLPUBLIC SdrTextAniDirectionItem final : public SfxEnumItem<SdrTextAniDirection> { public: - SdrTextAniDirectionItem(SdrTextAniDirection eDir=SdrTextAniDirection::Left): SfxEnumItem(SDRATTR_TEXT_ANIDIRECTION, eDir) {} + SdrTextAniDirectionItem(SdrTextAniDirection eDir=SdrTextAniDirection::Left) + : SfxEnumItem(SDRATTR_TEXT_ANIDIRECTION, SfxItemType::SdrTextAniDirectionItemType, eDir) {} virtual SdrTextAniDirectionItem* Clone(SfxItemPool* pPool=nullptr) const override; virtual sal_uInt16 GetValueCount() const override; diff --git a/include/svx/sdtaitm.hxx b/include/svx/sdtaitm.hxx index 716f703ec4eb..4838c85c4a53 100644 --- a/include/svx/sdtaitm.hxx +++ b/include/svx/sdtaitm.hxx @@ -34,8 +34,10 @@ enum SdrTextVertAdjust {SDRTEXTVERTADJUST_TOP, // aligned to top (normally class SVXCORE_DLLPUBLIC SdrTextVertAdjustItem final : public SfxEnumItem<SdrTextVertAdjust> { public: - SdrTextVertAdjustItem(SdrTextVertAdjust eAdj=SDRTEXTVERTADJUST_TOP): SfxEnumItem(SDRATTR_TEXT_VERTADJUST, eAdj) {} - SdrTextVertAdjustItem(SdrTextVertAdjust eAdj, TypedWhichId<SdrTextVertAdjustItem> nWhich): SfxEnumItem(nWhich, eAdj) {} + SdrTextVertAdjustItem(SdrTextVertAdjust eAdj=SDRTEXTVERTADJUST_TOP): + SfxEnumItem(SDRATTR_TEXT_VERTADJUST, SfxItemType::SdrTextVertAdjustType, eAdj) {} + SdrTextVertAdjustItem(SdrTextVertAdjust eAdj, TypedWhichId<SdrTextVertAdjustItem> nWhich) + : SfxEnumItem(nWhich, SfxItemType::SdrTextVertAdjustType, eAdj) {} virtual SdrTextVertAdjustItem* Clone(SfxItemPool* pPool=nullptr) const override; virtual sal_uInt16 GetValueCount() const override; // { return 5; } @@ -58,7 +60,8 @@ enum SdrTextHorzAdjust {SDRTEXTHORZADJUST_LEFT, // left adjusted class SVXCORE_DLLPUBLIC SdrTextHorzAdjustItem final : public SfxEnumItem<SdrTextHorzAdjust> { public: - SdrTextHorzAdjustItem(SdrTextHorzAdjust eAdj=SDRTEXTHORZADJUST_BLOCK): SfxEnumItem(SDRATTR_TEXT_HORZADJUST, eAdj) {} + SdrTextHorzAdjustItem(SdrTextHorzAdjust eAdj=SDRTEXTHORZADJUST_BLOCK): + SfxEnumItem(SDRATTR_TEXT_HORZADJUST, SfxItemType::SdrTextHorzAdjustType, eAdj) {} virtual SdrTextHorzAdjustItem* Clone(SfxItemPool* pPool=nullptr) const override; virtual sal_uInt16 GetValueCount() const override; diff --git a/include/svx/sdtakitm.hxx b/include/svx/sdtakitm.hxx index 0d86e517bb84..38ec15a2b851 100644 --- a/include/svx/sdtakitm.hxx +++ b/include/svx/sdtakitm.hxx @@ -78,7 +78,8 @@ enum class SdrTextAniKind { class SVXCORE_DLLPUBLIC SdrTextAniKindItem final : public SfxEnumItem<SdrTextAniKind> { public: - SdrTextAniKindItem(SdrTextAniKind eKind=SdrTextAniKind::NONE): SfxEnumItem(SDRATTR_TEXT_ANIKIND, eKind) {} + SdrTextAniKindItem(SdrTextAniKind eKind=SdrTextAniKind::NONE) + : SfxEnumItem(SDRATTR_TEXT_ANIKIND, SfxItemType::SdrTextAniKindItemType, eKind) {} virtual SdrTextAniKindItem* Clone(SfxItemPool* pPool=nullptr) const override; virtual sal_uInt16 GetValueCount() const override; // { return 5; } diff --git a/include/svx/sdtfsitm.hxx b/include/svx/sdtfsitm.hxx index ccdcb7c4dbe9..bce12dca9c1c 100644 --- a/include/svx/sdtfsitm.hxx +++ b/include/svx/sdtfsitm.hxx @@ -36,7 +36,7 @@ class SVXCORE_DLLPUBLIC SdrTextFitToSizeTypeItem final public: static SfxPoolItem* CreateDefault(); SdrTextFitToSizeTypeItem(css::drawing::TextFitToSizeType const eFit = css::drawing::TextFitToSizeType_NONE) - : SfxEnumItem(SDRATTR_TEXT_FITTOSIZE, eFit) + : SfxEnumItem(SDRATTR_TEXT_FITTOSIZE, SfxItemType::SdrTextFitToSizeTypeItemType, eFit) { } diff --git a/include/svx/sdynitm.hxx b/include/svx/sdynitm.hxx index 970956a42cee..08884c3404d2 100644 --- a/include/svx/sdynitm.hxx +++ b/include/svx/sdynitm.hxx @@ -29,7 +29,8 @@ //-------------------------------------------------- ---------- class SVXCORE_DLLPUBLIC SdrYesNoItem: public SfxBoolItem { public: - SdrYesNoItem(TypedWhichId<SdrYesNoItem> nId, bool bOn): SfxBoolItem(nId,bOn) {} + SdrYesNoItem(TypedWhichId<SdrYesNoItem> nId, bool bOn, SfxItemType eItemType = SfxItemType::SdrYesNoItemType) + : SfxBoolItem(nId, bOn, eItemType) {} virtual SdrYesNoItem* Clone(SfxItemPool* pPool=nullptr) const override; virtual OUString GetValueTextByVal(bool bVal) const override; virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString& rText, const IntlWrapper&) const override; diff --git a/include/svx/sxcecitm.hxx b/include/svx/sxcecitm.hxx index 6619c04be050..e358b7b3035c 100644 --- a/include/svx/sxcecitm.hxx +++ b/include/svx/sxcecitm.hxx @@ -32,10 +32,11 @@ enum class SdrCaptionEscDir { Horizontal, Vertical, BestFit }; class SVXCORE_DLLPUBLIC SdrCaptionEscDirItem final : public SfxEnumItem<SdrCaptionEscDir> { public: - SdrCaptionEscDirItem(SdrCaptionEscDir eDir=SdrCaptionEscDir::Horizontal): SfxEnumItem(SDRATTR_CAPTIONESCDIR, eDir) {} + SdrCaptionEscDirItem(SdrCaptionEscDir eDir=SdrCaptionEscDir::Horizontal) + : SfxEnumItem(SDRATTR_CAPTIONESCDIR, SfxItemType::SdrCaptionEscDirItemType, eDir) {} + virtual SdrCaptionEscDirItem* Clone(SfxItemPool* pPool=nullptr) const override; virtual sal_uInt16 GetValueCount() const override; // { return 3; } - static OUString GetValueTextByPos(sal_uInt16 nPos); virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString& rText, const IntlWrapper&) const override; diff --git a/include/svx/sxctitm.hxx b/include/svx/sxctitm.hxx index 3d46f54cb0bd..f3ca502c32e3 100644 --- a/include/svx/sxctitm.hxx +++ b/include/svx/sxctitm.hxx @@ -29,7 +29,8 @@ enum class SdrCaptionType { Type1, Type2, Type3, Type4 }; class SVXCORE_DLLPUBLIC SdrCaptionTypeItem final : public SfxEnumItem<SdrCaptionType> { public: - SdrCaptionTypeItem(SdrCaptionType eStyle=SdrCaptionType::Type3): SfxEnumItem(SDRATTR_CAPTIONTYPE, eStyle) {} + SdrCaptionTypeItem(SdrCaptionType eStyle=SdrCaptionType::Type3) + : SfxEnumItem(SDRATTR_CAPTIONTYPE, SfxItemType::SdrCaptionTypeItemType, eStyle) {} virtual SdrCaptionTypeItem* Clone(SfxItemPool* pPool=nullptr) const override; virtual sal_uInt16 GetValueCount() const override; // { return 4; } static OUString GetValueTextByPos(sal_uInt16 nPos); diff --git a/include/svx/sxekitm.hxx b/include/svx/sxekitm.hxx index fd54d38bbbe2..538a20bc4f03 100644 --- a/include/svx/sxekitm.hxx +++ b/include/svx/sxekitm.hxx @@ -30,7 +30,8 @@ enum class SdrEdgeKind class SVXCORE_DLLPUBLIC SdrEdgeKindItem final : public SfxEnumItem<SdrEdgeKind> { public: - SdrEdgeKindItem(SdrEdgeKind eStyle=SdrEdgeKind::OrthoLines): SfxEnumItem(SDRATTR_EDGEKIND, eStyle) {} + SdrEdgeKindItem(SdrEdgeKind eStyle=SdrEdgeKind::OrthoLines) + : SfxEnumItem(SDRATTR_EDGEKIND, SfxItemType::SdrEdgeKindItemType, eStyle) {} virtual SdrEdgeKindItem* Clone(SfxItemPool* pPool=nullptr) const override; virtual sal_uInt16 GetValueCount() const override; // { return 5; } virtual bool QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const override; diff --git a/include/svx/sxmtpitm.hxx b/include/svx/sxmtpitm.hxx index 60e17d445d61..8d698c625c8d 100644 --- a/include/svx/sxmtpitm.hxx +++ b/include/svx/sxmtpitm.hxx @@ -28,7 +28,7 @@ class SVXCORE_DLLPUBLIC SdrMeasureTextHPosItem final : public SfxEnumItem<css::drawing::MeasureTextHorzPos> { public: SdrMeasureTextHPosItem(css::drawing::MeasureTextHorzPos ePos = css::drawing::MeasureTextHorzPos::MeasureTextHorzPos_AUTO) - : SfxEnumItem(SDRATTR_MEASURETEXTHPOS, ePos) + : SfxEnumItem(SDRATTR_MEASURETEXTHPOS, SfxItemType::SdrMeasureTextHPosItemType, ePos) { } virtual SdrMeasureTextHPosItem* Clone(SfxItemPool* pPool=nullptr) const override; @@ -44,7 +44,7 @@ public: class SVXCORE_DLLPUBLIC SdrMeasureTextVPosItem final : public SfxEnumItem<css::drawing::MeasureTextVertPos> { public: SdrMeasureTextVPosItem(css::drawing::MeasureTextVertPos ePos = css::drawing::MeasureTextVertPos_AUTO) - : SfxEnumItem(SDRATTR_MEASURETEXTVPOS, ePos) + : SfxEnumItem(SDRATTR_MEASURETEXTVPOS, SfxItemType::SdrMeasureTextVPosItemType, ePos) { } virtual SdrMeasureTextVPosItem* Clone(SfxItemPool* pPool=nullptr) const override; diff --git a/include/svx/sxmuitm.hxx b/include/svx/sxmuitm.hxx index ab0ad8a3cd35..827cb320f771 100644 --- a/include/svx/sxmuitm.hxx +++ b/include/svx/sxmuitm.hxx @@ -28,7 +28,8 @@ // (based on the facts of the MapUnit of the model). This unity is displayed if necessary. class SVXCORE_DLLPUBLIC SdrMeasureUnitItem final : public SfxEnumItem<FieldUnit> { public: - SdrMeasureUnitItem(FieldUnit eUnit=FieldUnit::NONE): SfxEnumItem(SDRATTR_MEASUREUNIT, eUnit) {} + SdrMeasureUnitItem(FieldUnit eUnit=FieldUnit::NONE) + : SfxEnumItem(SDRATTR_MEASUREUNIT, SfxItemType::SdrMeasureUnitItemType, eUnit) {} virtual SdrMeasureUnitItem* Clone(SfxItemPool* pPool=nullptr) const override; virtual sal_uInt16 GetValueCount() const override; // { return 14; } |