summaryrefslogtreecommitdiffstats
path: root/include/svl/itemiter.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/itemiter.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/itemiter.hxx')
-rw-r--r--include/svl/itemiter.hxx32
1 files changed, 12 insertions, 20 deletions
diff --git a/include/svl/itemiter.hxx b/include/svl/itemiter.hxx
index 30b6bd13d00d..b68730f245d6 100644
--- a/include/svl/itemiter.hxx
+++ b/include/svl/itemiter.hxx
@@ -21,6 +21,7 @@
#include <svl/svldllapi.h>
#include <svl/itemset.hxx>
+#include <vector>
class SfxPoolItem;
class SfxItemSet;
@@ -28,32 +29,23 @@ class SfxItemPool;
class SVL_DLLPUBLIC SfxItemIter
{
- const SfxItemSet& m_rSet;
- sal_uInt16 m_nStart;
- sal_uInt16 m_nEnd;
- sal_uInt16 m_nCurrent;
+ const SfxItemSet& m_rSet;
+ std::vector<sal_uInt16> m_keys;
+ std::vector<sal_uInt16>::const_iterator m_iter;
public:
SfxItemIter( const SfxItemSet& rSet );
~SfxItemIter();
/// get item, or null if no items
- const SfxPoolItem* FirstItem()
- {
- m_nCurrent = m_nStart;
- return m_rSet.m_nCount ? *(m_rSet.m_pItems + m_nCurrent) : nullptr;
- }
- const SfxPoolItem* GetCurItem()
- {
- return m_rSet.m_nCount ? *(m_rSet.m_pItems + m_nCurrent) : nullptr;
- }
- const SfxPoolItem* NextItem();
-
- bool IsAtEnd() const { return m_nCurrent == m_nEnd; }
-
- sal_uInt16 GetCurPos() const { return m_nCurrent; }
- sal_uInt16 GetFirstPos() const { return m_nStart; }
- sal_uInt16 GetLastPos() const { return m_nEnd; }
+ SfxPoolItem const * FirstItem();
+ SfxPoolItem const * GetCurItem();
+ SfxPoolItem const * NextItem();
+
+ bool IsAtEnd() const;
+ sal_uInt16 GetCurWhich() const { return *m_iter; }
+ sal_uInt16 GetFirstWhich() const { return *m_keys.begin(); }
+ sal_uInt16 GetLastWhich() const { return *m_keys.rbegin(); }
};
#endif