diff options
author | Michael Stahl <mstahl@redhat.com> | 2015-09-14 20:10:45 +0200 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2015-09-15 15:24:05 +0200 |
commit | b4f35a7450830979b937ec6ae3b6d638302093d2 (patch) | |
tree | 724822ea65d07d1c34b95063bec05bef067db3f6 | |
parent | 97c6dac69ac2ad9cb20ba4d3c167d22a19922700 (diff) |
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
-rw-r--r-- | sw/source/core/layout/layact.cxx | 4 | ||||
-rw-r--r-- | sw/source/core/txtnode/txtedt.cxx | 3 |
2 files changed, 5 insertions, 2 deletions
diff --git a/sw/source/core/layout/layact.cxx b/sw/source/core/layout/layact.cxx index 500f42f0b6bd..195aa32656f3 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 20063e111923..3e2d4e1d2ff8 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; } |