summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2015-09-14 19:30:54 +0200
committerCaolán McNamara <caolanm@redhat.com>2015-09-15 14:15:02 +0000
commitd121cc8037ddcb36763e665cf178791e6e3cafd5 (patch)
tree2a39c2947a9a56e871192be5b5812d7975e7fd07
parent788fb4a0152d64c431c0c6062045a742ef80f40b (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 );
}