User: kz      
Date: 2006/12/13 08:53:50

Modified:
   dba/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx

Log:
 INTEGRATION: CWS dba22ui (1.76.14); FILE MERGED
 2006/12/05 09:47:58 fs 1.76.14.1: copying the fix for #i72252# from CWS dba22b 
to dba22ui - intended for the latter, but wrongly checked in into the former

File Changes:

Directory: /dba/dbaccess/source/ui/querydesign/
===============================================

File [changed]: SelectionBrowseBox.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx?r1=1.76&r2=1.77
Delta lines:  +12 -13
---------------------
--- SelectionBrowseBox.cxx      6 Nov 2006 14:42:51 -0000       1.76
+++ SelectionBrowseBox.cxx      13 Dec 2006 16:53:47 -0000      1.77
@@ -646,12 +646,12 @@
        }
 }
 // 
-----------------------------------------------------------------------------
-sal_Bool OSelectionBrowseBox::fillColumnRef(const OSQLParseNode* 
_pColumnRef,const Reference<XDatabaseMetaData>& _xMetaData,OTableFieldDescRef& 
_pEntry,sal_Bool& _bListAction)
+sal_Bool OSelectionBrowseBox::fillColumnRef(const OSQLParseNode* _pColumnRef, 
const Reference< XConnection >& _rxConnection, OTableFieldDescRef& _pEntry, 
sal_Bool& _bListAction )
 {
        OSL_ENSURE(_pColumnRef,"No valid parsenode!");
        ::rtl::OUString sColumnName,sTableRange;
-       
OSQLParseTreeIterator::getColumnRange(_pColumnRef,_xMetaData,sColumnName,sTableRange);
-       return 
fillColumnRef(sColumnName,sTableRange,_xMetaData,_pEntry,_bListAction);
+       
OSQLParseTreeIterator::getColumnRange(_pColumnRef,_rxConnection,sColumnName,sTableRange);
+       return 
fillColumnRef(sColumnName,sTableRange,_rxConnection->getMetaData(),_pEntry,_bListAction);
 }
 // 
-----------------------------------------------------------------------------
 sal_Bool OSelectionBrowseBox::fillColumnRef(const ::rtl::OUString& 
_sColumnName,const ::rtl::OUString& _sTableRange,const 
Reference<XDatabaseMetaData>& _xMetaData,OTableFieldDescRef& _pEntry,sal_Bool& 
_bListAction)
@@ -824,7 +824,7 @@
             if ( SQL_ISRULE(pColumnRef,column_ref) ) // we found a valid 
column name or more column names
             {
                 // look if we can find the corresponding table
-                bError = 
fillColumnRef(pColumnRef,xMetaData,aSelEntry,_bListAction);
+                bError = fillColumnRef( pColumnRef, xConnection, aSelEntry, 
_bListAction );
 
                 // we found a simple column so we must clear the function 
fields but only when the column name is '*'
                 // and the function is different to count
@@ -845,9 +845,9 @@
                         sal_Bool bQuote = sal_False;
                         // may be there exists only one parameter which is a 
column, fill all information into our fields
                         if ( nFunCount == 4 && 
SQL_ISRULE(pColumnRef->getChild(3),column_ref) )
-                            bError = 
fillColumnRef(pColumnRef->getChild(3),xMetaData,aSelEntry,_bListAction);
+                            bError = fillColumnRef( pColumnRef->getChild(3), 
xConnection, aSelEntry, _bListAction );
                         else if ( nFunCount == 3 ) // we have a COUNT(*) here, 
so take the first table
-                            bError = 
fillColumnRef(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("*")),::rtl::OUString(),xMetaData,aSelEntry,_bListAction);
+                            bError = fillColumnRef( 
::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("*")), ::rtl::OUString(), 
xMetaData, aSelEntry, _bListAction );
                         else
                         {
                             nFunctionType |= FKT_NUMERIC;
@@ -859,7 +859,7 @@
                         // now parse the parameters
                         ::rtl::OUString sParameters;
                         for(sal_uInt32 function = 2; function < nFunCount; 
++function) // we only want to parse the parameters of the function
-                            
pColumnRef->getChild(function)->parseNodeToStr(sParameters,xMetaData,&rParser.getContext(),sal_True,bQuote);
+                            pColumnRef->getChild(function)->parseNodeToStr( 
sParameters, xConnection, &rParser.getContext(), sal_True, bQuote );
 
                         aSelEntry->SetFunctionType(nFunctionType);
                         aSelEntry->SetField(sParameters);
@@ -910,7 +910,7 @@
                     sal_uInt32 nFunCount = pColumnRef->count();
                     ::rtl::OUString sParameters;
                     for(sal_uInt32 function = 0; function < nFunCount; 
++function)
-                        
pColumnRef->getChild(function)->parseNodeToStr(sParameters,xMetaData,&rParser.getContext(),sal_True,bQuote);
+                        pColumnRef->getChild(function)->parseNodeToStr( 
sParameters, xConnection, &rParser.getContext(), sal_True, bQuote );
 
                     ::rtl::OUString aSelectionAlias = aSelEntry->GetAlias();
                     aSelEntry->SetAlias(::rtl::OUString());
@@ -932,7 +932,7 @@
 
                     ::rtl::OUString aColumns;
                     pColumnRef->parseNodeToStr( aColumns,
-                                                xMetaData,
+                                                xConnection,
                                                 
&pController->getParser().getContext(),
                                                 sal_True,
                                                 sal_True);
@@ -1035,8 +1035,7 @@
                                                        Reference<XConnection> 
xConnection = pController->getConnection();
                                                        if ( !xConnection.is() )
                                                                return 
sal_False;
-                                                       
Reference<XDatabaseMetaData> xMetaData = xConnection->getMetaData();
-                                                       bError = 
fillColumnRef(sColumnName,sTableAlias,xMetaData,pEntry,bListAction);
+                                                       bError = fillColumnRef( 
sColumnName, sTableAlias, xConnection->getMetaData(), pEntry, bListAction );
                                                }
                                                else
                                                        bError = sal_True;
@@ -1177,7 +1176,7 @@
                                        if (pParseNode)
                                        {
                                                
pParseNode->parseNodeToPredicateStr(aCrit,
-                                                                               
                                        xConnection->getMetaData(),
+                                                                               
                                        xConnection,
                                                                                
                                        
static_cast<OQueryController*>(getDesignView()->getController())->getNumberFormatter(),
 
                                                                                
                                        xColumn,
                                                                                
                                        getDesignView()->getLocale(),
@@ -1215,7 +1214,7 @@
                                                        if (pParseNode)
                                                        {
                                                                
pParseNode->parseNodeToPredicateStr(aCrit, 
-                                                                               
                                                        
xConnection->getMetaData(),
+                                                                               
                                                        xConnection,
                                                                                
                                                        
static_cast<OQueryController*>(getDesignView()->getController())->getNumberFormatter(),
 
                                                                                
                                                        xColumn, 
                                                                                
                                                        
getDesignView()->getLocale(),




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to