diff options
author | Jan-Marek Glogowski <glogow@fbihome.de> | 2017-07-18 19:55:01 +0200 |
---|---|---|
committer | Jan-Marek Glogowski <glogow@fbihome.de> | 2017-07-20 10:27:19 +0200 |
commit | d7a2fd3e8262b8897ad06f01f25f46330e050e0c (patch) | |
tree | 5f023adf59447fe933ff7c3cce7cf5b42f730c23 | |
parent | 8d4d1e8d1cd4b400bc395dcbb98fb1e82eaf4e0f (diff) |
tdf#109123 Change SwDocIdle base class to Idle
This hides SwDocIdle from SalInstance::AnyInput( VCL_INPUT_ANY )
on Windows. Otherwise Writer assumes there is more stuff to do, as
it can't know the scheduled Windows event is just for itself,
resulting in a busy loop, which freezes Writer.
Change-Id: I919c40e8e1673eb09a69a3084203d1c4a6ecac8a
Reviewed-on: https://gerrit.libreoffice.org/40189
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
-rw-r--r-- | sw/inc/SwDocIdle.hxx | 2 | ||||
-rw-r--r-- | sw/source/core/doc/DocumentStatisticsManager.cxx | 11 | ||||
-rw-r--r-- | sw/source/core/doc/DocumentTimerManager.cxx | 8 |
3 files changed, 13 insertions, 8 deletions
diff --git a/sw/inc/SwDocIdle.hxx b/sw/inc/SwDocIdle.hxx index 6bc65e24766c..f20fabd44f98 100644 --- a/sw/inc/SwDocIdle.hxx +++ b/sw/inc/SwDocIdle.hxx @@ -32,7 +32,7 @@ namespace sw { * quite probably not a problem, as busy documents have a high chance to have * generated idle tasks. */ -class SwDocIdle : public AutoIdle +class SwDocIdle : public Idle { private: SwDoc &m_rDoc; diff --git a/sw/source/core/doc/DocumentStatisticsManager.cxx b/sw/source/core/doc/DocumentStatisticsManager.cxx index 9d050e0c77a0..c3bd626e21e6 100644 --- a/sw/source/core/doc/DocumentStatisticsManager.cxx +++ b/sw/source/core/doc/DocumentStatisticsManager.cxx @@ -127,11 +127,10 @@ void DocumentStatisticsManager::UpdateDocStat( bool bCompleteAsync, bool bFields while (IncrementalDocStatCalculate( std::numeric_limits<long>::max(), bFields)) {} } + else if (IncrementalDocStatCalculate(5000, bFields)) + maStatsUpdateIdle.Start(); else - { - if (!maStatsUpdateIdle.IsActive() && IncrementalDocStatCalculate(5000, bFields)) - maStatsUpdateIdle.Start(); - } + maStatsUpdateIdle.Stop(); } } @@ -239,8 +238,8 @@ bool DocumentStatisticsManager::IncrementalDocStatCalculate(long nChars, bool bF IMPL_LINK( DocumentStatisticsManager, DoIdleStatsUpdate, Timer *, pIdle, void ) { - if (!IncrementalDocStatCalculate(32000)) - pIdle->Stop(); + if (IncrementalDocStatCalculate(32000)) + pIdle->Start(); SwView* pView = m_rDoc.GetDocShell() ? m_rDoc.GetDocShell()->GetView() : nullptr; if( pView ) pView->UpdateDocStats(); diff --git a/sw/source/core/doc/DocumentTimerManager.cxx b/sw/source/core/doc/DocumentTimerManager.cxx index 4a9855570bd6..ec4874ea9ecc 100644 --- a/sw/source/core/doc/DocumentTimerManager.cxx +++ b/sw/source/core/doc/DocumentTimerManager.cxx @@ -96,7 +96,10 @@ IMPL_LINK( DocumentTimerManager, DoIdleJobs, Timer*, pIdle, void ) for(SwViewShell& rSh : pShell->GetRingContainer()) { if( rSh.ActionPend() ) + { + pIdle->Start(); return; + } } if( pTmpRoot->IsNeedGrammarCheck() ) @@ -117,6 +120,7 @@ IMPL_LINK( DocumentTimerManager, DoIdleJobs, Timer*, pIdle, void ) { (*pLayIter)->GetCurrShell()->LayoutIdle(); // Defer the remaining work. + pIdle->Start(); return; } } @@ -131,7 +135,10 @@ IMPL_LINK( DocumentTimerManager, DoIdleJobs, Timer*, pIdle, void ) { if ( m_rDoc.getIDocumentFieldsAccess().GetUpdateFields().IsInUpdateFields() || m_rDoc.getIDocumentFieldsAccess().IsExpFieldsLocked() ) + { + pIdle->Start(); return; + } // Action brackets! m_rDoc.getIDocumentFieldsAccess().GetUpdateFields().SetInUpdateFields( true ); @@ -159,7 +166,6 @@ IMPL_LINK( DocumentTimerManager, DoIdleJobs, Timer*, pIdle, void ) if( pModLogFile && 1 != (long)pModLogFile ) delete pModLogFile, static_cast<long&>(pModLogFile) = 1; #endif - pIdle->Stop(); } DocumentTimerManager::~DocumentTimerManager() {} |