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 #include <vcl/window.hxx>
14 
15 namespace sc {
16 
18  mrDoc(rDoc), mbOldValue(rDoc.GetAutoCalc())
19 {
20  mrDoc.SetAutoCalc(bAutoCalc);
21 }
22 
24 {
26 }
27 
29  mrDoc(rDoc), mbOldValue(rDoc.IsExpandRefs())
30 {
31  mrDoc.SetExpandRefs(bExpandRefs);
32 }
33 
35 {
37 }
38 
39 UndoSwitch::UndoSwitch(ScDocument& rDoc, bool bUndo) :
40  mrDoc(rDoc), mbOldValue(rDoc.IsUndoEnabled())
41 {
42  mrDoc.EnableUndo(bUndo);
43 }
44 
46 {
48 }
49 
50 IdleSwitch::IdleSwitch(ScDocument& rDoc, bool bEnableIdle) :
51  mrDoc(rDoc), mbOldValue(rDoc.IsIdleEnabled())
52 {
53  mrDoc.EnableIdle(bEnableIdle);
54 }
55 
57 {
59 }
60 
62  mrDoc(rDoc), mbOldValue(rDoc.IsDelayedFormulaGrouping())
63 {
65 }
66 
68 {
70 }
71 
73 {
75 }
76 
78  : mColumn(column), mbOldValue(column.GetDoc()->IsEnabledDelayStartListeningFormulaCells(&column))
79 {
80  column.GetDoc()->EnableDelayStartListeningFormulaCells(&column, delay);
81 }
82 
84  : mColumn(column), mbOldValue(column.GetDoc()->IsEnabledDelayStartListeningFormulaCells(&column))
85 {
86 }
87 
89 {
90 #if defined(__COVERITY__)
91  try
92  {
94  }
95  catch (...)
96  {
97  std::abort();
98  }
99 #else
101 #endif
102 }
103 
105 {
107 }
108 
109 }
110 
111 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
~DelayFormulaGroupingSwitch() COVERITY_NOEXCEPT_FALSE
Definition: scopetools.cxx:67
void EnableIdle(bool bDo)
Definition: document.hxx:2121
AutoCalcSwitch(AutoCalcSwitch const &)=delete
void SetExpandRefs(bool bVal)
Definition: documen2.cxx:305
ExpandRefsSwitch(ScDocument &rDoc, bool bExpandRefs)
Definition: scopetools.cxx:28
void DelayFormulaGrouping(bool delay)
If set, joining cells into shared formula groups will be delayed until reset again (RegroupFormulaCel...
Definition: document10.cxx:377
SC_DLLPUBLIC void SetAutoCalc(bool bNewAutoCalc)
Definition: documen7.cxx:602
ScDocument & mrDoc
Definition: scopetools.hxx:26
IdleSwitch(ScDocument &rDoc, bool bEnableIdle)
Definition: scopetools.cxx:50
UndoSwitch(ScDocument &rDoc, bool bUndo)
Definition: scopetools.cxx:39
ScDocument * GetDoc() const
Definition: column.hxx:182
ScDocument & mrDoc
Definition: scopetools.hxx:41
DelayStartListeningFormulaCells(ScColumn &column, bool delay)
Definition: scopetools.cxx:77
void EnableDelayStartListeningFormulaCells(ScColumn *column, bool delay)
If set, ScColumn::StartListeningFormulaCells() calls may be delayed using CanDelayStartListeningFormu...
Definition: document10.cxx:398
SC_DLLPUBLIC void EnableUndo(bool bVal)
Definition: document.cxx:6472
ScDocument & mrDoc
Definition: scopetools.hxx:59
ScDocument & mrDoc
Definition: scopetools.hxx:50
DelayFormulaGroupingSwitch(ScDocument &rDoc, bool delay)
Definition: scopetools.cxx:61