summaryrefslogtreecommitdiff
path: root/include/svl/itemiter.hxx
diff options
context:
space:
mode:
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