summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sc/inc/document.hxx18
-rw-r--r--sc/source/core/data/documen2.cxx1
-rw-r--r--sc/source/core/data/document.cxx40
3 files changed, 13 insertions, 46 deletions
diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx
index 7b0bc83f141f..eef7c4c8df07 100644
--- a/sc/inc/document.hxx
+++ b/sc/inc/document.hxx
@@ -276,14 +276,11 @@ 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 nInterpreterTableOpLevel; // >0 if in interpreter TableOp
-
ScRecursionHelper* pRecursionHelper; // information for recursive and iterative cell formulas
ScLookupCacheMapImpl* pLookupCacheMapImpl; // cache for lookups like VLOOKUP and MATCH
ScDocumentThreadSpecific() :
- nInterpreterTableOpLevel(0),
pRecursionHelper(nullptr),
pLookupCacheMapImpl(nullptr)
{
@@ -452,6 +449,7 @@ private:
sal_uLong nXMLImportedFormulaCount; // progress count during XML import
sal_uInt16 nInterpretLevel; // >0 if in interpreter
sal_uInt16 nMacroInterpretLevel; // >0 if macro in interpreter
+ sal_uInt16 nInterpreterTableOpLevel; // >0 if in interpreter TableOp
ScDocumentThreadSpecific maNonThreaded;
@@ -2204,9 +2202,17 @@ public:
if ( nMacroInterpretLevel )
nMacroInterpretLevel--;
}
- bool IsInInterpreterTableOp() const;
- void IncInterpreterTableOpLevel();
- void DecInterpreterTableOpLevel();
+ bool IsInInterpreterTableOp() const { return nInterpreterTableOpLevel != 0; }
+ void IncInterpreterTableOpLevel()
+ {
+ if ( nInterpreterTableOpLevel < USHRT_MAX )
+ nInterpreterTableOpLevel++;
+ }
+ void DecInterpreterTableOpLevel()
+ {
+ if ( nInterpreterTableOpLevel )
+ nInterpreterTableOpLevel--;
+ }
// add a formula to be remembered for TableOp broadcasts
void AddTableOpFormulaCell( ScFormulaCell* );
diff --git a/sc/source/core/data/documen2.cxx b/sc/source/core/data/documen2.cxx
index 9fab88f4e910..283c082199b2 100644
--- a/sc/source/core/data/documen2.cxx
+++ b/sc/source/core/data/documen2.cxx
@@ -176,6 +176,7 @@ ScDocument::ScDocument( ScDocumentMode eMode, SfxObjectShell* pDocShell ) :
nXMLImportedFormulaCount( 0 ),
nInterpretLevel(0),
nMacroInterpretLevel(0),
+ nInterpreterTableOpLevel(0),
nSrcVer( SC_CURRENT_VERSION ),
nFormulaTrackCount(0),
eHardRecalcState(HardRecalcState::OFF),
diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx
index 1706342ccd36..185115ac8ad7 100644
--- a/sc/source/core/data/document.cxx
+++ b/sc/source/core/data/document.cxx
@@ -6771,42 +6771,6 @@ ScMutationGuard::~ScMutationGuard()
thread_local ScDocumentThreadSpecific ScDocument::maThreadSpecific;
-bool ScDocument::IsInInterpreterTableOp() const
-{
- if (!mbThreadedGroupCalcInProgress)
- return maNonThreaded.nInterpreterTableOpLevel != 0;
- else
- return maThreadSpecific.nInterpreterTableOpLevel != 0;
-}
-
-void ScDocument::IncInterpreterTableOpLevel()
-{
- if (!mbThreadedGroupCalcInProgress)
- {
- if (maNonThreaded.nInterpreterTableOpLevel < USHRT_MAX)
- maNonThreaded.nInterpreterTableOpLevel++;
- }
- else
- {
- if (maThreadSpecific.nInterpreterTableOpLevel < USHRT_MAX)
- maThreadSpecific.nInterpreterTableOpLevel++;
- }
-}
-
-void ScDocument::DecInterpreterTableOpLevel()
-{
- if (!mbThreadedGroupCalcInProgress)
- {
- if (maNonThreaded.nInterpreterTableOpLevel)
- maNonThreaded.nInterpreterTableOpLevel--;
- }
- else
- {
- if (maThreadSpecific.nInterpreterTableOpLevel)
- maThreadSpecific.nInterpreterTableOpLevel--;
- }
-}
-
ScRecursionHelper& ScDocument::GetRecursionHelper()
{
if (!mbThreadedGroupCalcInProgress)
@@ -6825,16 +6789,12 @@ ScRecursionHelper& ScDocument::GetRecursionHelper()
void ScDocumentThreadSpecific::SetupFromNonThreadedData(const ScDocumentThreadSpecific& rNonThreadedData)
{
- nInterpreterTableOpLevel = rNonThreadedData.nInterpreterTableOpLevel;
-
// What about the recursion helper?
// Copy the lookup cache?
}
void ScDocumentThreadSpecific::MergeBackIntoNonThreadedData(ScDocumentThreadSpecific& rNonThreadedData)
{
- assert(nInterpreterTableOpLevel == rNonThreadedData.nInterpreterTableOpLevel);
-
// What about recursion helper and lookup cache?
}