summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolan.mcnamara@collabora.com>2024-03-01 11:23:59 +0000
committerCaolán McNamara <caolan.mcnamara@collabora.com>2024-03-02 21:54:47 +0100
commit8f70b99b4dd162df7a6a124ccd53f3814ff10b00 (patch)
tree66daf7ea8ee48c4fc4e5e66d847f8fb042848a1a
parent2c3605405225de4b850064cf25b15cd64be1409b (diff)
if the formatter was to change, then the cache should be dropped
Change-Id: I98edea680f5300c4375168391627ac654ea3779c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164228 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
-rw-r--r--sc/source/core/tool/interpretercontext.cxx8
1 files changed, 7 insertions, 1 deletions
diff --git a/sc/source/core/tool/interpretercontext.cxx b/sc/source/core/tool/interpretercontext.cxx
index 03d5036b6e63..ef9e1f3947bf 100644
--- a/sc/source/core/tool/interpretercontext.cxx
+++ b/sc/source/core/tool/interpretercontext.cxx
@@ -58,11 +58,17 @@ void ScInterpreterContext::SetDocAndFormatter(const ScDocument& rDoc, SvNumberFo
mxScLookupCache.reset();
mpDoc = &rDoc;
}
- mpFormatter = pFormatter;
+ if (mpFormatter != pFormatter)
+ {
+ maNFBuiltInCache.clear();
+ maNFTypeCache.clear();
+ mpFormatter = pFormatter;
+ }
}
void ScInterpreterContext::initFormatTable()
{
+ assert(!mpFormatter && maNFBuiltInCache.empty() && maNFTypeCache.empty());
mpFormatter = mpDoc->GetFormatTable(); // will assert if not main thread
}