summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Lillqvist <tml@collabora.com>2017-09-29 16:00:18 +0300
committerDennis Francis <dennis.francis@collabora.co.uk>2017-11-21 13:49:51 +0530
commit793a7e0ecb6d74b516bd314c9aec020381065efe (patch)
treeb55d1250e6a7ce4b2b9900ec2a9a697a7e8823aa
parent2fda62d190b78a7622fd7195a6a3574956e3b5a3 (diff)
Move nMacroInterpretLevel back to ScDocument
Change-Id: I48748434c845af963af160f8bbd75e4ab7ce95bd
-rw-r--r--sc/inc/document.hxx19
-rw-r--r--sc/source/core/data/documen2.cxx1
-rw-r--r--sc/source/core/data/document.cxx26
3 files changed, 15 insertions, 31 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();
diff --git a/sc/source/core/data/documen2.cxx b/sc/source/core/data/documen2.cxx
index c5d0c7e8cea2..9fab88f4e910 100644
--- a/sc/source/core/data/documen2.cxx
+++ b/sc/source/core/data/documen2.cxx
@@ -175,6 +175,7 @@ ScDocument::ScDocument( ScDocumentMode eMode, SfxObjectShell* pDocShell ) :
nFormulaCodeInTree(0),
nXMLImportedFormulaCount( 0 ),
nInterpretLevel(0),
+ nMacroInterpretLevel(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 2df3f8e10a8b..1706342ccd36 100644
--- a/sc/source/core/data/document.cxx
+++ b/sc/source/core/data/document.cxx
@@ -6771,30 +6771,6 @@ ScMutationGuard::~ScMutationGuard()
thread_local ScDocumentThreadSpecific ScDocument::maThreadSpecific;
-sal_uInt16 ScDocument::GetMacroInterpretLevel()
-{
- if (!mbThreadedGroupCalcInProgress)
- return maNonThreaded.nMacroInterpretLevel;
- else
- return maThreadSpecific.nMacroInterpretLevel;
-}
-
-void ScDocument::IncMacroInterpretLevel()
-{
- if (!mbThreadedGroupCalcInProgress)
- maNonThreaded.nMacroInterpretLevel++;
- else
- maThreadSpecific.nMacroInterpretLevel++;
-}
-
-void ScDocument::DecMacroInterpretLevel()
-{
- if (!mbThreadedGroupCalcInProgress)
- maNonThreaded.nMacroInterpretLevel--;
- else
- maThreadSpecific.nMacroInterpretLevel--;
-}
-
bool ScDocument::IsInInterpreterTableOp() const
{
if (!mbThreadedGroupCalcInProgress)
@@ -6849,7 +6825,6 @@ ScRecursionHelper& ScDocument::GetRecursionHelper()
void ScDocumentThreadSpecific::SetupFromNonThreadedData(const ScDocumentThreadSpecific& rNonThreadedData)
{
- nMacroInterpretLevel = rNonThreadedData.nMacroInterpretLevel;
nInterpreterTableOpLevel = rNonThreadedData.nInterpreterTableOpLevel;
// What about the recursion helper?
@@ -6858,7 +6833,6 @@ void ScDocumentThreadSpecific::SetupFromNonThreadedData(const ScDocumentThreadSp
void ScDocumentThreadSpecific::MergeBackIntoNonThreadedData(ScDocumentThreadSpecific& rNonThreadedData)
{
- assert(nMacroInterpretLevel == rNonThreadedData.nMacroInterpretLevel);
assert(nInterpreterTableOpLevel == rNonThreadedData.nInterpreterTableOpLevel);
// What about recursion helper and lookup cache?