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

Caolán McNamara caolanm at redhat.com
Thu Jan 8 12:36:33 PST 2015


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

New commits:
commit 869402a58720b45e7227438b2e56e5a9532c0000
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Jan 8 20:35:28 2015 +0000

    Revert "Resolves: #i94895# fix illegal result of Replace runtime function"
    
    This reverts commit 340ca294d43f2c5b9fda1afbf178609a015f71e3 as CppunitTest_basic_vba
    breaks, so needs revisiting to see which is right
    
    Change-Id: I10168d454a8c67d91eee5bb8939aff74bba42954

diff --git a/basic/source/runtime/methods.cxx b/basic/source/runtime/methods.cxx
index baa9603..7ccbab7 100644
--- a/basic/source/runtime/methods.cxx
+++ b/basic/source/runtime/methods.cxx
@@ -1405,7 +1405,7 @@ RTLFUNC(Replace)
                 if( nPos >= 0 )
                 {
                     aExpStr = aExpStr.replaceAt( nPos, nFindStrLen, aReplaceStr );
-                    nPos = nPos + nReplaceStrLen;
+                    nPos = nPos - nFindStrLen + nReplaceStrLen + 1;
                     nCounts++;
                 }
                 else
@@ -1414,7 +1414,7 @@ RTLFUNC(Replace)
                 }
             }
         }
-        rPar.Get(0)->PutString( aExpStr  );
+        rPar.Get(0)->PutString( aExpStr.copy( lStartPos - 1 )  );
     }
 }
 


More information about the Libreoffice-commits mailing list