summaryrefslogtreecommitdiff
path: root/sc/inc
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@collabora.com>2018-05-30 09:22:03 +0200
committerMichael Meeks <michael.meeks@collabora.com>2018-05-31 22:29:29 +0200
commit9dae52bbcb70e95c56a068c5c31f38500b7e465e (patch)
treeb14e3847573ea000914e94baa8bd7c2a48a0bf15 /sc/inc
parent66a1cec7366f28e9287ce88d64bb357bb9dd6c99 (diff)
move mbThreadedGroupCalcInProgress from ScDocument to ScGlobal
Some code, such as statics in ScGlobal, cannot(?) easily access ScDocument. Moreover whether Calc is currently performing threaded calculations is not really a state of a document but of Calc itself. Still keep the state accessible via ScDocument for the pipe-dream future where it possibly really will be a state of the document. Change-Id: I2b112221e7fa1b2b4469cfd289fc201025585a5f Reviewed-on: https://gerrit.libreoffice.org/54796 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Meeks <michael.meeks@collabora.com> Tested-by: Michael Meeks <michael.meeks@collabora.com>
Diffstat (limited to 'sc/inc')
-rw-r--r--sc/inc/document.hxx12
-rw-r--r--sc/inc/global.hxx2
2 files changed, 8 insertions, 6 deletions
diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx
index ccade9f02c6f..813d388abb4d 100644
--- a/sc/inc/document.hxx
+++ b/sc/inc/document.hxx
@@ -435,8 +435,6 @@ private:
css::uno::Reference< css::script::vba::XVBAEventProcessor >
mxVbaEvents;
public:
- bool mbThreadedGroupCalcInProgress;
-
/// list of ScInterpreterTableOpParams currently in use
std::vector<std::unique_ptr<ScInterpreterTableOpParams>> m_TableOpList;
ScInterpreterTableOpParams aLastTableOpParams; // remember last params
@@ -575,6 +573,8 @@ public:
maInterpreterContext.mpFormatter = GetFormatTable();
return maInterpreterContext;
}
+ void SetThreadedGroupCalcInProgress( bool set ) { (void)this; ScGlobal::bThreadedGroupCalcInProgress = set; }
+ bool IsThreadedGroupCalcInProgress() const { (void)this; return ScGlobal::bThreadedGroupCalcInProgress; }
SC_DLLPUBLIC sfx2::LinkManager* GetLinkManager();
SC_DLLPUBLIC const sfx2::LinkManager* GetLinkManager() const;
@@ -2216,26 +2216,26 @@ public:
void IncInterpretLevel()
{
- assert(!mbThreadedGroupCalcInProgress);
+ assert(!IsThreadedGroupCalcInProgress());
if ( nInterpretLevel < USHRT_MAX )
nInterpretLevel++;
}
void DecInterpretLevel()
{
- assert(!mbThreadedGroupCalcInProgress);
+ assert(!IsThreadedGroupCalcInProgress());
if ( nInterpretLevel )
nInterpretLevel--;
}
sal_uInt16 GetMacroInterpretLevel() { return nMacroInterpretLevel; }
void IncMacroInterpretLevel()
{
- assert(!mbThreadedGroupCalcInProgress);
+ assert(!IsThreadedGroupCalcInProgress());
if ( nMacroInterpretLevel < USHRT_MAX )
nMacroInterpretLevel++;
}
void DecMacroInterpretLevel()
{
- assert(!mbThreadedGroupCalcInProgress);
+ assert(!IsThreadedGroupCalcInProgress());
if ( nMacroInterpretLevel )
nMacroInterpretLevel--;
}
diff --git a/sc/inc/global.hxx b/sc/inc/global.hxx
index 050e38250508..56fe91be4aca 100644
--- a/sc/inc/global.hxx
+++ b/sc/inc/global.hxx
@@ -801,6 +801,8 @@ public:
FormulaError & rError, FormulaError nStringNoValueError,
SvNumberFormatter* pFormatter, SvNumFormatType & rCurFmtType );
+ /// Calc's threaded group calculation is in progress.
+ static bool bThreadedGroupCalcInProgress;
};
// maybe move to dbdata.hxx (?):