tdf#162833: don't use an OUStringBuffer directly in a concat to assign itself

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 <caolan.mcnamara@collabora.com>
(cherry picked from commit c0fd5f82ff)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173007
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
This commit is contained in:
Julien Nabet 2024-09-07 12:02:33 +02:00 committed by Xisco Fauli
parent 063b64d0ad
commit 05de49bad2

View file

@ -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() &&