diff options
author | Luboš Luňák <l.lunak@collabora.com> | 2018-06-11 10:28:28 +0200 |
---|---|---|
committer | Luboš Luňák <l.lunak@collabora.com> | 2018-06-15 15:12:15 +0200 |
commit | dc046b7367bf2bcb5b3b883731723da7c92f4cca (patch) | |
tree | e1e7b9552e004e9cdb918dfb108ad5838bdf7e86 /sc/inc/interpretercontext.hxx | |
parent | 7ad1c45c3ef07147681c9f084ae2d0936a2438fe (diff) |
move SetNumberFormat() calls out of calc threads
As it modifies ScAttrArray, which is not thread-safe (has std::vector
per each column, so multiple threads may try resize it etc.). So if
threaded calculation is done, delay the calls to the main thread.
Change-Id: I3d87665c0dd0d40f0c2efbcf8958240ee5580233
Reviewed-on: https://gerrit.libreoffice.org/55602
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Tested-by: Jenkins
Diffstat (limited to 'sc/inc/interpretercontext.hxx')
-rw-r--r-- | sc/inc/interpretercontext.hxx | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/sc/inc/interpretercontext.hxx b/sc/inc/interpretercontext.hxx index d2b6814fad6e..8b920472fb44 100644 --- a/sc/inc/interpretercontext.hxx +++ b/sc/inc/interpretercontext.hxx @@ -12,18 +12,27 @@ #include <vector> #include <formula/token.hxx> +#include "types.hxx" #define TOKEN_CACHE_SIZE 8 class ScDocument; class SvNumberFormatter; +// SetNumberFormat() is not thread-safe, so calls to it need to be delayed to the main thread. +struct DelayedSetNumberFormat +{ + SCROW mRow; // Used only with formula groups, so column and tab do not need to be stored. + sal_uInt32 mnNumberFormat; +}; + struct ScInterpreterContext { const ScDocument& mrDoc; SvNumberFormatter* mpFormatter; size_t mnTokenCachePos; std::vector<formula::FormulaToken*> maTokens; + std::vector<DelayedSetNumberFormat> maDelayedSetNumberFormat; ScInterpreterContext(const ScDocument& rDoc, SvNumberFormatter* pFormatter) : mrDoc(rDoc) |