diff options
Diffstat (limited to 'sc/inc/document.hxx')
-rw-r--r-- | sc/inc/document.hxx | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx index a497bf3f178c..7b0bc83f141f 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 nMacroInterpretLevel; // >0 if macro in interpreter sal_uInt16 nInterpreterTableOpLevel; // >0 if in interpreter TableOp ScRecursionHelper* pRecursionHelper; // information for recursive and iterative cell formulas @@ -284,7 +283,6 @@ struct ScDocumentThreadSpecific ScLookupCacheMapImpl* pLookupCacheMapImpl; // cache for lookups like VLOOKUP and MATCH ScDocumentThreadSpecific() : - nMacroInterpretLevel(0), nInterpreterTableOpLevel(0), pRecursionHelper(nullptr), pLookupCacheMapImpl(nullptr) @@ -453,6 +451,7 @@ 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 + sal_uInt16 nMacroInterpretLevel; // >0 if macro in interpreter ScDocumentThreadSpecific maNonThreaded; @@ -2192,9 +2191,19 @@ public: if ( nInterpretLevel ) nInterpretLevel--; } - sal_uInt16 GetMacroInterpretLevel(); - void IncMacroInterpretLevel(); - void DecMacroInterpretLevel(); + sal_uInt16 GetMacroInterpretLevel() { return nMacroInterpretLevel; } + void IncMacroInterpretLevel() + { + assert(!mbThreadedGroupCalcInProgress); + if ( nMacroInterpretLevel < USHRT_MAX ) + nMacroInterpretLevel++; + } + void DecMacroInterpretLevel() + { + assert(!mbThreadedGroupCalcInProgress); + if ( nMacroInterpretLevel ) + nMacroInterpretLevel--; + } bool IsInInterpreterTableOp() const; void IncInterpreterTableOpLevel(); void DecInterpreterTableOpLevel(); |