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

editeng: avoid autocorrect crash

Happened for me with nFndPos = 30 and nEndPos = 20, and a rTxt that
probably contained "->" twice.

Change-Id: I534c60a5904249e25fdefe45639b4512e6f138c5
Reviewed-on: https://gerrit.libreoffice.org/11344Reviewed-by: 's avatarNémeth László <nemeth@numbertext.org>
Tested-by: 's avatarMichael Stahl <mstahl@redhat.com>
üst 0d0920b1
...@@ -2833,6 +2833,10 @@ const SvxAutocorrWord* SvxAutocorrWordList::WordMatches(const SvxAutocorrWord *p ...@@ -2833,6 +2833,10 @@ const SvxAutocorrWord* SvxAutocorrWordList::WordMatches(const SvxAutocorrWord *p
; ;
if (bWasWordDelim) nFndPos++; if (bWasWordDelim) nFndPos++;
} }
if (nEndPos + extra_repl <= nFndPos)
{
return 0;
}
// store matching pattern and its replacement as a new list item, eg. "i18ns" -> "internationalizations" // store matching pattern and its replacement as a new list item, eg. "i18ns" -> "internationalizations"
OUString aShort = rTxt.copy(nFndPos, nEndPos - nFndPos + extra_repl); OUString aShort = rTxt.copy(nFndPos, nEndPos - nFndPos + extra_repl);
......
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