Tag: cws_dev300_dba30d User: oj Date: 2008-05-28 11:36:07+0000 Modified: dba/dbaccess/source/ui/querydesign/QueryDesignView.cxx
Log: #i78725# new method for column alias in order by 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.92&r2=1.92.8.1 Delta lines: +7 -5 ------------------- --- QueryDesignView.cxx 2008-05-05 16:05:19+0000 1.92 +++ QueryDesignView.cxx 2008-05-28 11:36:04+0000 1.92.8.1 @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: QueryDesignView.cxx,v $ - * $Revision: 1.92 $ + * $Revision: 1.92.8.1 $ * * This file is part of OpenOffice.org. * @@ -1056,7 +1056,8 @@ sal_Bool bMulti, ::rtl::OUString& _rsRet) { - Reference< XConnection> xConnection = static_cast<OQueryController*>(_pView->getController())->getConnection(); + const OQueryController* pController = static_cast<OQueryController*>(_pView->getController()); + Reference< XConnection> xConnection = pController->getConnection(); if ( !xConnection.is() ) return eNoConnection; @@ -1066,6 +1067,7 @@ ::rtl::OUString aWorkStr; try { + const bool bColumnAliasInOrderBy = pController->getSdbMetaData().supportsColumnAliasInOrderBy(); Reference< XDatabaseMetaData > xMetaData = xConnection->getMetaData(); ::rtl::OUString aQuote = xMetaData->getIdentifierQuoteString(); // * darf keine Filter enthalten : habe ich die entsprechende Warnung schon angezeigt ? @@ -1091,7 +1093,7 @@ continue; } - if ( pEntryField->GetFieldAlias().getLength() ) + if ( bColumnAliasInOrderBy && pEntryField->GetFieldAlias().getLength() ) { aWorkStr += ::dbtools::quoteName(aQuote, pEntryField->GetFieldAlias()); } @@ -1132,7 +1134,7 @@ if ( aWorkStr.getLength() ) { - sal_Int32 nMaxOrder = xMetaData->getMaxColumnsInOrderBy(); + const sal_Int32 nMaxOrder = xMetaData->getMaxColumnsInOrderBy(); String sToken(aWorkStr); if ( nMaxOrder && nMaxOrder < sToken.GetTokenCount(',') ) eErrorCode = eStatementTooLong; --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
