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:
parent
31cfb24237
commit
785e530e83
@ -2834,8 +2834,11 @@ const SvxAutocorrWord* SvxAutocorrWordList::WordMatches(const SvxAutocorrWord *p
|
|||||||
SvxAutocorrWord* pNew = new SvxAutocorrWord(aShort, aLong);
|
SvxAutocorrWord* pNew = new SvxAutocorrWord(aShort, aLong);
|
||||||
if ( Insert( pNew ) )
|
if ( Insert( pNew ) )
|
||||||
{
|
{
|
||||||
if ( IsWordDelim(rTxt[nEndPos]) ) return pNew;
|
if ( (rTxt.getLength() > nEndPos && IsWordDelim(rTxt[nEndPos])) || rTxt.getLength() == nEndPos )
|
||||||
} else delete pNew;
|
return pNew;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
delete pNew;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user