Tag: cws_src680_qiq User: fs Date: 06/06/01 05:32:51 Modified: /dba/dbaccess/source/core/api/ query.cxx
Log: #i51143# also try to retrieve columns if the EscapeProcessing is FALSE - may be we're lucky ... (needed when such a query is added to the query designer) File Changes: Directory: /dba/dbaccess/source/core/api/ ========================================= File [changed]: query.cxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/core/api/query.cxx?r1=1.29&r2=1.29.124.1 Delta lines: +37 -42 --------------------- --- query.cxx 8 Sep 2005 10:07:30 -0000 1.29 +++ query.cxx 1 Jun 2006 12:32:48 -0000 1.29.124.1 @@ -4,9 +4,9 @@ * * $RCSfile: query.cxx,v $ * - * $Revision: 1.29 $ + * $Revision: 1.29.124.1 $ * - * last change: $Author: rt $ $Date: 2005/09/08 10:07:30 $ + * last change: $Author: fs $ $Date: 2006/06/01 12:32:48 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -185,29 +185,26 @@ } // fill the columns with columns from the statement - Reference< XSQLQueryComposerFactory > xFactory(m_xConnection, UNO_QUERY); - Reference< XSQLQueryComposer > xComposer; - if ( xFactory.is() && m_bEscapeProcessing ) - { + Reference< XSQLQueryComposerFactory > xFactory( m_xConnection, UNO_QUERY_THROW ); + Reference< XSQLQueryComposer > xComposer( xFactory->createQueryComposer(), UNO_QUERY_THROW ); + try { - xComposer = xFactory->createQueryComposer(); + xComposer->setQuery(m_sCommand); } - catch (Exception&) + catch( const SQLException& ) { - xComposer = NULL; + if ( m_bEscapeProcessing ) + // with escape processing, this is expected to succeed. It didn't, + // so handle this below + throw; } - } - if(xComposer.is()) - { - xComposer->setQuery(m_sCommand); - // xComposer->setFilter(::rtl::OUString::createFromAscii("0=1")); // i21125 - // aFilterStatement = m_xComposer->getComposedQuery(); Reference<XColumnsSupplier> xCols(xComposer,UNO_QUERY); Reference< XNameAccess > xColumns = xCols->getColumns(); - if(xColumns.is()) - { + if ( !xColumns.is() ) + return; + Sequence< ::rtl::OUString> aNames = xColumns->getElementNames(); const ::rtl::OUString* pBegin = aNames.getConstArray(); const ::rtl::OUString* pEnd = pBegin + aNames.getLength(); @@ -223,8 +220,6 @@ Reference<XPropertySet> xDest(*pColumn,UNO_QUERY); if ( m_pMediator ) m_pMediator->notifyElementCreated(*pBegin,xDest); - } - } } } catch( const SQLContext& e ) --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
