1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
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/.
10 #include "scopetools.hxx"
11 #include "document.hxx"
12 #include <vcl/window.hxx>
16 AutoCalcSwitch::AutoCalcSwitch(ScDocument
& rDoc
, bool bAutoCalc
) :
17 mrDoc(rDoc
), mbOldValue(rDoc
.GetAutoCalc())
19 mrDoc
.SetAutoCalc(bAutoCalc
);
22 AutoCalcSwitch::~AutoCalcSwitch()
24 mrDoc
.SetAutoCalc(mbOldValue
);
27 ExpandRefsSwitch::ExpandRefsSwitch(ScDocument
& rDoc
, bool bExpandRefs
) :
28 mrDoc(rDoc
), mbOldValue(rDoc
.IsExpandRefs())
30 mrDoc
.SetExpandRefs(bExpandRefs
);
33 ExpandRefsSwitch::~ExpandRefsSwitch()
35 mrDoc
.SetExpandRefs(mbOldValue
);
38 UndoSwitch::UndoSwitch(ScDocument
& rDoc
, bool bUndo
) :
39 mrDoc(rDoc
), mbOldValue(rDoc
.IsUndoEnabled())
41 mrDoc
.EnableUndo(bUndo
);
44 UndoSwitch::~UndoSwitch()
46 mrDoc
.EnableUndo(mbOldValue
);
49 IdleSwitch::IdleSwitch(ScDocument
& rDoc
, bool bEnableIdle
) :
50 mrDoc(rDoc
), mbOldValue(rDoc
.IsIdleEnabled())
52 mrDoc
.EnableIdle(bEnableIdle
);
55 IdleSwitch::~IdleSwitch()
57 mrDoc
.EnableIdle(mbOldValue
);
60 WaitPointerSwitch::WaitPointerSwitch(vcl::Window
* pWin
) :
64 mpFrameWin
->EnterWait();
67 WaitPointerSwitch::~WaitPointerSwitch()
70 mpFrameWin
->LeaveWait();
75 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */