summaryrefslogtreecommitdiff
path: root/dbaccess/source
diff options
context:
space:
mode:
authorJulien Nabet <serval2412@yahoo.fr>2021-07-16 20:54:16 +0200
committerJulien Nabet <serval2412@yahoo.fr>2021-07-17 09:04:54 +0200
commit4a096b9c787fa2079ef1c8f00fed91d432d46fae (patch)
tree83c00df888c17783515b81b5aadd7dd5e603af72 /dbaccess/source
parent40556642e1f1e497251ec697a41cc67de3ace181 (diff)
tdf#143400: fix query with most functions could not be created in GUI
Regression from: https://cgit.freedesktop.org/libreoffice/core/commit/?id=04aafba860f613c20e7078d038cc83eb02de0b54 loplugin:stringadd simplify some *StringBuffer operations pulled from a larger patch which I created with a more permissive variant of this plugin Specifically here: -------------- dbaccess/source/ui/querydesign/QueryDesignView.cxx -------------- index 22408bbc58aa..63c5d07998ec 100644 @@ -658,11 +658,10 @@ namespace if ( field->isAggregateFunction() ) { OSL_ENSURE(!field->GetFunction().isEmpty(),"Function name must not be empty! ;-("); - OUStringBuffer aTmpStr2( field->GetFunction()); - aTmpStr2.append("("); - aTmpStr2.append(aTmpStr.makeStringAndClear()); - aTmpStr2.append(")"); - aTmpStr = aTmpStr2; + aTmpStr = field->GetFunction() + + "(" + + aTmpStr + + ")"; } if (!rFieldAlias.isEmpty() && Change-Id: Ib0b57e6c44a58a6a5f9c98aebc6a1213b35108d1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119088 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Julien Nabet <serval2412@yahoo.fr>
Diffstat (limited to 'dbaccess/source')
-rw-r--r--dbaccess/source/ui/querydesign/QueryDesignView.cxx6
1 files changed, 2 insertions, 4 deletions
diff --git a/dbaccess/source/ui/querydesign/QueryDesignView.cxx b/dbaccess/source/ui/querydesign/QueryDesignView.cxx
index baf90e28997b..cc2bcf2828d4 100644
--- a/dbaccess/source/ui/querydesign/QueryDesignView.cxx
+++ b/dbaccess/source/ui/querydesign/QueryDesignView.cxx
@@ -658,10 +658,8 @@ namespace
if ( field->isAggregateFunction() )
{
OSL_ENSURE(!field->GetFunction().isEmpty(),"Function name must not be empty! ;-(");
- aTmpStr = field->GetFunction() +
- "(" +
- aTmpStr +
- ")";
+ OUStringBuffer aTmpStr2( field->GetFunction() + "(" + aTmpStr.makeStringAndClear() + ")");
+ aTmpStr = aTmpStr2;
}
if (!rFieldAlias.isEmpty() &&