summaryrefslogtreecommitdiffstats
path: root/include/svl/itemset.hxx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-01-23 10:38:15 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-01-23 13:19:56 +0200
commit00aa9f622c29aecc6bb9c5ee4b3aa35a9afb095d (patch)
tree6b10baae17781ad810d0f7b7c08cc30945fa6246 /include/svl/itemset.hxx
parentfix ubuntu trusty build (diff)
downloadcore-00aa9f622c29aecc6bb9c5ee4b3aa35a9afb095d.tar.gz
core-00aa9f622c29aecc6bb9c5ee4b3aa35a9afb095d.zip
Revert "used std::map in SfxItemSet"
This reverts commit 2757ee9fe610e253e4ccc37423fa420004d0f388. Besides causing a performance regression, I now notice that there is code in SW that relies on iterating over two different SfxItemSet's in parallel, and assumes that missing items are returned as nullptr, which is not the case for my std::map based change. Change-Id: I2b1110350fe4c4b74e5508558e9661ef1e1a103e
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 8c1ebd5b8109..dccebd2b23b3 100644
--- a/include/svl/itemset.hxx
+++ b/include/svl/itemset.hxx
@@ -23,13 +23,12 @@
#include <cstdarg>
#include <svl/poolitem.hxx>
-#include <map>
class SfxItemPool;
class SfxPoolItem;
class SvStream;
-typedef std::map<sal_uInt16, SfxPoolItem const *> SfxItemMap;
+typedef SfxPoolItem const** SfxItemArray;
class SAL_WARN_UNUSED SVL_DLLPUBLIC SfxItemSet
{
@@ -37,8 +36,9 @@ class SAL_WARN_UNUSED SVL_DLLPUBLIC SfxItemSet
SfxItemPool* m_pPool; ///< pool that stores the items
const SfxItemSet* m_pParent; ///< derivation
- SfxItemMap m_aItems; ///< array of items
+ SfxItemArray m_pItems; ///< 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:
- SfxItemMap const & GetItems_Impl() const { return m_aItems; }
+ SfxItemArray GetItems_Impl() const { return m_pItems; }
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_aItems.size(); }
+ sal_uInt16 Count() const { return m_nCount; }
sal_uInt16 TotalCount() const;
const SfxPoolItem& Get( sal_uInt16 nWhich, bool bSrchInParent = true ) const;