Author: hanya
Date: Thu Jan  8 12:56:45 2015
New Revision: 1650261

URL: http://svn.apache.org/r1650261
Log:
#i94895# fix illegal result of Replace runtime function

Modified:
    openoffice/trunk/main/basic/source/runtime/methods.cxx

Modified: openoffice/trunk/main/basic/source/runtime/methods.cxx
URL: 
http://svn.apache.org/viewvc/openoffice/trunk/main/basic/source/runtime/methods.cxx?rev=1650261&r1=1650260&r2=1650261&view=diff
==============================================================================
--- openoffice/trunk/main/basic/source/runtime/methods.cxx (original)
+++ openoffice/trunk/main/basic/source/runtime/methods.cxx Thu Jan  8 12:56:45 
2015
@@ -1439,7 +1439,7 @@ RTLFUNC(Replace)
                                if( nPos != STRING_NOTFOUND )
                                {
                                        aExpStr.Replace( nPos, nFindStrLen, 
aReplaceStr );
-                                       nPos = nPos - nFindStrLen + 
nReplaceStrLen + 1;
+                                       nPos = nPos + nReplaceStrLen;
                                        nCounts++;
                                }
                                else
@@ -1448,7 +1448,7 @@ RTLFUNC(Replace)
                                }
                        }
                }
-               rPar.Get(0)->PutString( aExpStr.Copy( 
static_cast<sal_uInt16>(lStartPos - 1) )  );
+               rPar.Get(0)->PutString( aExpStr.Copy() );
        }
 }
 


Reply via email to