summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2015-09-14 19:30:54 +0200
committerAndras Timar <andras.timar@collabora.com>2015-09-19 21:32:16 +0200
commit3b08cc84516f6a3becdf2dfc9c16573495f119ce (patch)
tree6449aaef3314bf03b37699092c7937b7c6bcc29c
parent22fd4458604b933faaa89494459b193112a2fb03 (diff)
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 (cherry picked from commit 97c6dac69ac2ad9cb20ba4d3c167d22a19922700) Reviewed-on: https://gerrit.libreoffice.org/18589 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r--sw/source/core/txtnode/txtedt.cxx5
1 files changed, 2 insertions, 3 deletions
diff --git a/sw/source/core/txtnode/txtedt.cxx b/sw/source/core/txtnode/txtedt.cxx
index adcbf5c56584..482ac208382e 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 );
}