diff options
author | Luboš Luňák <l.lunak@collabora.com> | 2022-01-07 12:43:48 +0100 |
---|---|---|
committer | Luboš Luňák <l.lunak@collabora.com> | 2022-01-09 15:43:53 +0100 |
commit | dd6ff1fd7fea0cfae75e5f65afed9d5f871d1313 (patch) | |
tree | 929b067780680b173ce7592c0042b493ef66fb83 /include/svx/sdasitm.hxx | |
parent | 9ba45189c76373d0464cc06902270914888162a3 (diff) |
implement anyToHash() and use it for SdrCustomShapeGeometryItem
Using anyLess() still has quite some cost with bsc#1183308, this
makes the cost almost unnoticeable.
Since some values of Any are not handled, return empty std::optional
for those cases.
Change-Id: Ib45a81441e8bb456c4749f9bc53a981f09bbb1a5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128109
Tested-by: Jenkins
Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
Diffstat (limited to 'include/svx/sdasitm.hxx')
-rw-r--r-- | include/svx/sdasitm.hxx | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/include/svx/sdasitm.hxx b/include/svx/sdasitm.hxx index ebd022980e6e..f5c381167396 100644 --- a/include/svx/sdasitm.hxx +++ b/include/svx/sdasitm.hxx @@ -48,7 +48,15 @@ private: css::uno::Sequence< css::beans::PropertyValue > aPropSeq; + // For fast comparisons keep a hash of the content, computed on demand + // (unusable state is if anyToHash() returns no hash). + enum HashState { Unknown, Valid, Unusable }; + mutable HashState aHashState = HashState::Unknown; + mutable size_t aHash; + void SetPropSeq( const css::uno::Sequence< css::beans::PropertyValue >& rPropSeq ); + inline void UpdateHash() const; + inline void InvalidateHash(); public: |