summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2015-09-14 20:10:45 +0200
committerCaolán McNamara <caolanm@redhat.com>2015-09-15 14:15:13 +0000
commit9962cb4bdaa7f9cf6c7a3c9e1dd17e2a51052588 (patch)
tree110ad1887cefa93f207ba90be5531b7a3374dee2
parentd121cc8037ddcb36763e665cf178791e6e3cafd5 (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;
}