diff options
author | Tor Lillqvist <tml@collabora.com> | 2017-09-29 14:26:29 +0300 |
---|---|---|
committer | Dennis Francis <dennis.francis@collabora.co.uk> | 2017-11-21 16:09:42 +0530 |
commit | d45371f4ce212c79f70c75d056b1fd8e6377f722 (patch) | |
tree | 97f38e9e66d914a4630e9b639058a12f69961de0 /sc/inc | |
parent | 9732f2b1588e2686f5bdec416972c1686289b635 (diff) |
Move nInterpretLevel back to ScDocument
Move the calls to increment and decrement it out of InterpretTail(),
to those call sites that aren't reached during parallelized
calculations. Use unique_ptr for pInt in StackCleaner
Change-Id: Ie1bd03dd62aea5f6c71c383df21afff29391dade
Diffstat (limited to 'sc/inc')
-rw-r--r-- | sc/inc/document.hxx | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx index fd13f36d22ee..a497bf3f178c 100644 --- a/sc/inc/document.hxx +++ b/sc/inc/document.hxx @@ -276,7 +276,6 @@ const sal_uInt8 SC_DDE_IGNOREMODE = 255; /// For usage in FindDdeLink() // During threaded calculation fields being mutated are kept in this struct struct ScDocumentThreadSpecific { - sal_uInt16 nInterpretLevel; // >0 if in interpreter sal_uInt16 nMacroInterpretLevel; // >0 if macro in interpreter sal_uInt16 nInterpreterTableOpLevel; // >0 if in interpreter TableOp @@ -285,7 +284,6 @@ struct ScDocumentThreadSpecific ScLookupCacheMapImpl* pLookupCacheMapImpl; // cache for lookups like VLOOKUP and MATCH ScDocumentThreadSpecific() : - nInterpretLevel(0), nMacroInterpretLevel(0), nInterpreterTableOpLevel(0), pRecursionHelper(nullptr), @@ -454,6 +452,8 @@ private: sal_uLong nFormulaCodeInTree; // formula RPN in the formula tree sal_uLong nXMLImportedFormulaCount; // progress count during XML import + sal_uInt16 nInterpretLevel; // >0 if in interpreter + ScDocumentThreadSpecific maNonThreaded; // There can be only one ScDocument being calculated in a thread at a time, so we can use a @@ -2178,9 +2178,20 @@ public: void SetForcedFormulas( bool bVal ) { bHasForcedFormulas = bVal; } sal_uLong GetFormulaCodeInTree() const { return nFormulaCodeInTree; } - bool IsInInterpreter() const; - void IncInterpretLevel(); - void DecInterpretLevel(); + bool IsInInterpreter() const { return nInterpretLevel != 0; } + + void IncInterpretLevel() + { + assert(!mbThreadedGroupCalcInProgress); + if ( nInterpretLevel < USHRT_MAX ) + nInterpretLevel++; + } + void DecInterpretLevel() + { + assert(!mbThreadedGroupCalcInProgress); + if ( nInterpretLevel ) + nInterpretLevel--; + } sal_uInt16 GetMacroInterpretLevel(); void IncMacroInterpretLevel(); void DecMacroInterpretLevel(); |