sc/source/core/tool/interpretercontext.cxx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
New commits: commit f7f4b00185318c1f2949ca42316e1a92c57da23b Author: Eike Rathke <er...@redhat.com> AuthorDate: Sat Nov 12 21:12:18 2022 +0100 Commit: Caolán McNamara <caol...@redhat.com> CommitDate: Sun Nov 13 18:33:55 2022 +0100 Resolves: tdf#152014 When reusing interpreter context slot clear lookup cache ... if different doc As is, unthreaded the same slot gets reused for every calculation. That could benefit from keeping 2-3 documents cached to not throw away the lookup cache each time when alternating between documents. Change-Id: Id024333f72bcdcd6109042dec1104f3029955d3b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142639 Reviewed-by: Eike Rathke <er...@redhat.com> Tested-by: Jenkins (cherry picked from commit f86a0666ac337363b470c9c67fa0970a330b26a2) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142630 Reviewed-by: Caolán McNamara <caol...@redhat.com> diff --git a/sc/source/core/tool/interpretercontext.cxx b/sc/source/core/tool/interpretercontext.cxx index 0df4a8407c9c..e66a8b977446 100644 --- a/sc/source/core/tool/interpretercontext.cxx +++ b/sc/source/core/tool/interpretercontext.cxx @@ -53,7 +53,11 @@ void ScInterpreterContext::ResetTokens() void ScInterpreterContext::SetDocAndFormatter(const ScDocument& rDoc, SvNumberFormatter* pFormatter) { - mpDoc = &rDoc; + if (mpDoc != &rDoc) + { + mxScLookupCache.reset(); + mpDoc = &rDoc; + } mpFormatter = pFormatter; }