summaryrefslogtreecommitdiff
path: root/sc/inc/interpretercontext.hxx
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@collabora.com>2018-10-01 14:26:57 +0200
committerLuboš Luňák <l.lunak@collabora.com>2018-10-10 13:01:59 +0200
commit79449d73900d7a9bf061244d76f5f8eecc441198 (patch)
treee85f9bc29941cbf5e5ccb858ee4703ae67d00810 /sc/inc/interpretercontext.hxx
parentb1721b04d8a921a69230927cd7995d8c5d8f5fe2 (diff)
make VLOOKUP in Calc thread-safe
There is mutex protection needed for accessing the same SvtBroadcaster when calling StartListeningArea(). Also some of the memory management and caching needed fixing. Change-Id: Ia57ed85286cf195521719cfd3b320f73a6342bb1 Reviewed-on: https://gerrit.libreoffice.org/61187 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
Diffstat (limited to 'sc/inc/interpretercontext.hxx')
-rw-r--r--sc/inc/interpretercontext.hxx10
1 files changed, 4 insertions, 6 deletions
diff --git a/sc/inc/interpretercontext.hxx b/sc/inc/interpretercontext.hxx
index 8b920472fb44..2855370e7b09 100644
--- a/sc/inc/interpretercontext.hxx
+++ b/sc/inc/interpretercontext.hxx
@@ -18,6 +18,7 @@
class ScDocument;
class SvNumberFormatter;
+struct ScLookupCacheMap;
// SetNumberFormat() is not thread-safe, so calls to it need to be delayed to the main thread.
struct DelayedSetNumberFormat
@@ -33,21 +34,18 @@ struct ScInterpreterContext
size_t mnTokenCachePos;
std::vector<formula::FormulaToken*> maTokens;
std::vector<DelayedSetNumberFormat> maDelayedSetNumberFormat;
+ ScLookupCacheMap* mScLookupCache; // cache for lookups like VLOOKUP and MATCH
ScInterpreterContext(const ScDocument& rDoc, SvNumberFormatter* pFormatter)
: mrDoc(rDoc)
, mpFormatter(pFormatter)
, mnTokenCachePos(0)
, maTokens(TOKEN_CACHE_SIZE, nullptr)
+ , mScLookupCache(nullptr)
{
}
- ~ScInterpreterContext()
- {
- for (auto p : maTokens)
- if (p)
- p->DecRef();
- }
+ ~ScInterpreterContext();
SvNumberFormatter* GetFormatTable() const { return mpFormatter; }
};