From 293d8aa9981a2f39a327e715249f80c116c7233e Mon Sep 17 00:00:00 2001 From: "Ocke Janssen [oj]" Date: Mon, 23 Nov 2009 10:33:17 +0100 Subject: dba33d: #i107104# error in where <> having --- .../source/ui/querydesign/SelectionBrowseBox.cxx | 25 +++++++++++----------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx b/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx index 27ad175c071c..769e402d8ba7 100644 --- a/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx +++ b/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx @@ -1807,25 +1807,23 @@ void OSelectionBrowseBox::AddGroupBy( const OTableFieldDescRef& rInfo , sal_uInt pEntry->GetFunctionType() == rInfo->GetFunctionType() && pEntry->GetFunction() == rInfo->GetFunction()) { - /*sal_uInt32 nPos = aIter - rFields.begin(); - bAppend = _nCurrentPos > nPos && (rInfo->IsGroupBy() != pEntry->IsGroupBy()); - if ( bAppend ) + if ( pEntry->isNumericOrAggreateFunction() && rInfo->IsGroupBy() ) + { + pEntry->SetGroupBy(sal_False); aIter = rFields.end(); - else*/ + break; + } + else { - if ( pEntry->isNumericOrAggreateFunction() && rInfo->IsGroupBy() ) - { - pEntry->SetGroupBy(sal_False); - aIter = rFields.end(); - } - else + if ( !pEntry->IsGroupBy() && !pEntry->HasCriteria() ) // here we have a where condition which is no having clause { pEntry->SetGroupBy(rInfo->IsGroupBy()); if(!m_bGroupByUnRelated && pEntry->IsGroupBy()) pEntry->SetVisible(sal_True); + break; } } - break; + } } @@ -1887,13 +1885,14 @@ void OSelectionBrowseBox::AddCondition( const OTableFieldDescRef& rInfo, const S if (bCase(aField,rInfo->GetField()) && bCase(aAlias,rInfo->GetAlias()) && pEntry->GetFunctionType() == rInfo->GetFunctionType() && - pEntry->GetFunction() == rInfo->GetFunction()) + pEntry->GetFunction() == rInfo->GetFunction() && + pEntry->IsGroupBy() == rInfo->IsGroupBy() ) { if ( pEntry->isNumericOrAggreateFunction() && rInfo->IsGroupBy() ) pEntry->SetGroupBy(sal_False); else { - pEntry->SetGroupBy(rInfo->IsGroupBy()); +// pEntry->SetGroupBy(rInfo->IsGroupBy()); if(!m_bGroupByUnRelated && pEntry->IsGroupBy()) pEntry->SetVisible(sal_True); } -- cgit v1.2.3