diff --git a/editeng/source/misc/svxacorr.cxx b/editeng/source/misc/svxacorr.cxx index b726fe1209ff..5195342df9cd 100644 --- a/editeng/source/misc/svxacorr.cxx +++ b/editeng/source/misc/svxacorr.cxx @@ -2830,6 +2830,11 @@ const SvxAutocorrWord* SvxAutocorrWordList::WordMatches(const SvxAutocorrWord *p nSttWdPos = rTxt.indexOf( sTmp, nFndPos); 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()); nFndPos = nSttWdPos + sTmp.getLength(); }