sw/source/core/layout/layact.cxx | 8 +++++--- sw/source/core/txtnode/txtedt.cxx | 8 ++++---- 2 files changed, 9 insertions(+), 7 deletions(-)
New commits: commit 00e0ce3f79bb90836402ca6285867b8e02d2497b Author: Michael Stahl <[email protected]> Date: Tue Sep 15 15:08:13 2015 +0200 sw: use same condition in other cases in SwLayIdle::_DoIdleJob() The difference is VclInputFlags::APPEVENT, which is a Mac OSX specific mystery that presumably indicates user input. Change-Id: Icd0e3aa273e1a16e9bf0fb678e9e51dd37e159b7 diff --git a/sw/source/core/layout/layact.cxx b/sw/source/core/layout/layact.cxx index 195aa32..e40e31e 100644 --- a/sw/source/core/layout/layact.cxx +++ b/sw/source/core/layout/layact.cxx @@ -1922,7 +1922,7 @@ bool SwLayIdle::_DoIdleJob( const SwContentFrm *pCnt, IdleJobType eJob ) bAllValid = false; if ( aRepaint.HasArea() ) pImp->GetShell()->InvalidateWindows( aRepaint ); - if ( Application::AnyInput( VCL_INPUT_MOUSEANDKEYBOARD|VclInputFlags::OTHER|VclInputFlags::PAINT ) ) + if (Application::AnyInput(VCL_INPUT_ANY & VclInputFlags(~VclInputFlags::TIMER))) return true; break; } @@ -1955,7 +1955,7 @@ bool SwLayIdle::_DoIdleJob( const SwContentFrm *pCnt, IdleJobType eJob ) // #i122885# handle smarttag problems gracefully and provide diagnostics SAL_WARN( "sw.core", "SMART_TAGS Exception:" << e.Message); } - if ( Application::AnyInput( VCL_INPUT_MOUSEANDKEYBOARD|VclInputFlags::OTHER|VclInputFlags::PAINT ) ) + if (Application::AnyInput(VCL_INPUT_ANY & VclInputFlags(~VclInputFlags::TIMER))) return true; break; } commit b4f35a7450830979b937ec6ae3b6d638302093d2 Author: Michael Stahl <[email protected]> Date: Mon Sep 14 20:10:45 2015 +0200 tdf#93261: sw: fix idle auto-complete collection loop on big paras 5 ms timers cause SwTextFrm::CollectAutoCmplWrds() to return early, and unlike the auto-spelling stuff there is nothing to store the already-checked range of the paragraph, so on the next iteration it will start from the beginning and time-out again. Prevent that by excluding TIMER events here, as is already done for the ONLINE_SPELLING case. Change-Id: Iac781f10ce0aef902fa921030e61b4cff65d0cb3 diff --git a/sw/source/core/layout/layact.cxx b/sw/source/core/layout/layact.cxx index 500f42f..195aa32 100644 --- a/sw/source/core/layout/layact.cxx +++ b/sw/source/core/layout/layact.cxx @@ -1928,7 +1928,9 @@ bool SwLayIdle::_DoIdleJob( const SwContentFrm *pCnt, IdleJobType eJob ) } case AUTOCOMPLETE_WORDS : const_cast<SwTextFrm*>(static_cast<const SwTextFrm*>(pCnt))->CollectAutoCmplWrds( pContentNode, nTextPos ); - if ( Application::AnyInput( VCL_INPUT_ANY ) ) + // note: bPageValid remains true here even if the cursor + // position is skipped, so no PENDING state needed currently + if (Application::AnyInput(VCL_INPUT_ANY & VclInputFlags(~VclInputFlags::TIMER))) return true; break; case WORD_COUNT : diff --git a/sw/source/core/txtnode/txtedt.cxx b/sw/source/core/txtnode/txtedt.cxx index 20063e1..3e2d4e1 100644 --- a/sw/source/core/txtnode/txtedt.cxx +++ b/sw/source/core/txtnode/txtedt.cxx @@ -1594,7 +1594,8 @@ void SwTextFrm::CollectAutoCmplWrds( SwContentNode* pActNode, sal_Int32 nActPos } if( !--nCnt ) { - if ( Application::AnyInput( VCL_INPUT_ANY ) ) + // don't wait for TIMER here, so we can finish big paragraphs + if (Application::AnyInput(VCL_INPUT_ANY & VclInputFlags(~VclInputFlags::TIMER))) return; nCnt = 100; } commit 97c6dac69ac2ad9cb20ba4d3c167d22a19922700 Author: Michael Stahl <[email protected]> Date: Mon Sep 14 19:30:54 2015 +0200 tdf#93261: sw: fix idle auto-complete collection loop on empty paras So the auto-spell-checking is hyper-optimized to add the words to the auto-complete list as well, and call SetAutoCompleteWordDirty(). But if you disable the auto-spell-checking, then a separate function SwTextFrm::CollectAutoCmplWrds() will be called, which is buggy because it only resets the dirty flag if at least one word of sufficient length was found in the paragraph, which is never the case for an empty paragraph. Change-Id: Idec64fc3c379301426a44e06a1114c474de36014 diff --git a/sw/source/core/txtnode/txtedt.cxx b/sw/source/core/txtnode/txtedt.cxx index 98095cf..20063e1 100644 --- a/sw/source/core/txtnode/txtedt.cxx +++ b/sw/source/core/txtnode/txtedt.cxx @@ -1569,7 +1569,7 @@ void SwTextFrm::CollectAutoCmplWrds( SwContentNode* pActNode, sal_Int32 nActPos sal_Int32 nBegin = 0; sal_Int32 nEnd = pNode->GetText().getLength(); sal_Int32 nLen; - bool bACWDirty = false, bAnyWrd = false; + bool bACWDirty = false; if( nBegin < nEnd ) { @@ -1588,7 +1588,6 @@ void SwTextFrm::CollectAutoCmplWrds( SwContentNode* pActNode, sal_Int32 nActPos { if( rACW.GetMinWordLen() <= rWord.getLength() ) rACW.InsertWord( rWord, *pDoc ); - bAnyWrd = true; } else bACWDirty = true; @@ -1602,7 +1601,7 @@ void SwTextFrm::CollectAutoCmplWrds( SwContentNode* pActNode, sal_Int32 nActPos } } - if( bAnyWrd && !bACWDirty ) + if (!bACWDirty) pNode->SetAutoCompleteWordDirty( false ); } _______________________________________________ Libreoffice-commits mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
