diff options
author | Caolán McNamara <caolan.mcnamara@collabora.com> | 2024-03-28 09:55:06 +0000 |
---|---|---|
committer | Caolán McNamara <caolan.mcnamara@collabora.com> | 2024-03-29 09:51:12 +0100 |
commit | e8e0a3b1d7e706330ca343cf9dd5ba062e9ff0c4 (patch) | |
tree | 544402e3766feec77b0a717b45a43946da8f9ff2 /sc/source/core | |
parent | 40176bd39c94c32ac0269d9994e8e50518d84467 (diff) |
crashtesting: fix SvNFEngine::CacheFormatRO assert
since:
commit c6c6126aa3e8de256091b829b98b5943db6a8be6
Author: Caolán McNamara <caolan.mcnamara@collabora.com>
Date: Thu Mar 21 17:25:35 2024 +0000
Related: tdf#160056 refactor SvNumberFormatter
to split it into two constituent parts
Change-Id: I4add9f383789ab03ceab751b07973448a41911ba
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165490
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Diffstat (limited to 'sc/source/core')
-rw-r--r-- | sc/source/core/data/document.cxx | 1 | ||||
-rw-r--r-- | sc/source/core/tool/interpretercontext.cxx | 15 |
2 files changed, 13 insertions, 3 deletions
diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx index 04370b62117f..e87d100b36da 100644 --- a/sc/source/core/data/document.cxx +++ b/sc/source/core/data/document.cxx @@ -6929,6 +6929,7 @@ void ScDocument::MergeContextBackIntoNonThreadedContext(ScInterpreterContext& th std::make_move_iterator(threadedContext.maDelayedSetNumberFormat.begin()), std::make_move_iterator(threadedContext.maDelayedSetNumberFormat.end())); // lookup cache is now only in pooled ScInterpreterContext's + threadedContext.MergeDefaultFormatKeys(*GetFormatTable()); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/core/tool/interpretercontext.cxx b/sc/source/core/tool/interpretercontext.cxx index f4fde3725414..e1fc5fb24252 100644 --- a/sc/source/core/tool/interpretercontext.cxx +++ b/sc/source/core/tool/interpretercontext.cxx @@ -46,8 +46,9 @@ ScInterpreterContext::ScInterpreterContext(const ScDocument& rDoc, SvNumberForma else { mxLanguageData.reset(new SvNFLanguageData(pFormatter->GetROLanguageData())); + mxAuxFormatKeyMap.reset(new SvNFFormatData::DefaultFormatKeysMap); mpFormatData = &pFormatter->GetROFormatData(); - maROPolicy = SvNFEngine::GetROPolicy(*mpFormatData); + maROPolicy = SvNFEngine::GetROPolicy(*mpFormatData, *mxAuxFormatKeyMap); } } @@ -74,8 +75,9 @@ void ScInterpreterContext::SetDocAndFormatter(const ScDocument& rDoc, SvNumberFo { // formatter has changed mxLanguageData.reset(new SvNFLanguageData(pFormatter->GetROLanguageData())); + mxAuxFormatKeyMap.reset(new SvNFFormatData::DefaultFormatKeysMap); mpFormatData = &pFormatter->GetROFormatData(); - maROPolicy = SvNFEngine::GetROPolicy(*mpFormatData); + maROPolicy = SvNFEngine::GetROPolicy(*mpFormatData, *mxAuxFormatKeyMap); mpFormatter = pFormatter; // drop cache @@ -88,8 +90,14 @@ void ScInterpreterContext::initFormatTable() { mpFormatter = mpDoc->GetFormatTable(); // will assert if not main thread mpFormatData = &mpFormatter->GetROFormatData(); - maROPolicy = SvNFEngine::GetROPolicy(*mpFormatData); mxLanguageData.reset(new SvNFLanguageData(mpFormatter->GetROLanguageData())); + mxAuxFormatKeyMap.reset(new SvNFFormatData::DefaultFormatKeysMap); + maROPolicy = SvNFEngine::GetROPolicy(*mpFormatData, *mxAuxFormatKeyMap); +} + +void ScInterpreterContext::MergeDefaultFormatKeys(SvNumberFormatter& rFormatter) const +{ + rFormatter.MergeDefaultFormatKeys(*mxAuxFormatKeyMap); } void ScInterpreterContext::Cleanup() @@ -106,6 +114,7 @@ void ScInterpreterContext::ClearLookupCache(const ScDocument* pDoc) { mxScLookupCache.reset(); mxLanguageData.reset(); + mxAuxFormatKeyMap.reset(); mpFormatter = nullptr; mpFormatData = nullptr; } |