Kaydet (Commit) b4f35a74 authored tarafından Michael Stahl's avatar Michael Stahl

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
üst 97c6dac6
...@@ -1928,7 +1928,9 @@ bool SwLayIdle::_DoIdleJob( const SwContentFrm *pCnt, IdleJobType eJob ) ...@@ -1928,7 +1928,9 @@ bool SwLayIdle::_DoIdleJob( const SwContentFrm *pCnt, IdleJobType eJob )
} }
case AUTOCOMPLETE_WORDS : case AUTOCOMPLETE_WORDS :
const_cast<SwTextFrm*>(static_cast<const SwTextFrm*>(pCnt))->CollectAutoCmplWrds( pContentNode, nTextPos ); 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; return true;
break; break;
case WORD_COUNT : case WORD_COUNT :
......
...@@ -1594,7 +1594,8 @@ void SwTextFrm::CollectAutoCmplWrds( SwContentNode* pActNode, sal_Int32 nActPos ...@@ -1594,7 +1594,8 @@ void SwTextFrm::CollectAutoCmplWrds( SwContentNode* pActNode, sal_Int32 nActPos
} }
if( !--nCnt ) 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; return;
nCnt = 100; nCnt = 100;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment