summaryrefslogtreecommitdiff
path: root/svx/source/xoutdev
diff options
context:
space:
mode:
authorOliver Specht <oliver.specht@cib.de>2024-05-22 12:26:46 +0200
committerThorsten Behrens <thorsten.behrens@allotropia.de>2024-06-18 01:07:42 +0200
commitc39e4f6b8a942680bc7250177c34fd034a0605e0 (patch)
treee7fb5be56a6f3a391ab420bede1d2ea714901777 /svx/source/xoutdev
parent8ef9573f087b86f93860c8d07d04b60a40512836 (diff)
Add SfxItemType to SfxPoolItem
The SfxPoolItem has a new member SfxItemType m_eItemType to compare types based on enums instead of typeinfo() which consumes a lot of time e.g. while AutoFormat is running Change-Id: I033ce67bc9a28ee4790f162380314de85fb4154e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166452 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de> Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
Diffstat (limited to 'svx/source/xoutdev')
-rw-r--r--svx/source/xoutdev/xattr.cxx48
-rw-r--r--svx/source/xoutdev/xattr2.cxx38
2 files changed, 44 insertions, 42 deletions
diff --git a/svx/source/xoutdev/xattr.cxx b/svx/source/xoutdev/xattr.cxx
index 66811b133d97..a228b93e4da2 100644
--- a/svx/source/xoutdev/xattr.cxx
+++ b/svx/source/xoutdev/xattr.cxx
@@ -98,13 +98,13 @@ using namespace ::com::sun::star;
typedef std::map<OUString, OUString> StringMap;
NameOrIndex::NameOrIndex(TypedWhichId<NameOrIndex> _nWhich, sal_Int32 nIndex) :
- SfxStringItem(_nWhich, OUString()),
+ SfxStringItem(_nWhich, OUString(), SfxItemType::NameOrIndexType),
m_nPalIndex(nIndex)
{
}
NameOrIndex::NameOrIndex(TypedWhichId<NameOrIndex> _nWhich, const OUString& rName) :
- SfxStringItem(_nWhich, rName),
+ SfxStringItem(_nWhich, rName, SfxItemType::NameOrIndexType),
m_nPalIndex(-1)
{
}
@@ -420,7 +420,7 @@ void XColorItem::dumpAsXml(xmlTextWriterPtr pWriter) const
SfxPoolItem* XLineStyleItem::CreateDefault() { return new XLineStyleItem; }
XLineStyleItem::XLineStyleItem(css::drawing::LineStyle eTheLineStyle) :
- SfxEnumItem(XATTR_LINESTYLE, eTheLineStyle)
+ SfxEnumItem(XATTR_LINESTYLE, SfxItemType::XLineStyleItemType, eTheLineStyle)
{
}
@@ -976,7 +976,7 @@ std::unique_ptr<XLineDashItem> XLineDashItem::checkForUniqueItem( SdrModel* pMod
SfxPoolItem* XLineWidthItem::CreateDefault() {return new XLineWidthItem;}
XLineWidthItem::XLineWidthItem(tools::Long nWidth) :
- SfxMetricItem(XATTR_LINEWIDTH, nWidth)
+ SfxMetricItem(XATTR_LINEWIDTH, nWidth, SfxItemType::XLineWidthItemType)
{
}
@@ -1728,7 +1728,7 @@ bool XLineEndItem::PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId )
}
XLineStartWidthItem::XLineStartWidthItem(tools::Long nWidth) :
- SfxMetricItem(XATTR_LINESTARTWIDTH, nWidth)
+ SfxMetricItem(XATTR_LINESTARTWIDTH, nWidth, SfxItemType::XLineStartWidthItemType)
{
}
@@ -1766,7 +1766,7 @@ bool XLineStartWidthItem::PutValue( const css::uno::Any& rVal, sal_uInt8 /*nMemb
}
XLineEndWidthItem::XLineEndWidthItem(tools::Long nWidth) :
- SfxMetricItem(XATTR_LINEENDWIDTH, nWidth)
+ SfxMetricItem(XATTR_LINEENDWIDTH, nWidth, SfxItemType::XLineEndWidthItemType)
{
}
@@ -1804,7 +1804,7 @@ bool XLineEndWidthItem::PutValue( const css::uno::Any& rVal, sal_uInt8 /*nMember
}
XLineStartCenterItem::XLineStartCenterItem(bool bStartCenter) :
- SfxBoolItem(XATTR_LINESTARTCENTER, bStartCenter)
+ SfxBoolItem(XATTR_LINESTARTCENTER, bStartCenter, SfxItemType::XLineStartCenterItem)
{
}
@@ -1843,7 +1843,7 @@ bool XLineStartCenterItem::PutValue( const css::uno::Any& rVal, sal_uInt8 /*nMem
}
XLineEndCenterItem::XLineEndCenterItem(bool bEndCenter) :
- SfxBoolItem(XATTR_LINEENDCENTER, bEndCenter)
+ SfxBoolItem(XATTR_LINEENDCENTER, bEndCenter, SfxItemType::XLineEndCenterItemType)
{
}
@@ -1887,7 +1887,7 @@ bool XLineEndCenterItem::PutValue( const css::uno::Any& rVal, sal_uInt8 /*nMembe
SfxPoolItem* XFillStyleItem::CreateDefault() { return new XFillStyleItem; }
XFillStyleItem::XFillStyleItem(drawing::FillStyle eFillStyle) :
- SfxEnumItem(XATTR_FILLSTYLE, eFillStyle)
+ SfxEnumItem(XATTR_FILLSTYLE, SfxItemType::XFillStyleItemType, eFillStyle)
{
}
@@ -2897,7 +2897,7 @@ std::unique_ptr<XFillHatchItem> XFillHatchItem::checkForUniqueItem( SdrModel* pM
SfxPoolItem* XFormTextStyleItem::CreateDefault() { return new XFormTextStyleItem; }
XFormTextStyleItem::XFormTextStyleItem(XFormTextStyle eTheStyle) :
- SfxEnumItem(XATTR_FORMTXTSTYLE, eTheStyle)
+ SfxEnumItem(XATTR_FORMTXTSTYLE, SfxItemType::XFormTextStyleItemType, eTheStyle)
{
}
@@ -2930,7 +2930,7 @@ bool XFormTextStyleItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberId*/
SfxPoolItem* XFormTextAdjustItem::CreateDefault() { return new XFormTextAdjustItem; }
XFormTextAdjustItem::XFormTextAdjustItem(XFormTextAdjust eTheAdjust) :
- SfxEnumItem(XATTR_FORMTXTADJUST, eTheAdjust)
+ SfxEnumItem(XATTR_FORMTXTADJUST, SfxItemType::XFormTextAdjustItemType, eTheAdjust)
{
}
@@ -2963,7 +2963,7 @@ bool XFormTextAdjustItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberId*
SfxPoolItem* XFormTextDistanceItem::CreateDefault() { return new XFormTextDistanceItem; }
XFormTextDistanceItem::XFormTextDistanceItem(tools::Long nDist) :
- SfxMetricItem(XATTR_FORMTXTDISTANCE, nDist)
+ SfxMetricItem(XATTR_FORMTXTDISTANCE, nDist, SfxItemType::XFormTextDistanceItemType)
{
}
@@ -2975,7 +2975,7 @@ XFormTextDistanceItem* XFormTextDistanceItem::Clone(SfxItemPool* /*pPool*/) cons
SfxPoolItem* XFormTextStartItem::CreateDefault() { return new XFormTextStartItem; }
XFormTextStartItem::XFormTextStartItem(tools::Long nStart) :
- SfxMetricItem(XATTR_FORMTXTSTART, nStart)
+ SfxMetricItem(XATTR_FORMTXTSTART, nStart, SfxItemType::XFormTextStartItemType)
{
}
@@ -2987,7 +2987,7 @@ XFormTextStartItem* XFormTextStartItem::Clone(SfxItemPool* /*pPool*/) const
SfxPoolItem* XFormTextMirrorItem::CreateDefault() { return new XFormTextMirrorItem; }
XFormTextMirrorItem::XFormTextMirrorItem(bool bMirror) :
- SfxBoolItem(XATTR_FORMTXTMIRROR, bMirror)
+ SfxBoolItem(XATTR_FORMTXTMIRROR, bMirror, SfxItemType::XFormTextMirrorItem)
{
}
@@ -2999,7 +2999,7 @@ XFormTextMirrorItem* XFormTextMirrorItem::Clone(SfxItemPool* /*pPool*/) const
SfxPoolItem* XFormTextOutlineItem::CreateDefault() { return new XFormTextOutlineItem; }
XFormTextOutlineItem::XFormTextOutlineItem(bool bOutline) :
- SfxBoolItem(XATTR_FORMTXTOUTLINE, bOutline)
+ SfxBoolItem(XATTR_FORMTXTOUTLINE, bOutline, SfxItemType::XFormTextOutlineItemType)
{
}
@@ -3011,7 +3011,7 @@ XFormTextOutlineItem* XFormTextOutlineItem::Clone(SfxItemPool* /*pPool*/) const
SfxPoolItem* XFormTextShadowItem::CreateDefault() { return new XFormTextShadowItem; }
XFormTextShadowItem::XFormTextShadowItem(XFormTextShadow eFormTextShadow) :
- SfxEnumItem(XATTR_FORMTXTSHADOW, eFormTextShadow)
+ SfxEnumItem(XATTR_FORMTXTSHADOW, SfxItemType::XFormTextShadowItemType, eFormTextShadow)
{
}
@@ -3057,7 +3057,7 @@ XFormTextShadowColorItem* XFormTextShadowColorItem::Clone(SfxItemPool* /*pPool*/
SfxPoolItem* XFormTextShadowXValItem::CreateDefault() { return new XFormTextShadowXValItem; }
XFormTextShadowXValItem::XFormTextShadowXValItem(tools::Long nVal) :
- SfxMetricItem(XATTR_FORMTXTSHDWXVAL, nVal)
+ SfxMetricItem(XATTR_FORMTXTSHDWXVAL, nVal, SfxItemType::XFormTextShadowXValItemType)
{
}
@@ -3069,7 +3069,7 @@ XFormTextShadowXValItem* XFormTextShadowXValItem::Clone(SfxItemPool* /*pPool*/)
SfxPoolItem* XFormTextShadowYValItem::CreateDefault() { return new XFormTextShadowYValItem; }
XFormTextShadowYValItem::XFormTextShadowYValItem(tools::Long nVal) :
- SfxMetricItem(XATTR_FORMTXTSHDWYVAL, nVal)
+ SfxMetricItem(XATTR_FORMTXTSHDWYVAL, nVal, SfxItemType::XFormTextShadowYValItemType)
{
}
@@ -3081,7 +3081,7 @@ XFormTextShadowYValItem* XFormTextShadowYValItem::Clone(SfxItemPool* /*pPool*/)
SfxPoolItem* XFormTextHideFormItem::CreateDefault() { return new XFormTextHideFormItem; }
XFormTextHideFormItem::XFormTextHideFormItem(bool bHide) :
- SfxBoolItem(XATTR_FORMTXTHIDEFORM, bHide)
+ SfxBoolItem(XATTR_FORMTXTHIDEFORM, bHide, SfxItemType::XFormTextHideFormItemType)
{
}
@@ -3095,13 +3095,14 @@ XFormTextHideFormItem* XFormTextHideFormItem::Clone(SfxItemPool* /*pPool*/) cons
/// a line attribute set item
XLineAttrSetItem::XLineAttrSetItem( SfxItemSet&& pItemSet ) :
- SfxSetItem( XATTRSET_LINE, std::move(pItemSet))
+ SfxSetItem( XATTRSET_LINE, std::move(pItemSet), SfxItemType::XLineAttrSetItemType)
{
}
XLineAttrSetItem::XLineAttrSetItem( SfxItemPool* pItemPool ) :
SfxSetItem( XATTRSET_LINE,
- SfxItemSetFixed<XATTR_LINE_FIRST, XATTR_LINE_LAST>( *pItemPool ))
+ SfxItemSetFixed<XATTR_LINE_FIRST, XATTR_LINE_LAST>( *pItemPool ),
+ SfxItemType::XLineAttrSetItemType)
{
}
@@ -3123,13 +3124,14 @@ XLineAttrSetItem* XLineAttrSetItem::Clone( SfxItemPool* pPool ) const
/// fill attribute set item
XFillAttrSetItem::XFillAttrSetItem( SfxItemSet&& pItemSet ) :
- SfxSetItem( XATTRSET_FILL, std::move(pItemSet))
+ SfxSetItem( XATTRSET_FILL, std::move(pItemSet), SfxItemType::XFillAttrSetItemType)
{
}
XFillAttrSetItem::XFillAttrSetItem( SfxItemPool* pItemPool ) :
SfxSetItem( XATTRSET_FILL,
- SfxItemSetFixed<XATTR_FILL_FIRST, XATTR_FILL_LAST>( *pItemPool ))
+ SfxItemSetFixed<XATTR_FILL_FIRST, XATTR_FILL_LAST>( *pItemPool ),
+ SfxItemType::XFillAttrSetItemType)
{
}
diff --git a/svx/source/xoutdev/xattr2.cxx b/svx/source/xoutdev/xattr2.cxx
index 7e82a1f0b950..10c00d8a78cd 100644
--- a/svx/source/xoutdev/xattr2.cxx
+++ b/svx/source/xoutdev/xattr2.cxx
@@ -51,7 +51,7 @@
#include <libxml/xmlwriter.h>
XLineTransparenceItem::XLineTransparenceItem(sal_uInt16 nLineTransparence) :
- SfxUInt16Item(XATTR_LINETRANSPARENCE, nLineTransparence)
+ SfxUInt16Item(XATTR_LINETRANSPARENCE, nLineTransparence, SfxItemType::XLineTransparenceItemType)
{
}
@@ -88,7 +88,7 @@ bool XLineTransparenceItem::GetPresentation
SfxPoolItem* XLineJointItem::CreateDefault() { return new XLineJointItem; }
XLineJointItem::XLineJointItem( css::drawing::LineJoint eLineJoint ) :
- SfxEnumItem(XATTR_LINEJOINT, eLineJoint)
+ SfxEnumItem(XATTR_LINEJOINT, SfxItemType::XLineJointItemType, eLineJoint)
{
}
@@ -170,7 +170,7 @@ sal_uInt16 XLineJointItem::GetValueCount() const
AffineMatrixItem::AffineMatrixItem(const css::geometry::AffineMatrix2D* pMatrix)
-: SfxPoolItem(SID_ATTR_TRANSFORM_MATRIX)
+: SfxPoolItem(SID_ATTR_TRANSFORM_MATRIX, SfxItemType::AffineMatrixItemType)
{
if(pMatrix)
{
@@ -245,7 +245,7 @@ bool AffineMatrixItem::PutValue( const css::uno::Any& rVal, sal_uInt8 /*nMemberI
SfxPoolItem* XLineCapItem::CreateDefault() { return new XLineCapItem; }
XLineCapItem::XLineCapItem(css::drawing::LineCap eLineCap)
-: SfxEnumItem(XATTR_LINECAP, eLineCap)
+: SfxEnumItem(XATTR_LINECAP, SfxItemType::XLineCapItemType, eLineCap)
{
}
@@ -329,7 +329,7 @@ css::drawing::LineCap XLineCapItem::GetValue() const
}
XFillTransparenceItem::XFillTransparenceItem(sal_uInt16 nFillTransparence) :
- SfxUInt16Item(XATTR_FILLTRANSPARENCE, nFillTransparence)
+ SfxUInt16Item(XATTR_FILLTRANSPARENCE, nFillTransparence, SfxItemType::XFillTransparenceItemType)
{
}
@@ -372,7 +372,7 @@ void XFillTransparenceItem::dumpAsXml(xmlTextWriterPtr pWriter) const
XFormTextShadowTranspItem::XFormTextShadowTranspItem(sal_uInt16 nShdwTransparence) :
- SfxUInt16Item(XATTR_FORMTXTSHDWTRANSP, nShdwTransparence)
+ SfxUInt16Item(XATTR_FORMTXTSHDWTRANSP, nShdwTransparence, SfxItemType::XFormTextShadowTranspItemType)
{
}
@@ -383,7 +383,7 @@ XFormTextShadowTranspItem* XFormTextShadowTranspItem::Clone(SfxItemPool* /*pPool
XGradientStepCountItem::XGradientStepCountItem( sal_uInt16 nStepCount ) :
- SfxUInt16Item( XATTR_GRADIENTSTEPCOUNT, nStepCount )
+ SfxUInt16Item( XATTR_GRADIENTSTEPCOUNT, nStepCount, SfxItemType::XGradientStepCountItemType )
{
}
@@ -408,7 +408,7 @@ bool XGradientStepCountItem::GetPresentation
XFillBmpTileItem::XFillBmpTileItem( bool bTile ) :
- SfxBoolItem( XATTR_FILLBMP_TILE, bTile )
+ SfxBoolItem( XATTR_FILLBMP_TILE, bTile, SfxItemType::XFillBmpTileItemType )
{
}
@@ -440,7 +440,7 @@ void XFillBmpTileItem::dumpAsXml(xmlTextWriterPtr pWriter) const
XFillBmpPosItem::XFillBmpPosItem( RectPoint eRP ) :
- SfxEnumItem( XATTR_FILLBMP_POS, eRP )
+ SfxEnumItem( XATTR_FILLBMP_POS, SfxItemType::XFillBmpPosItemType, eRP )
{
}
@@ -476,7 +476,7 @@ void XFillBmpPosItem::dumpAsXml(xmlTextWriterPtr pWriter) const
XFillBmpSizeXItem::XFillBmpSizeXItem( tools::Long nSizeX ) :
- SfxMetricItem( XATTR_FILLBMP_SIZEX, nSizeX )
+ SfxMetricItem( XATTR_FILLBMP_SIZEX, nSizeX, SfxItemType::XFillBmpSizeXItemType )
{
}
@@ -505,7 +505,7 @@ bool XFillBmpSizeXItem::HasMetrics() const
XFillBmpSizeYItem::XFillBmpSizeYItem( tools::Long nSizeY ) :
- SfxMetricItem( XATTR_FILLBMP_SIZEY, nSizeY )
+ SfxMetricItem( XATTR_FILLBMP_SIZEY, nSizeY, SfxItemType::XFillBmpSizeYItemType )
{
}
@@ -533,7 +533,7 @@ bool XFillBmpSizeYItem::HasMetrics() const
XFillBmpSizeLogItem::XFillBmpSizeLogItem( bool bLog ) :
- SfxBoolItem( XATTR_FILLBMP_SIZELOG, bLog )
+ SfxBoolItem( XATTR_FILLBMP_SIZELOG, bLog, SfxItemType::XFillBmpSizeLogItemType )
{
}
@@ -557,7 +557,7 @@ bool XFillBmpSizeLogItem::GetPresentation
XFillBmpTileOffsetXItem::XFillBmpTileOffsetXItem( sal_uInt16 nOffX ) :
- SfxUInt16Item( XATTR_FILLBMP_TILEOFFSETX, nOffX )
+ SfxUInt16Item( XATTR_FILLBMP_TILEOFFSETX, nOffX, SfxItemType::XFillBmpTileOffsetXItemType )
{
}
@@ -580,7 +580,7 @@ bool XFillBmpTileOffsetXItem::GetPresentation
XFillBmpTileOffsetYItem::XFillBmpTileOffsetYItem( sal_uInt16 nOffY ) :
- SfxUInt16Item( XATTR_FILLBMP_TILEOFFSETY, nOffY )
+ SfxUInt16Item( XATTR_FILLBMP_TILEOFFSETY, nOffY, SfxItemType::XFillBmpTileOffsetYItemType )
{
}
@@ -602,7 +602,7 @@ bool XFillBmpTileOffsetYItem::GetPresentation
}
XFillBmpStretchItem::XFillBmpStretchItem( bool bStretch ) :
- SfxBoolItem( XATTR_FILLBMP_STRETCH, bStretch )
+ SfxBoolItem( XATTR_FILLBMP_STRETCH, bStretch, SfxItemType::XFillBmpStretchItemType )
{
}
@@ -632,7 +632,7 @@ void XFillBmpStretchItem::dumpAsXml(xmlTextWriterPtr pWriter) const
}
XFillBmpPosOffsetXItem::XFillBmpPosOffsetXItem(sal_Int32 nOffPosX)
- : SfxInt32Item(XATTR_FILLBMP_POSOFFSETX, nOffPosX)
+ : SfxInt32Item(XATTR_FILLBMP_POSOFFSETX, nOffPosX, SfxItemType::XFillBmpPosOffsetXItemType )
{
}
@@ -654,7 +654,7 @@ bool XFillBmpPosOffsetXItem::GetPresentation
}
XFillBmpPosOffsetYItem::XFillBmpPosOffsetYItem(sal_Int32 nOffPosY)
- : SfxInt32Item(XATTR_FILLBMP_POSOFFSETY, nOffPosY)
+ : SfxInt32Item(XATTR_FILLBMP_POSOFFSETY, nOffPosY, SfxItemType::XFillBmpPosOffsetYItemType)
{
}
@@ -676,7 +676,7 @@ bool XFillBmpPosOffsetYItem::GetPresentation
}
XFillBackgroundItem::XFillBackgroundItem( bool bFill ) :
- SfxBoolItem( XATTR_FILLBACKGROUND, bFill )
+ SfxBoolItem( XATTR_FILLBACKGROUND, bFill, SfxItemType::XFillBackgroundItemType )
{
}
@@ -701,7 +701,7 @@ void XFillBackgroundItem::dumpAsXml(xmlTextWriterPtr pWriter) const
}
XFillUseSlideBackgroundItem::XFillUseSlideBackgroundItem( bool bFill ) :
- SfxBoolItem( XATTR_FILLUSESLIDEBACKGROUND, bFill )
+ SfxBoolItem( XATTR_FILLUSESLIDEBACKGROUND, bFill, SfxItemType::XFillUseSlideBackgroundItemType )
{
}