Tag: cws_src680_qiq User: fs Date: 06/05/11 04:27:20 Modified: /dba/dbaccess/source/ui/app/ AppControllerDnD.cxx
Log: #i51143# respect connection warnings when connecting File Changes: Directory: /dba/dbaccess/source/ui/app/ ======================================= File [changed]: AppControllerDnD.cxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/ui/app/AppControllerDnD.cxx?r1=1.14&r2=1.14.76.1 Delta lines: +30 -3 -------------------- --- AppControllerDnD.cxx 3 Jan 2006 16:15:19 -0000 1.14 +++ AppControllerDnD.cxx 11 May 2006 11:27:17 -0000 1.14.76.1 @@ -4,9 +4,9 @@ * * $RCSfile: AppControllerDnD.cxx,v $ * - * $Revision: 1.14 $ + * $Revision: 1.14.76.1 $ * - * last change: $Author: kz $ $Date: 2006/01/03 16:15:19 $ + * last change: $Author: fs $ $Date: 2006/05/11 11:27:17 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -42,6 +42,9 @@ #ifndef DBACCESS_SHARED_DBUSTRINGS_HRC #include "dbustrings.hrc" #endif +#ifndef _COM_SUN_STAR_SDBC_XWARNINGSSUPPLIER_HPP_ +#include <com/sun/star/sdbc/XWarningsSupplier.hpp> +#endif #ifndef _COM_SUN_STAR_SDB_XSINGLESELECTQUERYCOMPOSER_HPP_ #include <com/sun/star/sdb/XSingleSelectQueryComposer.hpp> #endif @@ -205,6 +208,9 @@ #ifndef _SVT_FILEVIEW_HXX #include <svtools/fileview.hxx> #endif +#ifndef TOOLS_DIAGNOSE_EX_H +#include <tools/diagnose_ex.h> +#endif //........................................................................ namespace dbaui @@ -464,6 +470,27 @@ m_xDataSourceConnection.reset( connect( getDatabaseName(), sConnectingContext, rtl::OUString(), sal_True ) ); if ( m_xDataSourceConnection.is() ) m_xMetaData = m_xDataSourceConnection->getMetaData(); + + Reference< XWarningsSupplier > xConnectionWarnings( m_xDataSourceConnection, UNO_QUERY ); + if ( xConnectionWarnings.is() ) + { + try + { + Any aWarnings( xConnectionWarnings->getWarnings() ); + if ( aWarnings.hasValue() ) + { + SQLWarning aContext; + aContext.Message = String( ModuleRes( STR_WARNINGS_DURING_CONNECT ) ); + aContext.NextException = aWarnings; + showError( SQLExceptionInfo( aContext ) ); + } + xConnectionWarnings->clearWarnings(); + } + catch( const Exception& ) + { + DBG_UNHANDLED_EXCEPTION(); + } + } // otherwise we got a loop when connecting to db throws an error // if ( !m_xDataSourceConnection.is() ) --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
