diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-05-26 15:19:42 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-05-28 16:00:09 +0200 |
commit | 87a932120d5f146933ed3bcc16c0f47dab90fd4b (patch) | |
tree | 6022b3ff930f5931c39ff29f47259ffc704f4dd5 /include/svl/itemset.hxx | |
parent | 9ea767cb568cef1b142190d2adb0e301baa382e2 (diff) |
ofz#24932-1 speed up GetItemState when iterating
by having SfxWhichIter track the current position in
the m_ppItems table, which means GetItemState does
not need to traverse the ranges table to find the
item position.
shaves 75% off the time of
./instdir/program/soffice.bin --calc --convert-to pdf
~/Downloads/ofz24932-1.rtf
Change-Id: Ib5fe61c75ca05bc2f1932e84b57ccfa55f8b7f74
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135023
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'include/svl/itemset.hxx')
-rw-r--r-- | include/svl/itemset.hxx | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/include/svl/itemset.hxx b/include/svl/itemset.hxx index 7b535fb93d6f..746ba8448afb 100644 --- a/include/svl/itemset.hxx +++ b/include/svl/itemset.hxx @@ -23,6 +23,7 @@ #include <cassert> #include <cstddef> #include <memory> +#include <optional> #include <utility> #include <svl/svldllapi.h> @@ -35,6 +36,7 @@ class SfxItemPool; class SAL_WARN_UNUSED SVL_DLLPUBLIC SfxItemSet { friend class SfxItemIter; + friend class SfxWhichIter; SfxItemPool* m_pPool; ///< pool that stores the items const SfxItemSet* m_pParent; ///< derivation @@ -223,6 +225,12 @@ public: bool Equals(const SfxItemSet &, bool bComparePool) const; void dumpAsXml(xmlTextWriterPtr pWriter) const; + +private: + SfxItemState GetItemStateImpl( sal_uInt16 nWhich, + bool bSrchInParent, + const SfxPoolItem **ppItem, + std::optional<sal_uInt16> oItemsOffsetHint) const; }; inline void SfxItemSet::SetParent( const SfxItemSet* pNew ) |