diff options
Diffstat (limited to 'sc/inc/document.hxx')
-rw-r--r-- | sc/inc/document.hxx | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx index 31278f83798b..6a584b47d0a8 100644 --- a/sc/inc/document.hxx +++ b/sc/inc/document.hxx @@ -540,6 +540,8 @@ private: bool mbTrackFormulasPending : 1; bool mbFinalTrackFormulas : 1; + // This indicates if a ScDocShell::DoRecalc() or ScDocShell::DoHardRecalc() is in progress. + bool mbDocShellRecalc : 1; size_t mnMutationGuardFlags; @@ -2453,6 +2455,9 @@ public: SC_DLLPUBLIC ScColumnsRange GetColumnsRange(SCTAB nTab, SCCOL nColBegin, SCCOL nColEnd) const; + bool IsInDocShellRecalc() const { return mbDocShellRecalc; } + void SetDocShellRecalc(bool bSet) { mbDocShellRecalc = bSet; } + private: /** @@ -2575,6 +2580,25 @@ struct ScMutationGuard size_t mnFlags; ScDocument* mpDocument; #endif + +}; + +class ScDocShellRecalcGuard +{ + ScDocument& mrDoc; + +public: + ScDocShellRecalcGuard(ScDocument& rDoc) + : mrDoc(rDoc) + { + assert(!mrDoc.IsInDocShellRecalc()); + mrDoc.SetDocShellRecalc(true); + } + + ~ScDocShellRecalcGuard() + { + mrDoc.SetDocShellRecalc(false); + } }; #endif |