editeng: don't let wild-card auto-correct leave current word
If a paragraph has e.g. multiple -> in it then auto-correct of the first
one will create via the .*->.* rule a new auto-correct entry that has as
long-word the word that contains the first -> until the last -> and
everything in between. This will be somewhat irritating when it is
eventually applied. Avoid it by limiting the wild-card loop to the
current word, which is apparently the intent anyway.
(regression from a074258922
)
Change-Id: I294bae863c44eb460627b61b4383133131fe4b3a
Reviewed-on: https://gerrit.libreoffice.org/28608
Reviewed-by: László Németh <nemeth@numbertext.org>
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Michael Stahl <mstahl@redhat.com>
This commit is contained in:
@@ -2830,6 +2830,11 @@ const SvxAutocorrWord* SvxAutocorrWordList::WordMatches(const SvxAutocorrWord *p
|
|||||||
nSttWdPos = rTxt.indexOf( sTmp, nFndPos);
|
nSttWdPos = rTxt.indexOf( sTmp, nFndPos);
|
||||||
if (nSttWdPos != -1)
|
if (nSttWdPos != -1)
|
||||||
{
|
{
|
||||||
|
sal_Int32 nTmp(nFndPos);
|
||||||
|
while (nTmp < nSttWdPos && !IsWordDelim(rTxt[nTmp]))
|
||||||
|
nTmp++;
|
||||||
|
if (nTmp < nSttWdPos)
|
||||||
|
break; // word delimiter found
|
||||||
buf.append(rTxt.copy(nFndPos, nSttWdPos - nFndPos)).append(pFnd->GetLong());
|
buf.append(rTxt.copy(nFndPos, nSttWdPos - nFndPos)).append(pFnd->GetLong());
|
||||||
nFndPos = nSttWdPos + sTmp.getLength();
|
nFndPos = nSttWdPos + sTmp.getLength();
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user