Kaydet (Commit) 6fa4d31d authored tarafından Kohei Yoshida's avatar Kohei Yoshida

Use scope switch rather than manual on and off.

Change-Id: Ia4072339b6f1fd4b929d891dcc8f3bb3e2403d5e
üst 8e50a6c7
......@@ -46,6 +46,15 @@ public:
~UndoSwitch();
};
class SC_DLLPUBLIC IdleSwitch
{
ScDocument& mrDoc;
bool mbOldValue;
public:
IdleSwitch(ScDocument& rDoc, bool bEnableIdle);
~IdleSwitch();
};
}
#endif
......
......@@ -45,6 +45,17 @@ UndoSwitch::~UndoSwitch()
mrDoc.EnableUndo(mbOldValue);
}
IdleSwitch::IdleSwitch(ScDocument& rDoc, bool bEnableIdle) :
mrDoc(rDoc), mbOldValue(rDoc.IsIdleEnabled())
{
mrDoc.EnableIdle(bEnableIdle);
}
IdleSwitch::~IdleSwitch()
{
mrDoc.EnableIdle(mbOldValue);
}
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -61,6 +61,7 @@
#include "markdata.hxx"
#include "stlsheet.hxx"
#include "spellcheckcontext.hxx"
#include <scopetools.hxx>
#include <com/sun/star/i18n/DirectionProperty.hpp>
#include <comphelper/string.hxx>
......@@ -1443,9 +1444,7 @@ void ScOutputData::DrawStrings( bool bPixelToLogic )
vcl::PDFExtOutDevData* pPDFData = PTR_CAST( vcl::PDFExtOutDevData, mpDev->GetExtOutDevData() );
bool bWasIdleEnabled = mpDoc->IsIdleEnabled();
mpDoc->EnableIdle(false);
sc::IdleSwitch aIdleSwitch(*mpDoc, false);
ScDrawStringsVars aVars( this, bPixelToLogic );
bool bProgress = false;
......@@ -2071,7 +2070,6 @@ void ScOutputData::DrawStrings( bool bPixelToLogic )
}
if ( bProgress )
ScProgress::DeleteInterpretProgress();
mpDoc->EnableIdle(bWasIdleEnabled);
}
ScFieldEditEngine* ScOutputData::CreateOutputEditEngine()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment