connectivity/source/drivers/file/FStringFunctions.cxx |    9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)

New commits:
commit 727739fa3583a6db140a6f8ddb46b34cd4c29596
Author:     Julien Nabet <serval2...@yahoo.fr>
AuthorDate: Mon Sep 5 21:43:07 2022 +0200
Commit:     Julien Nabet <serval2...@yahoo.fr>
CommitDate: Thu Sep 8 18:55:13 2022 +0200

    Simplify by using replace instead of replaceAt in loop in connectivity (2)
    
    Change-Id: I9bbe005f0bd1399b9c43cebe0e4c58d3ec88087c
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139455
    Tested-by: Jenkins
    Reviewed-by: Julien Nabet <serval2...@yahoo.fr>

diff --git a/connectivity/source/drivers/file/FStringFunctions.cxx 
b/connectivity/source/drivers/file/FStringFunctions.cxx
index 94152bc5d01c..d02c7cce1737 100644
--- a/connectivity/source/drivers/file/FStringFunctions.cxx
+++ b/connectivity/source/drivers/file/FStringFunctions.cxx
@@ -167,14 +167,7 @@ ORowSetValue OOp_Replace::operate(const 
std::vector<ORowSetValue>& lhs) const
     OUString sStr = lhs[2].getString();
     OUString sFrom = lhs[1].getString();
     OUString sTo = lhs[0].getString();
-    sal_Int32 nIndexOf = sStr.indexOf(sFrom);
-    while (nIndexOf != -1)
-    {
-        sStr = sStr.replaceAt(nIndexOf, sFrom.getLength(), sTo);
-        nIndexOf = sStr.indexOf(sFrom, nIndexOf + sTo.getLength());
-    }
-
-    return sStr;
+    return sStr.replaceAll(sFrom, sTo);
 }
 
 ORowSetValue OOp_Repeat::operate(const ORowSetValue& lhs, const ORowSetValue& 
rhs) const

Reply via email to