summaryrefslogtreecommitdiff
path: root/dbaccess/source/ui/querydesign
diff options
context:
space:
mode:
authorOcke Janssen [oj] <Ocke.Janssen@sun.com>2010-01-14 13:44:21 +0100
committerOcke Janssen [oj] <Ocke.Janssen@sun.com>2010-01-14 13:44:21 +0100
commite6be976308b0e0fe036cea236f3c4718f15347d3 (patch)
tree22e1e1af4b37b746cc34972a15957caff478f91b /dbaccess/source/ui/querydesign
parent1380b021a5eed58ec9c5a7d98b45f7ffe0559a18 (diff)
parentc9f04ab5703f43ef834185ed74416881b7a745f3 (diff)
Automated merge with file:///net/so-cwsserv01/export/cws/dba33d/DEV300/ooo
Diffstat (limited to 'dbaccess/source/ui/querydesign')
-rw-r--r--dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx13
1 files changed, 12 insertions, 1 deletions
diff --git a/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx b/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx
index cc76e2aeb..072df81cc 100644
--- a/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx
+++ b/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx
@@ -757,11 +757,22 @@ sal_Bool OSelectionBrowseBox::saveField(const String& _sFieldName,OTableFieldDes
bool bInternational = ( nPass % 2 ) == 0;
::rtl::OUString sSql;
- sSql += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SELECT "));
if ( bQuote )
sSql += ::dbtools::quoteName( xMetaData->getIdentifierQuoteString(), _sFieldName );
else
sSql += _sFieldName;
+
+ if ( _pEntry->isAggreateFunction() )
+ {
+ DBG_ASSERT(_pEntry->GetFunction().getLength(),"Functionname darf hier nicht leer sein! ;-(");
+ ::rtl::OUStringBuffer aTmpStr2( _pEntry->GetFunction());
+ aTmpStr2.appendAscii("(");
+ aTmpStr2.append(sSql);
+ aTmpStr2.appendAscii(")");
+ sSql = aTmpStr2.makeStringAndClear();
+ }
+
+ sSql = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SELECT ")) + sSql;
if ( sFieldAlias.getLength() )
{ // always quote the alias name there canbe no function in it
sSql += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" "));