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: ...@@ -46,6 +46,15 @@ public:
~UndoSwitch(); ~UndoSwitch();
}; };
class SC_DLLPUBLIC IdleSwitch
{
ScDocument& mrDoc;
bool mbOldValue;
public:
IdleSwitch(ScDocument& rDoc, bool bEnableIdle);
~IdleSwitch();
};
} }
#endif #endif
......
...@@ -45,6 +45,17 @@ UndoSwitch::~UndoSwitch() ...@@ -45,6 +45,17 @@ UndoSwitch::~UndoSwitch()
mrDoc.EnableUndo(mbOldValue); 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: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
...@@ -61,6 +61,7 @@ ...@@ -61,6 +61,7 @@
#include "markdata.hxx" #include "markdata.hxx"
#include "stlsheet.hxx" #include "stlsheet.hxx"
#include "spellcheckcontext.hxx" #include "spellcheckcontext.hxx"
#include <scopetools.hxx>
#include <com/sun/star/i18n/DirectionProperty.hpp> #include <com/sun/star/i18n/DirectionProperty.hpp>
#include <comphelper/string.hxx> #include <comphelper/string.hxx>
...@@ -1443,9 +1444,7 @@ void ScOutputData::DrawStrings( bool bPixelToLogic ) ...@@ -1443,9 +1444,7 @@ void ScOutputData::DrawStrings( bool bPixelToLogic )
vcl::PDFExtOutDevData* pPDFData = PTR_CAST( vcl::PDFExtOutDevData, mpDev->GetExtOutDevData() ); vcl::PDFExtOutDevData* pPDFData = PTR_CAST( vcl::PDFExtOutDevData, mpDev->GetExtOutDevData() );
bool bWasIdleEnabled = mpDoc->IsIdleEnabled(); sc::IdleSwitch aIdleSwitch(*mpDoc, false);
mpDoc->EnableIdle(false);
ScDrawStringsVars aVars( this, bPixelToLogic ); ScDrawStringsVars aVars( this, bPixelToLogic );
bool bProgress = false; bool bProgress = false;
...@@ -2071,7 +2070,6 @@ void ScOutputData::DrawStrings( bool bPixelToLogic ) ...@@ -2071,7 +2070,6 @@ void ScOutputData::DrawStrings( bool bPixelToLogic )
} }
if ( bProgress ) if ( bProgress )
ScProgress::DeleteInterpretProgress(); ScProgress::DeleteInterpretProgress();
mpDoc->EnableIdle(bWasIdleEnabled);
} }
ScFieldEditEngine* ScOutputData::CreateOutputEditEngine() 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