Tag: cws_src680_qiq User: fs Date: 06/05/12 07:36:34 Modified: /dba/dbaccess/source/ui/misc/ UITools.cxx
Log: #i51143# when creating a view from a query, substitute sub queries File Changes: Directory: /dba/dbaccess/source/ui/misc/ ======================================== File [changed]: UITools.cxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/ui/misc/UITools.cxx?r1=1.59.66.1&r2=1.59.66.2 Delta lines: +35 -2 -------------------- --- UITools.cxx 10 May 2006 11:02:13 -0000 1.59.66.1 +++ UITools.cxx 12 May 2006 14:36:31 -0000 1.59.66.2 @@ -4,9 +4,9 @@ * * $RCSfile: UITools.cxx,v $ * - * $Revision: 1.59.66.1 $ + * $Revision: 1.59.66.2 $ * - * last change: $Author: fs $ $Date: 2006/05/10 11:02:13 $ + * last change: $Author: fs $ $Date: 2006/05/12 14:36:31 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -57,6 +57,9 @@ #ifndef _COMPHELPER_EXTRACT_HXX_ #include <comphelper/extract.hxx> #endif +#ifndef _COM_SUN_STAR_SDB_XSINGLESELECTQUERYANALYZER_HPP_ +#include <com/sun/star/sdb/XSingleSelectQueryAnalyzer.hpp> +#endif #ifndef _COM_SUN_STAR_SDB_XCOMPLETEDCONNECTION_HPP_ #include <com/sun/star/sdb/XCompletedConnection.hpp> #endif @@ -277,6 +280,9 @@ #ifndef _URLOBJ_HXX #include <tools/urlobj.hxx> #endif +#ifndef TOOLS_DIAGNOSE_EX_H +#include <tools/diagnose_ex.h> +#endif #ifndef _NUMUNO_HXX #include <svtools/numuno.hxx> #endif @@ -1681,6 +1687,28 @@ } return aAsk.Execute(); } + +// ----------------------------------------------------------------------------- +namespace +{ + static ::rtl::OUString lcl_createSDBCLevelStatement( const ::rtl::OUString& _rStatement, const Reference< XConnection >& _rxConnection ) + { + ::rtl::OUString sSDBCLevelStatement( _rStatement ); + try + { + Reference< XMultiServiceFactory > xAnalyzerFactory( _rxConnection, UNO_QUERY_THROW ); + Reference< XSingleSelectQueryAnalyzer > xAnalyzer( xAnalyzerFactory->createInstance( SERVICE_NAME_SINGLESELECTQUERYCOMPOSER ), UNO_QUERY_THROW ); + xAnalyzer->setQuery( _rStatement ); + sSDBCLevelStatement = xAnalyzer->getQueryWithSubstitution(); + } + catch( const Exception& ) + { + DBG_UNHANDLED_EXCEPTION(); + } + return sSDBCLevelStatement; + } +} + // ----------------------------------------------------------------------------- Reference<XPropertySet> createView( const ::rtl::OUString& _sName ,const Reference< ::com::sun::star::sdbc::XConnection >& _xConnection @@ -1715,6 +1743,11 @@ if(_xSourceObject->getPropertySetInfo()->hasPropertyByName(PROPERTY_COMMAND)) { _xSourceObject->getPropertyValue(PROPERTY_COMMAND) >>= sCommand; + + sal_Bool bEscapeProcessing( sal_False ); + OSL_VERIFY( _xSourceObject->getPropertyValue( PROPERTY_USE_ESCAPE_PROCESSING ) >>= bEscapeProcessing ); + if ( bEscapeProcessing ) + sCommand = lcl_createSDBCLevelStatement( sCommand, _xConnection ); } else { --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
