[Libreoffice-commits] core.git: editeng/source

László Németh nemeth at numbertext.org
Wed Aug 21 09:02:17 PDT 2013


 editeng/source/misc/svxacorr.cxx |    9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

New commits:
commit 82236dd3269953087fe510642368792478a5a7d9
Author: László Németh <nemeth at numbertext.org>
Date:   Wed Aug 21 17:58:06 2013 +0200

    fdo#68373 wildcard char. matches only real suffix in autocorr.
    
    Change-Id: Ibe06bb5c62ac0d8fae17c8a9ffcc4b1bc2768bcc

diff --git a/editeng/source/misc/svxacorr.cxx b/editeng/source/misc/svxacorr.cxx
index adfad58..b8406f8 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"


More information about the Libreoffice-commits mailing list