Kaydet (Commit) 82236dd3 authored tarafından László Németh's avatar László Németh

fdo#68373 wildcard char. matches only real suffix in autocorr.

Change-Id: Ibe06bb5c62ac0d8fae17c8a9ffcc4b1bc2768bcc
üst 68dd91f9
......@@ -2730,11 +2730,18 @@ const SvxAutocorrWord* SvxAutocorrWordList::WordMatches(const SvxAutocorrWord *p
if ( rChk.GetChar( rChk.Len() - 1) == C_ASTERISK )
{
String sTmp( rChk.Copy( 0, rChk.Len() - 1 ) );
// Get the last word delimiter position
xub_StrLen nSttWdPos = nEndPos;
bool bWasWordDelim = false;
bool not_suffix;
while( nSttWdPos && !(bWasWordDelim = IsWordDelim( rTxt.GetChar( --nSttWdPos ))))
;
// search the first occurance with a left word delimitation
xub_StrLen nFndPos = -1;
do {
nFndPos = rTxt.Search( sTmp, nFndPos + 1);
} while ( nFndPos != STRING_NOTFOUND && !(!nFndPos || IsWordDelim( rTxt.GetChar( nFndPos - 1 ))));
not_suffix = (bWasWordDelim && (nSttWdPos >= nFndPos + sTmp.Len()));
} while ( nFndPos != STRING_NOTFOUND && (!(!nFndPos || IsWordDelim( rTxt.GetChar( nFndPos - 1 ))) || not_suffix));
if ( nFndPos != STRING_NOTFOUND )
{
// store matching pattern and its replacement as a new list item, eg. "i18ns" -> "internationalizations"
......
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