User: obo Date: 2006/07/10 08:22:57 Modified: dba/dbaccess/source/ui/app/AppControllerDnD.cxx
Log: INTEGRATION: CWS qiq (1.14.76); FILE MERGED 2006/06/27 12:11:45 fs 1.14.76.7: RESYNC: (1.14-1.15); FILE MERGED 2006/05/18 09:16:11 fs 1.14.76.6: #i51143# when creating/pasting/saving a table/query, care for name collisions with both tables and queries (usign a DynamicTableOrQueryNameCheck), if the database supports queries in queries 2006/05/17 11:43:31 fs 1.14.76.5: refactored OSaveAsDlg in preparation of #i51143# 2006/05/15 14:22:14 fs 1.14.76.4: #i51143# display of warnings moved to the DataSourceConnector class 2006/05/12 13:46:59 fs 1.14.76.3: #i51143# refactoring of controller initialization, which allows accessing the load arguments even during Construct (and not only in the - later - impl_initialize) 2006/05/12 11:12:31 fs 1.14.76.2: WARNINGS_DURING_CONNECT with SQLContext, not SQLWarning 2006/05/11 11:27:17 fs 1.14.76.1: #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.15&r2=1.16 Delta lines: +31 -39 --------------------- --- AppControllerDnD.cxx 20 Jun 2006 02:53:40 -0000 1.15 +++ AppControllerDnD.cxx 10 Jul 2006 15:22:54 -0000 1.16 @@ -111,6 +111,9 @@ #ifndef _CPPUHELPER_TYPEPROVIDER_HXX_ #include <cppuhelper/typeprovider.hxx> #endif +#ifndef _CPPUHELPER_EXC_HLP_HXX_ +#include <cppuhelper/exc_hlp.hxx> +#endif #ifndef _DBHELPER_DBEXCEPTION_HXX_ #include <connectivity/dbexception.hxx> #endif @@ -205,6 +208,12 @@ #ifndef _SVT_FILEVIEW_HXX #include <svtools/fileview.hxx> #endif +#ifndef TOOLS_DIAGNOSE_EX_H +#include <tools/diagnose_ex.h> +#endif +#ifndef DBACCESS_SOURCE_UI_MISC_DEFAULTOBJECTNAMECHECK_HXX +#include "defaultobjectnamecheck.hxx" +#endif //........................................................................ namespace dbaui @@ -391,15 +400,15 @@ aObsolete = aNextObsolete; } } - catch(SQLException& e) + catch(const SQLException&) { - showError( SQLExceptionInfo(e) ); + showError( SQLExceptionInfo( ::cppu::getCaughtException() ) ); } catch(WrappedTargetException& e) { SQLException aSql; - if(e.TargetException >>= aSql) - showError( SQLExceptionInfo( aSql ) ); + if ( e.TargetException >>= aSql ) + showError( SQLExceptionInfo( e.TargetException ) ); else OSL_ENSURE( sal_False, "OApplicationController::deleteObjects: something strange happended!" ); } @@ -570,23 +579,8 @@ } } // ----------------------------------------------------------------------------- -void OApplicationController::impl_initialize( const Sequence< Any >& aArguments ) +void OApplicationController::impl_initialize() { - (void)aArguments; -#if OSL_DEBUG_LEVEL > 0 - const Any* pIter = aArguments.getConstArray(); - const Any* pEnd = pIter + aArguments.getLength(); - PropertyValue aProp; - for(;pIter != pEnd;++pIter) - { - if ( (*pIter >>= aProp) && aProp.Name == URL_INTERACTIVE ) - { - DBG_ERROR( "OApplicationController::impl_initialize: who's still using the 'Interactive' flag?" ); - break; - } - } -#endif - Reference<XModifiable> xModi(m_xModel,UNO_QUERY); m_bCurrentlyModified = (xModi.is() && xModi->isModified()); } @@ -651,9 +645,8 @@ { xConnection = ensureConnection(); } - catch(SQLContext& e) { showError(SQLExceptionInfo(e)); } - catch(SQLWarning& e) { showError(SQLExceptionInfo(e)); } - catch(SQLException& e) { showError(SQLExceptionInfo(e)); } + catch(const SQLException&) { showError( SQLExceptionInfo( ::cppu::getCaughtException() ) ); } + OSL_ENSURE(xNameAccess.is(),"Data source doesn't return a name access -> GPF"); return ::std::auto_ptr<OLinkedDocumentsAccess>( new OLinkedDocumentsAccess( getView(), getORB(), xNameAccess, xConnection, getDatabaseName() ) ); @@ -713,9 +706,9 @@ // the owner ship goes to ODataClipboards return pData; } - catch(SQLException& e) + catch(const SQLException&) { - showError(SQLExceptionInfo(e)); + showError( SQLExceptionInfo( ::cppu::getCaughtException() ) ); } catch(Exception&) { @@ -754,7 +747,7 @@ bValidDescriptor = (0 != sCommand.getLength()); if (!bValidDescriptor) { - DBG_ERROR("OApplicationController::pasteQuery: invalid descriptor!"); + DBG_ERROR("OApplicationController::paste: invalid descriptor!"); return sal_False; } @@ -814,7 +807,7 @@ if (!bSuccess) { - DBG_ERROR("OApplicationController::pasteQuery: could not extract the source query object!"); + DBG_ERROR("OApplicationController::paste: could not extract the source query object!"); // TODO: maybe this is worth an error message to be displayed to the user .... return sal_False; } @@ -825,18 +818,19 @@ Reference< XSingleServiceFactory > xQueryFactory(xDestQueries, UNO_QUERY); if (!xQueryFactory.is()) { - DBG_ERROR("OApplicationController::pasteQuery: invalid destination query container!"); + DBG_ERROR("OApplicationController::paste: invalid destination query container!"); return sal_False; } // here we have everything needed to create a new query object ... // ... ehm, except a new name + DynamicTableOrQueryNameCheck aNameChecker( getConnection(), CommandType::QUERY ); OSaveAsDlg aAskForName( getView(), CommandType::QUERY, - xDestQueries.get(), - Reference< XDatabaseMetaData>(), - Reference< XConnection>(), + getORB(), + getConnection(), sTargetName, + aNameChecker, SAD_ADDITIONAL_DESCRIPTION | SAD_TITLE_PASTE_AS); if ( RET_OK != aAskForName.Execute() ) // cancelled by the user @@ -846,7 +840,7 @@ // create a new object Reference< XPropertySet > xNewQuery(xQueryFactory->createInstance(), UNO_QUERY); - DBG_ASSERT(xNewQuery.is(), "OApplicationController::pasteQuery: invalid object created by factory!"); + DBG_ASSERT(xNewQuery.is(), "OApplicationController::paste: invalid object created by factory!"); if (xNewQuery.is()) { // initialize @@ -870,10 +864,8 @@ return insertHierachyElement(_eType,_sParentFolder,Reference<XNameAccess>(xContent,UNO_QUERY).is(),xContent,_bMove); } } - catch(SQLContext& e) { showError(SQLExceptionInfo(e)); } - catch(SQLWarning& e) { showError(SQLExceptionInfo(e)); } - catch(SQLException& e) { showError(SQLExceptionInfo(e)); } - catch(Exception& ) + catch(const SQLException&) { showError( SQLExceptionInfo( ::cppu::getCaughtException() ) ); } + catch(const Exception& ) { DBG_ERROR("OApplicationController::paste: caught a strange exception!"); } --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
