summaryrefslogtreecommitdiff
path: root/svl
diff options
context:
space:
mode:
Diffstat (limited to 'svl')
-rw-r--r--svl/source/items/flagitem.cxx4
-rw-r--r--svl/source/items/globalnameitem.cxx5
-rw-r--r--svl/source/items/grabbagitem.cxx7
-rw-r--r--svl/source/items/ilstitem.cxx5
-rw-r--r--svl/source/items/imageitm.cxx2
-rw-r--r--svl/source/items/int64item.cxx2
-rw-r--r--svl/source/items/intitem.cxx4
-rw-r--r--svl/source/items/itemset.cxx2
-rw-r--r--svl/source/items/lckbitem.cxx1
-rw-r--r--svl/source/items/poolitem.cxx25
-rw-r--r--svl/source/items/ptitem.cxx3
-rw-r--r--svl/source/items/rectitem.cxx3
-rw-r--r--svl/source/items/rngitem.cxx2
-rw-r--r--svl/source/items/sitem.cxx10
-rw-r--r--svl/source/items/slstitm.cxx5
-rw-r--r--svl/source/items/srchitem.cxx2
-rw-r--r--svl/source/items/voiditem.cxx4
17 files changed, 51 insertions, 35 deletions
diff --git a/svl/source/items/flagitem.cxx b/svl/source/items/flagitem.cxx
index 270be1e57530..8a873bacbb61 100644
--- a/svl/source/items/flagitem.cxx
+++ b/svl/source/items/flagitem.cxx
@@ -26,8 +26,8 @@
#include <sal/log.hxx>
-SfxFlagItem::SfxFlagItem( sal_uInt16 nW, sal_uInt16 nV ) :
- SfxPoolItem( nW ),
+SfxFlagItem::SfxFlagItem( sal_uInt16 nW, sal_uInt16 nV, SfxItemType eItemType ) :
+ SfxPoolItem( nW, eItemType ),
nVal(nV)
{
}
diff --git a/svl/source/items/globalnameitem.cxx b/svl/source/items/globalnameitem.cxx
index 3f8d3265d779..6cd1ece098ee 100644
--- a/svl/source/items/globalnameitem.cxx
+++ b/svl/source/items/globalnameitem.cxx
@@ -30,13 +30,14 @@
SfxPoolItem* SfxGlobalNameItem::CreateDefault() { return new SfxGlobalNameItem; }
-SfxGlobalNameItem::SfxGlobalNameItem()
+SfxGlobalNameItem::SfxGlobalNameItem() :
+ SfxPoolItem(0, SfxItemType::SfxGlobalNameItemType)
{
}
SfxGlobalNameItem::SfxGlobalNameItem( sal_uInt16 nW, const SvGlobalName& rName )
-: SfxPoolItem( nW ),
+: SfxPoolItem( nW, SfxItemType::SfxGlobalNameItemType ),
m_aName( rName )
{
}
diff --git a/svl/source/items/grabbagitem.cxx b/svl/source/items/grabbagitem.cxx
index 39ee566866b3..ce4d7804fd0b 100644
--- a/svl/source/items/grabbagitem.cxx
+++ b/svl/source/items/grabbagitem.cxx
@@ -16,10 +16,13 @@
using namespace com::sun::star;
-SfxGrabBagItem::SfxGrabBagItem() = default;
+SfxGrabBagItem::SfxGrabBagItem()
+ : SfxPoolItem(0, SfxItemType::SfxGrabBagItemType)
+{
+}
SfxGrabBagItem::SfxGrabBagItem(sal_uInt16 nWhich)
- : SfxPoolItem(nWhich)
+ : SfxPoolItem(nWhich, SfxItemType::SfxGrabBagItemType)
{
}
diff --git a/svl/source/items/ilstitem.cxx b/svl/source/items/ilstitem.cxx
index 0cb9ea8e6c49..adbc324c46ee 100644
--- a/svl/source/items/ilstitem.cxx
+++ b/svl/source/items/ilstitem.cxx
@@ -28,17 +28,18 @@
SfxPoolItem* SfxIntegerListItem::CreateDefault() { return new SfxIntegerListItem; }
SfxIntegerListItem::SfxIntegerListItem()
+ : SfxPoolItem(0, SfxItemType::SfxIntegerListItemType)
{
}
SfxIntegerListItem::SfxIntegerListItem( sal_uInt16 which, ::std::vector < sal_Int32 >&& rList )
- : SfxPoolItem( which )
+ : SfxPoolItem( which, SfxItemType::SfxIntegerListItemType )
, m_aList( std::move(rList) )
{
}
SfxIntegerListItem::SfxIntegerListItem( sal_uInt16 which, const css::uno::Sequence < sal_Int32 >& rList )
- : SfxPoolItem( which )
+ : SfxPoolItem( which, SfxItemType::SfxIntegerListItemType )
{
comphelper::sequenceToContainer(m_aList, rList);
}
diff --git a/svl/source/items/imageitm.cxx b/svl/source/items/imageitm.cxx
index cba4b7103b82..7020054d6889 100644
--- a/svl/source/items/imageitm.cxx
+++ b/svl/source/items/imageitm.cxx
@@ -25,7 +25,7 @@
SfxPoolItem* SfxImageItem::CreateDefault() { return new SfxImageItem; }
SfxImageItem::SfxImageItem( sal_uInt16 which )
- : SfxInt16Item( which, 0 ), mnAngle(0), mbMirrored(false)
+ : SfxInt16Item( which, 0, SfxItemType::SfxImageItemType ), mnAngle(0), mbMirrored(false)
{
}
diff --git a/svl/source/items/int64item.cxx b/svl/source/items/int64item.cxx
index 06efd1fc9aca..644802edf9cc 100644
--- a/svl/source/items/int64item.cxx
+++ b/svl/source/items/int64item.cxx
@@ -10,7 +10,7 @@
#include <svl/int64item.hxx>
SfxInt64Item::SfxInt64Item( sal_uInt16 nWhich, sal_Int64 nVal ) :
- SfxPoolItem(nWhich), mnValue(nVal)
+ SfxPoolItem(nWhich, SfxItemType::SfxInt64ItemType), mnValue(nVal)
{
}
diff --git a/svl/source/items/intitem.cxx b/svl/source/items/intitem.cxx
index 0ced3eb20146..9a56bdda68af 100644
--- a/svl/source/items/intitem.cxx
+++ b/svl/source/items/intitem.cxx
@@ -159,8 +159,8 @@ boost::property_tree::ptree SfxUInt32Item::dumpAsJSON() const
return aTree;
}
-SfxMetricItem::SfxMetricItem(sal_uInt16 which, sal_Int32 nValue):
- SfxInt32Item(which, nValue)
+SfxMetricItem::SfxMetricItem(sal_uInt16 which, sal_Int32 nValue,SfxItemType eItemType):
+ SfxInt32Item(which, nValue, eItemType)
{
}
diff --git a/svl/source/items/itemset.cxx b/svl/source/items/itemset.cxx
index fd9cbb1dddee..acc5d64ea50a 100644
--- a/svl/source/items/itemset.cxx
+++ b/svl/source/items/itemset.cxx
@@ -61,7 +61,7 @@ static bool g_bItemClassicMode(getenv("ITEM_CLASSIC_MODE"));
SfxPoolItemHolder::SfxPoolItemHolder()
: m_pPool(nullptr)
, m_pItem(nullptr)
-#ifdef DBG_UTIL
+#ifndef NDEBUG
, m_bDeleted(false)
#endif
{
diff --git a/svl/source/items/lckbitem.cxx b/svl/source/items/lckbitem.cxx
index 87165ae50756..2affcdceca36 100644
--- a/svl/source/items/lckbitem.cxx
+++ b/svl/source/items/lckbitem.cxx
@@ -28,6 +28,7 @@ SfxPoolItem* SfxLockBytesItem::CreateDefault() { return new SfxLockBytesItem; }
SfxLockBytesItem::SfxLockBytesItem()
+ : SfxPoolItem(0, SfxItemType::SfxLockBytesItemType)
{
}
diff --git a/svl/source/items/poolitem.cxx b/svl/source/items/poolitem.cxx
index ae7c97136c48..d8395c836592 100644
--- a/svl/source/items/poolitem.cxx
+++ b/svl/source/items/poolitem.cxx
@@ -488,9 +488,10 @@ void listAllocatedSfxPoolItems()
}
#endif
-SfxPoolItem::SfxPoolItem(sal_uInt16 const nWhich)
+SfxPoolItem::SfxPoolItem(sal_uInt16 const nWhich, SfxItemType eType)
: m_nRefCount(0)
, m_nWhich(nWhich)
+ , m_eItemType(eType)
#ifdef DBG_UTIL
, m_nSerialNumber(nUsedSfxPoolItemCount)
#endif
@@ -524,11 +525,10 @@ SfxPoolItem::~SfxPoolItem()
bool SfxPoolItem::operator==(const SfxPoolItem& rCmp) const
{
- SAL_WARN_IF(typeid(rCmp) != typeid(*this), "svl",
+ SAL_WARN_IF(rCmp.ItemType() != ItemType(), "svl",
"comparing different pool item subclasses " << typeid(rCmp).name() << " && "
<< typeid(*this).name());
- assert(typeid(rCmp) == typeid(*this) && "comparing different pool item subclasses");
- (void)rCmp;
+ assert(rCmp.ItemType() == ItemType() && "comparing different pool item subclasses");
return true;
}
@@ -656,10 +656,8 @@ bool SfxPoolItem::areSame(const SfxPoolItem* pItem1, const SfxPoolItem* pItem2)
// WhichIDs differ (fast)
return false;
- if (typeid(*pItem1) != typeid(*pItem2))
+ if (pItem1->ItemType() != pItem2->ItemType())
// types differ (fast)
- // NOTE: we can now use typeid since we do not have (-1)
- // anymore for Invalid state -> safe
return false;
// return content compare using operator== at last
@@ -678,10 +676,8 @@ bool SfxPoolItem::areSame(const SfxPoolItem& rItem1, const SfxPoolItem& rItem2)
// WhichIDs differ (fast)
return false;
- if (typeid(rItem1) != typeid(rItem2))
+ if (rItem1.ItemType() != rItem2.ItemType())
// types differ (fast)
- // NOTE: we can now use typeid since we do not have (-1)
- // anymore for Invalid state -> safe
return false;
// return content compare using operator== at last
@@ -694,6 +690,15 @@ class InvalidItem final : public SfxPoolItem
{
virtual bool operator==(const SfxPoolItem&) const override { return true; }
virtual SfxPoolItem* Clone(SfxItemPool*) const override { return nullptr; }
+
+public:
+ // make it StaticDefaultItem to process similar to these
+ // which is plausible (never change and are not allowed to)
+ InvalidItem()
+ : SfxPoolItem(0, SfxItemType::InvalidOrDisabledItemType)
+ {
+ setStaticDefault();
+ }
};
InvalidItem aInvalidItem;
}
diff --git a/svl/source/items/ptitem.cxx b/svl/source/items/ptitem.cxx
index 361cb4f4fc7d..71ac1205b682 100644
--- a/svl/source/items/ptitem.cxx
+++ b/svl/source/items/ptitem.cxx
@@ -35,12 +35,13 @@ SfxPoolItem* SfxPointItem::CreateDefault() { return new SfxPointItem; }
SfxPointItem::SfxPointItem()
+ : SfxPoolItem(0, SfxItemType::SfxPointItemType)
{
}
SfxPointItem::SfxPointItem( sal_uInt16 nW, const Point& rVal ) :
- SfxPoolItem( nW ),
+ SfxPoolItem( nW, SfxItemType::SfxPointItemType ),
aVal( rVal )
{
}
diff --git a/svl/source/items/rectitem.cxx b/svl/source/items/rectitem.cxx
index f6a5db309d4b..cd9eecdf672a 100644
--- a/svl/source/items/rectitem.cxx
+++ b/svl/source/items/rectitem.cxx
@@ -31,12 +31,13 @@ SfxPoolItem* SfxRectangleItem::CreateDefault() { return new SfxRectangleItem; }
SfxRectangleItem::SfxRectangleItem()
+ : SfxPoolItem( 0, SfxItemType::SfxRectangleItemType )
{
}
SfxRectangleItem::SfxRectangleItem( sal_uInt16 nW, const tools::Rectangle& rVal ) :
- SfxPoolItem( nW ),
+ SfxPoolItem( nW, SfxItemType::SfxRectangleItemType ),
maVal( rVal )
{
}
diff --git a/svl/source/items/rngitem.cxx b/svl/source/items/rngitem.cxx
index 89f7e642ed50..d7e6bff5cbb4 100644
--- a/svl/source/items/rngitem.cxx
+++ b/svl/source/items/rngitem.cxx
@@ -23,7 +23,7 @@
SfxRangeItem::SfxRangeItem( sal_uInt16 which, sal_uInt16 from, sal_uInt16 to ):
- SfxPoolItem( which ),
+ SfxPoolItem( which, SfxItemType::SfxRangeItemType ),
nFrom( from ),
nTo( to )
{
diff --git a/svl/source/items/sitem.cxx b/svl/source/items/sitem.cxx
index 037097f7bc3a..0e4499b55ab4 100644
--- a/svl/source/items/sitem.cxx
+++ b/svl/source/items/sitem.cxx
@@ -24,8 +24,9 @@
#include <svl/setitem.hxx>
#include <svl/poolitem.hxx>
-SfxSetItem::SfxSetItem( sal_uInt16 which, const SfxItemSet &rSet) :
- SfxPoolItem(which),
+SfxSetItem::SfxSetItem( sal_uInt16 which, const SfxItemSet &rSet,
+ SfxItemType eItemType) :
+ SfxPoolItem(which, eItemType),
maSet(rSet)
{
assert(!dynamic_cast<const SfxAllItemSet*>(&rSet) && "cannot handle SfxAllItemSet here");
@@ -33,8 +34,9 @@ SfxSetItem::SfxSetItem( sal_uInt16 which, const SfxItemSet &rSet) :
}
-SfxSetItem::SfxSetItem( sal_uInt16 which, SfxItemSet &&pS) :
- SfxPoolItem(which),
+SfxSetItem::SfxSetItem( sal_uInt16 which, SfxItemSet &&pS,
+ SfxItemType eItemType) :
+ SfxPoolItem(which, eItemType),
maSet(pS)
{
assert(!dynamic_cast<SfxAllItemSet*>(&pS) && "cannot handle SfxAllItemSet here");
diff --git a/svl/source/items/slstitm.cxx b/svl/source/items/slstitm.cxx
index 02784446ca52..1141784397b1 100644
--- a/svl/source/items/slstitm.cxx
+++ b/svl/source/items/slstitm.cxx
@@ -29,13 +29,14 @@
SfxPoolItem* SfxStringListItem::CreateDefault() { return new SfxStringListItem; }
-SfxStringListItem::SfxStringListItem()
+SfxStringListItem::SfxStringListItem() :
+ SfxPoolItem( 0, SfxItemType::SfxStringListItemType )
{
}
SfxStringListItem::SfxStringListItem( sal_uInt16 which, const std::vector<OUString>* pList ) :
- SfxPoolItem( which )
+ SfxPoolItem( which, SfxItemType::SfxStringListItemType )
{
// FIXME: Putting an empty list does not work
// Therefore the query after the count is commented out
diff --git a/svl/source/items/srchitem.cxx b/svl/source/items/srchitem.cxx
index 6aa7c36ddca2..2a31c7d6af4b 100644
--- a/svl/source/items/srchitem.cxx
+++ b/svl/source/items/srchitem.cxx
@@ -99,7 +99,7 @@ static Sequence< OUString > lcl_GetNotifyNames()
SvxSearchItem::SvxSearchItem( const sal_uInt16 nId ) :
- SfxPoolItem( nId ),
+ SfxPoolItem( nId, SfxItemType::SvxSearchItemType ),
ConfigItem( CFG_ROOT_NODE ),
m_aSearchOpt ( SearchFlags::LEV_RELAXED,
diff --git a/svl/source/items/voiditem.cxx b/svl/source/items/voiditem.cxx
index 32057e1e2c75..b12ef1710c90 100644
--- a/svl/source/items/voiditem.cxx
+++ b/svl/source/items/voiditem.cxx
@@ -23,13 +23,13 @@
SfxPoolItem* SfxVoidItem::CreateDefault() { return new SfxVoidItem(0); }
SfxVoidItem::SfxVoidItem(sal_uInt16 which)
- : SfxPoolItem(which)
+ : SfxPoolItem(which, SfxItemType::SfxVoidItemType)
{
setIsVoidItem();
}
SfxVoidItem::SfxVoidItem(const SfxVoidItem& rCopy)
- : SfxPoolItem(rCopy.Which())
+ : SfxPoolItem(rCopy.Which(), SfxItemType::SfxVoidItemType)
{
setIsVoidItem();
}