2013-05-24 11:52:18 -04:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
|
|
|
/*
|
|
|
|
* This file is part of the LibreOffice project.
|
|
|
|
*
|
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "scopetools.hxx"
|
|
|
|
#include "document.hxx"
|
2014-05-20 14:24:44 -04:00
|
|
|
#include <vcl/window.hxx>
|
2013-05-24 11:52:18 -04:00
|
|
|
|
|
|
|
namespace sc {
|
|
|
|
|
|
|
|
AutoCalcSwitch::AutoCalcSwitch(ScDocument& rDoc, bool bAutoCalc) :
|
|
|
|
mrDoc(rDoc), mbOldValue(rDoc.GetAutoCalc())
|
|
|
|
{
|
|
|
|
mrDoc.SetAutoCalc(bAutoCalc);
|
|
|
|
}
|
|
|
|
|
|
|
|
AutoCalcSwitch::~AutoCalcSwitch()
|
|
|
|
{
|
|
|
|
mrDoc.SetAutoCalc(mbOldValue);
|
|
|
|
}
|
|
|
|
|
2013-07-17 16:10:58 -04:00
|
|
|
ExpandRefsSwitch::ExpandRefsSwitch(ScDocument& rDoc, bool bExpandRefs) :
|
|
|
|
mrDoc(rDoc), mbOldValue(rDoc.IsExpandRefs())
|
|
|
|
{
|
|
|
|
mrDoc.SetExpandRefs(bExpandRefs);
|
|
|
|
}
|
|
|
|
|
|
|
|
ExpandRefsSwitch::~ExpandRefsSwitch()
|
|
|
|
{
|
|
|
|
mrDoc.SetExpandRefs(mbOldValue);
|
|
|
|
}
|
|
|
|
|
2014-01-29 12:32:10 -05:00
|
|
|
UndoSwitch::UndoSwitch(ScDocument& rDoc, bool bUndo) :
|
|
|
|
mrDoc(rDoc), mbOldValue(rDoc.IsUndoEnabled())
|
|
|
|
{
|
|
|
|
mrDoc.EnableUndo(bUndo);
|
|
|
|
}
|
|
|
|
|
|
|
|
UndoSwitch::~UndoSwitch()
|
|
|
|
{
|
|
|
|
mrDoc.EnableUndo(mbOldValue);
|
|
|
|
}
|
|
|
|
|
2014-04-15 14:47:53 -04:00
|
|
|
IdleSwitch::IdleSwitch(ScDocument& rDoc, bool bEnableIdle) :
|
|
|
|
mrDoc(rDoc), mbOldValue(rDoc.IsIdleEnabled())
|
|
|
|
{
|
|
|
|
mrDoc.EnableIdle(bEnableIdle);
|
|
|
|
}
|
|
|
|
|
|
|
|
IdleSwitch::~IdleSwitch()
|
|
|
|
{
|
|
|
|
mrDoc.EnableIdle(mbOldValue);
|
|
|
|
}
|
|
|
|
|
2014-09-23 11:20:40 +02:00
|
|
|
WaitPointerSwitch::WaitPointerSwitch(vcl::Window* pWin) :
|
2014-05-20 14:24:44 -04:00
|
|
|
mpFrameWin(pWin)
|
|
|
|
{
|
|
|
|
if (mpFrameWin)
|
|
|
|
mpFrameWin->EnterWait();
|
|
|
|
}
|
|
|
|
|
|
|
|
WaitPointerSwitch::~WaitPointerSwitch()
|
|
|
|
{
|
|
|
|
if (mpFrameWin)
|
|
|
|
mpFrameWin->LeaveWait();
|
|
|
|
}
|
|
|
|
|
2013-05-24 11:52:18 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|