fix baseline build (old cairo) - 'cairo_rectangle_int_t' does not name a type
[LibreOffice.git] / sc / source / core / tool / scopetools.cxx
blobcb5942b9e677a6814e2d86a1c628e62a18dbef15
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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/.
8 */
10 #include "scopetools.hxx"
11 #include "document.hxx"
12 #include <vcl/window.hxx>
14 namespace sc {
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) :
61 mpFrameWin(pWin)
63 if (mpFrameWin)
64 mpFrameWin->EnterWait();
67 WaitPointerSwitch::~WaitPointerSwitch()
69 if (mpFrameWin)
70 mpFrameWin->LeaveWait();
75 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */