summaryrefslogtreecommitdiffstats
path: root/include/svl/itemset.hxx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-01-09 10:27:22 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-01-17 10:07:10 +0200
commit2757ee9fe610e253e4ccc37423fa420004d0f388 (patch)
treea5a505f12a1c17cfab2001c2cbf43bd721633f0f /include/svl/itemset.hxx
parentuse rtl::Reference in OInstanceLocker (diff)
downloadcore-2757ee9fe610e253e4ccc37423fa420004d0f388.tar.gz
core-2757ee9fe610e253e4ccc37423fa420004d0f388.zip
used std::map in SfxItemSet
instead of naked array SfxItemIter ended up needing to take copies of stuff because various code likes to iterate over the items and delete items inside the loop. The gdb pretty printer is no longer quite as pretty as it was before, but it still prints useful info. Change-Id: I59b07ea42f6b1c74798a15402970b9dbd8233dbe
Diffstat (limited to 'include/svl/itemset.hxx')
-rw-r--r--include/svl/itemset.hxx10
1 files changed, 5 insertions, 5 deletions
diff --git a/include/svl/itemset.hxx b/include/svl/itemset.hxx
index f327f92792eb..502c0ebc2c99 100644
--- a/include/svl/itemset.hxx
+++ b/include/svl/itemset.hxx
@@ -23,12 +23,13 @@
#include <cstdarg>
#include <svl/poolitem.hxx>
+#include <map>
class SfxItemPool;
class SfxPoolItem;
class SvStream;
-typedef SfxPoolItem const** SfxItemArray;
+typedef std::map<sal_uInt16, SfxPoolItem const *> SfxItemMap;
class SVL_DLLPUBLIC SfxItemSet
{
@@ -36,9 +37,8 @@ class SVL_DLLPUBLIC SfxItemSet
SfxItemPool* m_pPool; ///< pool that stores the items
const SfxItemSet* m_pParent; ///< derivation
- SfxItemArray m_pItems; ///< array of items
+ SfxItemMap m_aItems; ///< array of items
sal_uInt16* m_pWhichRanges; ///< array of Which Ranges
- sal_uInt16 m_nCount; ///< number of items
friend class SfxItemPoolCache;
friend class SfxAllItemSet;
@@ -50,7 +50,7 @@ private:
SVL_DLLPRIVATE void InitRanges_Impl(sal_uInt16 nWh1, sal_uInt16 nWh2);
public:
- SfxItemArray GetItems_Impl() const { return m_pItems; }
+ SfxItemMap const & GetItems_Impl() const { return m_aItems; }
private:
const SfxItemSet& operator=(const SfxItemSet &) = delete;
@@ -73,7 +73,7 @@ public:
virtual SfxItemSet * Clone(bool bItems = true, SfxItemPool *pToPool = nullptr) const;
// Get number of items
- sal_uInt16 Count() const { return m_nCount; }
+ sal_uInt16 Count() const { return m_aItems.size(); }
sal_uInt16 TotalCount() const;
const SfxPoolItem& Get( sal_uInt16 nWhich, bool bSrchInParent = true ) const;