fix bad index/assertion failure with line ending autocorrect patterns

Test case: type "->" and press Enter in a new en-US text document.
Result: crash or missing replacement of the arrow.

Change-Id: I052ae868b6fe0b1e5557c40471d31a20bd1e5ca9
This commit is contained in:
László Németh 2016-05-21 02:26:48 +02:00
parent 31cfb24237
commit 785e530e83

View File

@ -2834,8 +2834,11 @@ const SvxAutocorrWord* SvxAutocorrWordList::WordMatches(const SvxAutocorrWord *p
SvxAutocorrWord* pNew = new SvxAutocorrWord(aShort, aLong);
if ( Insert( pNew ) )
{
if ( IsWordDelim(rTxt[nEndPos]) ) return pNew;
} else delete pNew;
if ( (rTxt.getLength() > nEndPos && IsWordDelim(rTxt[nEndPos])) || rTxt.getLength() == nEndPos )
return pNew;
}
else
delete pNew;
}
}
}