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
14namespace 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
39 mrDoc(rDoc), mbOldValue(rDoc.IsUndoEnabled())
40{
41 mrDoc.EnableUndo(bUndo);
42}
43
45{
47}
48
49IdleSwitch::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
109 : mDoc( doc )
110 , mOldValue( mDoc.IsDelayedDeletingBroadcasters())
111{
113}
114
116{
118}
119
120}
121
122/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
ScDocument & GetDoc() const
Definition: column.hxx:127
void EnableDelayStartListeningFormulaCells(ScColumn *column, bool delay)
If set, ScColumn::StartListeningFormulaCells() calls may be delayed using CanDelayStartListeningFormu...
Definition: document10.cxx:401
void EnableDelayDeletingBroadcasters(bool set)
If set, cells will not delete their empty broadcasters, avoiding possible extensive mdds vector chang...
Definition: document10.cxx:449
void SetExpandRefs(bool bVal)
Definition: documen2.cxx:327
SC_DLLPUBLIC void EnableUndo(bool bVal)
Definition: document.cxx:6456
void DelayFormulaGrouping(bool delay)
If set, joining cells into shared formula groups will be delayed until reset again (RegroupFormulaCel...
Definition: document10.cxx:380
void EnableIdle(bool bDo)
Definition: document.hxx:2208
SC_DLLPUBLIC void SetAutoCalc(bool bNewAutoCalc)
Definition: documen7.cxx:602
ScDocument & mrDoc
Definition: scopetools.hxx:28
AutoCalcSwitch(AutoCalcSwitch const &)=delete
DelayDeletingBroadcasters(ScDocument &doc)
Definition: scopetools.cxx:108
DelayFormulaGroupingSwitch(ScDocument &rDoc, bool delay)
Definition: scopetools.cxx:60
~DelayFormulaGroupingSwitch() COVERITY_NOEXCEPT_FALSE
Definition: scopetools.cxx:66
DelayStartListeningFormulaCells(ScColumn &column, bool delay)
Definition: scopetools.cxx:76
ScDocument & mrDoc
Definition: scopetools.hxx:43
ExpandRefsSwitch(ScDocument &rDoc, bool bExpandRefs)
Definition: scopetools.cxx:27
IdleSwitch(ScDocument &rDoc, bool bEnableIdle)
Definition: scopetools.cxx:49
ScDocument & mrDoc
Definition: scopetools.hxx:63
ScDocument & mrDoc
Definition: scopetools.hxx:53
UndoSwitch(ScDocument &rDoc, bool bUndo)
Definition: scopetools.cxx:38
#define suppress_fun_call_w_exception(expr)
CAUTION! The following defines must be in the same namespace as the respective type.
Definition: broadcast.cxx:15