summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2015-09-14 20:10:45 +0200
committerAndras Timar <andras.timar@collabora.com>2015-09-19 21:32:16 +0200
commite6e7e9a6de8abd9c86b393de9ed5e7018208cff6 (patch)
treed6031a750b9c8f1e205e8a3eb008c2de9a18af2d
parent3b08cc84516f6a3becdf2dfc9c16573495f119ce (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 (cherry picked from commit b4f35a7450830979b937ec6ae3b6d638302093d2) Reviewed-on: https://gerrit.libreoffice.org/18590 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r--sw/source/core/layout/layact.cxx4
-rw-r--r--sw/source/core/txtnode/txtedt.cxx3
2 files changed, 5 insertions, 2 deletions
diff --git a/sw/source/core/layout/layact.cxx b/sw/source/core/layout/layact.cxx
index 3c61e304b98c..ba9edb0398db 100644
--- a/sw/source/core/layout/layact.cxx
+++ b/sw/source/core/layout/layact.cxx
@@ -1943,7 +1943,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 482ac208382e..c2562280aba2 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;
}