Tag: cws_src680_dba22b User: fs Date: 2006/12/04 14:41:19 Modified: dba/dbaccess/source/ui/querydesign/QueryDesignView.cxx dba/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx dba/dbaccess/source/ui/querydesign/SelectionBrowseBox.hxx dba/dbaccess/source/ui/querydesign/querycontroller.cxx
Log: #i72252# parseNodeTo*/getColumnRange: use XConnection instead of XDatabaseMetaData File Changes: Directory: /dba/dbaccess/source/ui/querydesign/ =============================================== File [changed]: QueryDesignView.cxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/ui/querydesign/QueryDesignView.cxx?r1=1.84&r2=1.84.42.1 Delta lines: +20 -24 --------------------- --- QueryDesignView.cxx 18 Oct 2006 13:32:24 -0000 1.84 +++ QueryDesignView.cxx 4 Dec 2006 22:41:16 -0000 1.84.42.1 @@ -4,9 +4,9 @@ * * $RCSfile: QueryDesignView.cxx,v $ * - * $Revision: 1.84 $ + * $Revision: 1.84.42.1 $ * - * last change: $Author: ihi $ $Date: 2006/10/18 13:32:24 $ + * last change: $Author: fs $ $Date: 2006/12/04 22:41:16 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -218,11 +218,10 @@ Reference< XConnection> xConnection = pController->getConnection(); if ( xConnection.is() ) { - Reference< XDatabaseMetaData > xMetaData = xConnection->getMetaData(); sal_uInt32 nCount = pCondition->count(); for(sal_uInt32 i = _nStartIndex ; i < nCount ; ++i) pCondition->getChild(i)->parseNodeToPredicateStr(aCondition, - xMetaData, + xConnection, pController->getNumberFormatter(), _rLocale, static_cast<sal_Char>(_sDecimal.toChar()), @@ -895,7 +894,7 @@ sal_uInt32 nCount = pParseNode->count(); for( sal_uInt32 node = 1 ; node < nCount ; ++node) pParseNode->getChild(node)->parseNodeToStr( sHavingStr, - xMetaData, + xConnection, &rContext, sal_False, !pEntryField->isOtherFunction()); @@ -924,7 +923,7 @@ pParseNode->replaceNodeValue(pEntryField->GetAlias(),aFieldName); ::rtl::OUString aWhere = aWhereStr; pParseNode->parseNodeToStr( aWhere, - xMetaData, + xConnection, &rContext, sal_False, !pEntryField->isOtherFunction() ); @@ -1381,14 +1380,14 @@ Reference< XDatabaseMetaData > xMetaData = xConnection->getMetaData(); // the international doesn't matter I have a string pCondition->parseNodeToPredicateStr(aCondition, - xMetaData, + xConnection, pController->getNumberFormatter(), aLocale, static_cast<sal_Char>(sDecimal.toChar()), &pController->getParser().getContext()); pCondition->getChild(0)->parseNodeToPredicateStr( aColumnName, - xMetaData, + xConnection, pController->getNumberFormatter(), aLocale, static_cast<sal_Char>(sDecimal.toChar()), @@ -1468,14 +1467,14 @@ { Reference< XDatabaseMetaData > xMetaData = xConnection->getMetaData(); pCondition->parseNodeToPredicateStr(aCondition, - xMetaData, + xConnection, pController->getNumberFormatter(), _pView->getLocale(), static_cast<sal_Char>(_pView->getDecimalSeparator().toChar()), &pController->getParser().getContext()); pFunction->parseNodeToPredicateStr(aColumnName, - xMetaData, + xConnection, pController->getNumberFormatter(), _pView->getLocale(), static_cast<sal_Char>(_pView->getDecimalSeparator().toChar()), @@ -1511,7 +1510,7 @@ { ::rtl::OUString sParameterValue; pParamNode->parseNodeToStr( sParameterValue, - xConnection->getMetaData(), + xConnection, &pController->getParser().getContext()); nFunctionType |= FKT_NUMERIC; aDragLeft->SetField(sParameterValue); @@ -1636,7 +1635,7 @@ Reference< XDatabaseMetaData > xMetaData = xConnection->getMetaData(); for (; i >= 0; i--) pCondition->getChild(i)->parseNodeToPredicateStr(aCondition, - xMetaData, + xConnection, pController->getNumberFormatter(), _pView->getLocale(), static_cast<sal_Char>(_pView->getDecimalSeparator().toChar()), @@ -1671,15 +1670,14 @@ Reference< XConnection> xConnection = pController->getConnection(); if(xConnection.is()) { - Reference< XDatabaseMetaData > xMetaData = xConnection->getMetaData(); pLhs->parseNodeToStr(aName, - xMetaData, + xConnection, &pController->getParser().getContext(), sal_True); // Kriterium aCondition = pCondition->getChild(1)->getTokenValue(); pRhs->parseNodeToPredicateStr(aCondition, - xMetaData, + xConnection, pController->getNumberFormatter(), _pView->getLocale(), static_cast<sal_Char>(_pView->getDecimalSeparator().toChar()), @@ -2079,7 +2077,6 @@ if ( !xConnection.is() ) break; - Reference< XDatabaseMetaData > xMetaData = xConnection->getMetaData(); ::rtl::OUString aColumnAlias(pController->getParseIterator().getColumnAlias(pColumnRef)); // kann leer sein pColumnRef = pColumnRef->getChild(0); OTableFieldDescRef aInfo = new OTableFieldDesc(); @@ -2103,7 +2100,7 @@ { ::rtl::OUString aColumns; pColumnRef->parseNodeToStr( aColumns, - xMetaData, + xConnection, &pController->getParser().getContext(), sal_True, sal_True); // quote is to true because we need quoted elements inside the function @@ -2145,7 +2142,7 @@ nFunctionType |= FKT_NUMERIC; sFieldName = ::rtl::OUString(); pParamRef->parseNodeToStr( sFieldName, - xMetaData, + xConnection, &pController->getParser().getContext(), sal_True, sal_True); // quote is to true because we need quoted elements inside the function @@ -2179,7 +2176,7 @@ { ::rtl::OUString aColumns; pColumnRef->parseNodeToStr( aColumns, - xMetaData, + xConnection, &pController->getParser().getContext(), sal_True, sal_True); // quote is to true because we need quoted elements inside the function @@ -2272,10 +2269,9 @@ Reference< XConnection> xConnection = pController->getConnection(); if(xConnection.is()) { - Reference< XDatabaseMetaData > xMetaData = xConnection->getMetaData(); ::rtl::OUString sCondition; pArgument->parseNodeToPredicateStr(sCondition, - xMetaData, + xConnection, pController->getNumberFormatter(), _pView->getLocale(), static_cast<sal_Char>(_pView->getDecimalSeparator().toChar()), File [changed]: SelectionBrowseBox.cxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx?r1=1.76&r2=1.76.16.1 Delta lines: +15 -16 --------------------- --- SelectionBrowseBox.cxx 6 Nov 2006 14:42:51 -0000 1.76 +++ SelectionBrowseBox.cxx 4 Dec 2006 22:41:16 -0000 1.76.16.1 @@ -4,9 +4,9 @@ * * $RCSfile: SelectionBrowseBox.cxx,v $ * - * $Revision: 1.76 $ + * $Revision: 1.76.16.1 $ * - * last change: $Author: kz $ $Date: 2006/11/06 14:42:51 $ + * last change: $Author: fs $ $Date: 2006/12/04 22:41:16 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -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(), File [changed]: SelectionBrowseBox.hxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/ui/querydesign/SelectionBrowseBox.hxx?r1=1.25&r2=1.25.42.1 Delta lines: +4 -4 ------------------- --- SelectionBrowseBox.hxx 12 Oct 2006 13:43:22 -0000 1.25 +++ SelectionBrowseBox.hxx 4 Dec 2006 22:41:16 -0000 1.25.42.1 @@ -4,9 +4,9 @@ * * $RCSfile: SelectionBrowseBox.hxx,v $ * - * $Revision: 1.25 $ + * $Revision: 1.25.42.1 $ * - * last change: $Author: obo $ $Date: 2006/10/12 13:43:22 $ + * last change: $Author: fs $ $Date: 2006/12/04 22:41:16 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -307,7 +307,7 @@ <TRUE/> if an error occured otherwise <FALSE/> */ sal_Bool fillColumnRef( const ::connectivity::OSQLParseNode* _pColumnRef, - const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDatabaseMetaData >& _xMetaData, + const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _rxConnection, OTableFieldDescRef& _pEntry, sal_Bool& _bListAction); sal_Bool fillColumnRef( const ::rtl::OUString& _sColumnName, File [changed]: querycontroller.cxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/ui/querydesign/querycontroller.cxx?r1=1.106&r2=1.106.54.1 Delta lines: +5 -6 ------------------- --- querycontroller.cxx 17 Sep 2006 07:26:55 -0000 1.106 +++ querycontroller.cxx 4 Dec 2006 22:41:16 -0000 1.106.54.1 @@ -4,9 +4,9 @@ * * $RCSfile: querycontroller.cxx,v $ * - * $Revision: 1.106 $ + * $Revision: 1.106.54.1 $ * - * last change: $Author: obo $ $Date: 2006/09/17 07:26:55 $ + * last change: $Author: fs $ $Date: 2006/12/04 22:41:16 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -611,7 +611,7 @@ // change the view of the data m_bDesign = !m_bDesign; ::rtl::OUString sNewStatement; - pNode->parseNodeToStr( sNewStatement, getMetaData() ); + pNode->parseNodeToStr( sNewStatement, getConnection() ); setStatement_fireEvent( sNewStatement ); getContainer()->SaveUIConfig(); switchDesignModeImpl(this,getContainer(),m_bDesign); @@ -1442,8 +1442,7 @@ ::connectivity::OSQLParseNode* pNode = m_aSqlParser.parseTree( aErrorMsg, m_sStatement, m_bDesign ); if(pNode) { - pNode->parseNodeToStr( sTranslatedStmt, - getMetaData()); + pNode->parseNodeToStr( sTranslatedStmt, getConnection() ); delete pNode; } --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
