LibreOffice Module sc (master)  1
scopetools.cxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
5  * This Source Code Form is subject to the terms of the Mozilla Public
6  * License, v. 2.0. If a copy of the MPL was not distributed with this
7  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8  */
9 
10 #include <scopetools.hxx>
11 #include <document.hxx>
12 #include <column.hxx>
13 
14 namespace sc {
15 
17  mrDoc(rDoc), mbOldValue(rDoc.GetAutoCalc())
18 {
19  mrDoc.SetAutoCalc(bAutoCalc);
20 }
21 
23 {
25 }
26 
28  mrDoc(rDoc), mbOldValue(rDoc.IsExpandRefs())
29 {
30  mrDoc.SetExpandRefs(bExpandRefs);
31 }
32 
34 {
36 }
37 
38 UndoSwitch::UndoSwitch(ScDocument& rDoc, bool bUndo) :
39  mrDoc(rDoc), mbOldValue(rDoc.IsUndoEnabled())
40 {
41  mrDoc.EnableUndo(bUndo);
42 }
43 
45 {
47 }
48 
49 IdleSwitch::IdleSwitch(ScDocument& rDoc, bool bEnableIdle) :
50  mrDoc(rDoc), mbOldValue(rDoc.IsIdleEnabled())
51 {
52  mrDoc.EnableIdle(bEnableIdle);
53 }
54 
56 {
58 }
59 
61  mrDoc(rDoc), mbOldValue(rDoc.IsDelayedFormulaGrouping())
62 {
64 }
65 
67 {
69 }
70 
72 {
74 }
75 
77  : mColumn(column), mbOldValue(column.GetDoc().IsEnabledDelayStartListeningFormulaCells(&column))
78 {
79  column.GetDoc().EnableDelayStartListeningFormulaCells(&column, delay);
80 }
81 
83  : mColumn(column), mbOldValue(column.GetDoc().IsEnabledDelayStartListeningFormulaCells(&column))
84 {
85 }
86 
88 {
89 #if defined(__COVERITY__)
90  try
91  {
93  }
94  catch (...)
95  {
96  std::abort();
97  }
98 #else
100 #endif
101 }
102 
104 {
106 }
107 
108 }
109 
110 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
~DelayFormulaGroupingSwitch() COVERITY_NOEXCEPT_FALSE
Definition: scopetools.cxx:66
void EnableIdle(bool bDo)
Definition: document.hxx:2131
ScDocument & GetDoc() const
Definition: column.hxx:184
AutoCalcSwitch(AutoCalcSwitch const &)=delete
void SetExpandRefs(bool bVal)
Definition: documen2.cxx:308
ExpandRefsSwitch(ScDocument &rDoc, bool bExpandRefs)
Definition: scopetools.cxx:27
void DelayFormulaGrouping(bool delay)
If set, joining cells into shared formula groups will be delayed until reset again (RegroupFormulaCel...
Definition: document10.cxx:376
SC_DLLPUBLIC void SetAutoCalc(bool bNewAutoCalc)
Definition: documen7.cxx:602
ScDocument & mrDoc
Definition: scopetools.hxx:28
IdleSwitch(ScDocument &rDoc, bool bEnableIdle)
Definition: scopetools.cxx:49
UndoSwitch(ScDocument &rDoc, bool bUndo)
Definition: scopetools.cxx:38
ScDocument & mrDoc
Definition: scopetools.hxx:43
DelayStartListeningFormulaCells(ScColumn &column, bool delay)
Definition: scopetools.cxx:76
void EnableDelayStartListeningFormulaCells(ScColumn *column, bool delay)
If set, ScColumn::StartListeningFormulaCells() calls may be delayed using CanDelayStartListeningFormu...
Definition: document10.cxx:397
SC_DLLPUBLIC void EnableUndo(bool bVal)
Definition: document.cxx:6496
ScDocument & mrDoc
Definition: scopetools.hxx:63
ScDocument & mrDoc
Definition: scopetools.hxx:53
DelayFormulaGroupingSwitch(ScDocument &rDoc, bool delay)
Definition: scopetools.cxx:60