diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2024-03-28 14:51:31 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2024-03-29 17:59:45 +0100 |
commit | 117f4c05614a5c3f5d0495dab553f76a173dbeea (patch) | |
tree | 255854170bfd3a5b40901828004f2fd9b76cb4e8 /include/svl | |
parent | b6fdbbc1622a929e2699a67496a38431652eebdf (diff) |
speed up ScPatternAttr
we know that ScPatternAttr uses a single, contiguous range of
item ids, so we can compute the item offset at compile time.
Shaves 1-2% off some workloads.
Change-Id: I623b8cb3e0d5d070118117196d2b48575f505725
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165550
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'include/svl')
-rw-r--r-- | include/svl/itemset.hxx | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/include/svl/itemset.hxx b/include/svl/itemset.hxx index 3f1d3b2fd0e2..df0ffdcfd861 100644 --- a/include/svl/itemset.hxx +++ b/include/svl/itemset.hxx @@ -217,6 +217,10 @@ public: sal_uInt16 GetWhichByOffset(sal_uInt16 nOffset) const; + // Optimised variant for those situations where we know exactly what our which ranges are, + // and we can determine the offset at compile time. + const SfxPoolItem& GetByOffset(sal_uInt16 nWhich, sal_uInt16 nOffset) const; + SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent = true, const SfxPoolItem **ppItem = nullptr) const { // use local helper, start value for looped-through SfxItemState value is SfxItemState::UNKNOWN |