[Libreoffice-commits] core.git: sc/qa

Stephan Bergmann (via logerrit) logerrit at kemper.freedesktop.org
Wed Dec 23 19:49:08 UTC 2020


 sc/qa/unit/ucalc_formula.cxx |   23 +++++------------------
 1 file changed, 5 insertions(+), 18 deletions(-)

New commits:
commit a70ed54a512af36d46d17ffe28b8b9151286f651
Author:     Stephan Bergmann <sbergman at redhat.com>
AuthorDate: Wed Dec 23 18:48:40 2020 +0100
Commit:     Stephan Bergmann <sbergman at redhat.com>
CommitDate: Wed Dec 23 20:48:17 2020 +0100

    More loplugin:bufferadd findings
    
    ...after recent Clang 12 trunk <https://github.com/llvm/llvm-project/commit/
    569676c05725d79909bd8a9224bc709bd621553c> "Make Expr::HasSideEffect more precise
    for instantiation-dependent expressions."
    
    Change-Id: Ic22d68368f2ccfa1ae67efaff38cd4d2d2072db0
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108242
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <sbergman at redhat.com>

diff --git a/sc/qa/unit/ucalc_formula.cxx b/sc/qa/unit/ucalc_formula.cxx
index 16258b1c9cf2..28b078ae43df 100644
--- a/sc/qa/unit/ucalc_formula.cxx
+++ b/sc/qa/unit/ucalc_formula.cxx
@@ -5608,15 +5608,8 @@ static void runTestMATCH(ScDocument* pDoc, const char* aData[DataSize], const St
     {
         pDoc->SetString(1, i, 0, OUString::createFromAscii(aChecks[i].pVal));
 
-        OUStringBuffer aBuf;
-        aBuf.append("=MATCH(B");
-        aBuf.append(static_cast<sal_Int32>(i+1));
-        aBuf.append(";A1:A");
-        aBuf.append(static_cast<sal_Int32>(nDataSize));
-        aBuf.append(";");
-        aBuf.append(static_cast<sal_Int32>(Type));
-        aBuf.append(")");
-        OUString aFormula = aBuf.makeStringAndClear();
+        OUString aFormula = "=MATCH(B" + OUString::number(i+1) + ";A1:A"
+            + OUString::number(nDataSize) + ";" + OUString::number(Type) + ")";
         pDoc->SetString(2, i, 0, aFormula);
     }
 
@@ -5648,15 +5641,9 @@ static void runTestHorizontalMATCH(ScDocument* pDoc, const char* aData[DataSize]
         pDoc->SetString(i, 1, 0, OUString::createFromAscii(aChecks[i].pVal));
 
         // Assume we don't have more than 26 data columns...
-        OUStringBuffer aBuf;
-        aBuf.append("=MATCH(");
-        aBuf.append(static_cast<sal_Unicode>('A'+i));
-        aBuf.append("2;A1:");
-        aBuf.append(static_cast<sal_Unicode>('A'+nDataSize));
-        aBuf.append("1;");
-        aBuf.append(static_cast<sal_Int32>(Type));
-        aBuf.append(")");
-        OUString aFormula = aBuf.makeStringAndClear();
+        OUString aFormula = "=MATCH(" + OUStringChar(static_cast<sal_Unicode>('A'+i)) + "2;A1:"
+            + OUStringChar(static_cast<sal_Unicode>('A'+nDataSize)) + "1;" + OUString::number(Type)
+            + ")";
         pDoc->SetString(i, 2, 0, aFormula);
     }
 


More information about the Libreoffice-commits mailing list