From 05de49bad2c8d097dc6bf18f1d16093b90fb5768 Mon Sep 17 00:00:00 2001 From: Julien Nabet Date: Sat, 7 Sep 2024 12:02:33 +0200 Subject: [PATCH] tdf#162833: don't use an OUStringBuffer directly in a concat to assign itself MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit SUM( CASE WHEN \"dtPayTyp\" = 1 THEN \"dtPayBetrag\" * - 1 ELSE \"dtPayBetrag\" END ) is transformed into: Sum(Sum( WHEN \"dtPayTyp\" = 1 THEN \"dtPayBetrag\" * - 1 ELSE \"dtPayBetrag\" END) See https://bugs.documentfoundation.org/show_bug.cgi?id=162833#c3 Change-Id: Ie73dd6871bcda1c22cf6f469bd05ecc4d9dacb4c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172989 Tested-by: Jenkins Reviewed-by: Caolán McNamara (cherry picked from commit c0fd5f82ff96ab8d5df166aae654243dce0beea2) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173007 Reviewed-by: Xisco Fauli --- dbaccess/source/ui/querydesign/QueryDesignView.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dbaccess/source/ui/querydesign/QueryDesignView.cxx b/dbaccess/source/ui/querydesign/QueryDesignView.cxx index 47c7a996be94..cd00da8dcf60 100644 --- a/dbaccess/source/ui/querydesign/QueryDesignView.cxx +++ b/dbaccess/source/ui/querydesign/QueryDesignView.cxx @@ -651,7 +651,7 @@ namespace if ( field->isAggregateFunction() ) { OSL_ENSURE(!field->GetFunction().isEmpty(),"Function name must not be empty! ;-("); - aTmpStr = field->GetFunction() + "(" + aTmpStr + ")"; + aTmpStr = field->GetFunction() + "(" + aTmpStr.makeStringAndClear() + ")"; } if (!rFieldAlias.isEmpty() &&