diff options
author | László Németh <nemeth@numbertext.org> | 2013-08-21 17:58:06 +0200 |
---|---|---|
committer | László Németh <nemeth@numbertext.org> | 2013-08-21 18:01:41 +0200 |
commit | 82236dd3269953087fe510642368792478a5a7d9 (patch) | |
tree | 96b8377224e59d06a0a19a90e0251957d6ab474d /editeng | |
parent | fdo#68381 take care of cell notes on Transpose (diff) | |
download | core-82236dd3269953087fe510642368792478a5a7d9.tar.gz core-82236dd3269953087fe510642368792478a5a7d9.zip |
fdo#68373 wildcard char. matches only real suffix in autocorr.
Change-Id: Ibe06bb5c62ac0d8fae17c8a9ffcc4b1bc2768bcc
Diffstat (limited to 'editeng')
-rw-r--r-- | editeng/source/misc/svxacorr.cxx | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/editeng/source/misc/svxacorr.cxx b/editeng/source/misc/svxacorr.cxx index adfad5860443..b8406f8b3727 100644 --- a/editeng/source/misc/svxacorr.cxx +++ b/editeng/source/misc/svxacorr.cxx @@ -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" |