diff options
author | Luboš Luňák <l.lunak@collabora.com> | 2021-11-22 13:16:43 +0100 |
---|---|---|
committer | Luboš Luňák <l.lunak@collabora.com> | 2021-11-22 15:46:46 +0100 |
commit | 1a32af4192291ea5cfe7c4c143144a5dab1f156e (patch) | |
tree | fd03edb4401e53efe314c38c21ec2e480844d2b4 /sc/inc/table.hxx | |
parent | 2de99501b7d7b32867d23d4089197e132c6a0526 (diff) |
cache error strings for ScTable::validQuery() (tdf#133835)
Avoid calling SharedStringPool::intern() on values that are
repeatedly the same.
Change-Id: I094f2e777a4ca24536e0c25e6a1c6358ccf49f61
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125660
Tested-by: Jenkins
Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
Diffstat (limited to 'sc/inc/table.hxx')
-rw-r--r-- | sc/inc/table.hxx | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/sc/inc/table.hxx b/sc/inc/table.hxx index 40806e70f31a..332be67ee551 100644 --- a/sc/inc/table.hxx +++ b/sc/inc/table.hxx @@ -954,10 +954,17 @@ public: void Reorder( const sc::ReorderParam& rParam ); + // Internal cache that can be repeatedly used for a sequence of related ValidQuery() + // calls (related meaning done in a loop for the same document and query data). + struct ValidQueryCache + { + std::unordered_map<FormulaError, svl::SharedString> mCachedSharedErrorStrings; + }; bool ValidQuery( SCROW nRow, const ScQueryParam& rQueryParam, const ScRefCellValue* pCell = nullptr, bool* pbTestEqualCondition = nullptr, const ScInterpreterContext* pContext = nullptr, - sc::TableColumnBlockPositionSet* pBlockPos = nullptr ); + sc::TableColumnBlockPositionSet* pBlockPos = nullptr, + ValidQueryCache* pQueryCache = nullptr ); void TopTenQuery( ScQueryParam& ); void PrepareQuery( ScQueryParam& rQueryParam ); SCSIZE Query(const ScQueryParam& rQueryParam, bool bKeepSub); |