[Libreoffice-commits] core.git: Branch 'aoo/trunk' - basic/source

Tsutomu Uchino hanya at apache.org
Thu Jan 8 06:11:20 PST 2015


 basic/source/runtime/methods.cxx |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit a2700f75af61837033ff213607445cc1f74b36d6
Author: Tsutomu Uchino <hanya at apache.org>
Date:   Thu Jan 8 12:56:45 2015 +0000

    #i94895# fix illegal result of Replace runtime function

diff --git a/basic/source/runtime/methods.cxx b/basic/source/runtime/methods.cxx
index f55424c71..6b55dad 100644
--- a/basic/source/runtime/methods.cxx
+++ b/basic/source/runtime/methods.cxx
@@ -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() );
     }
 }
 


More information about the Libreoffice-commits mailing list