Tag: cws_src680_dba201b User: fs Date: 05/07/20 03:14:11 Modified: /dba/dbaccess/source/ui/app/ AppControllerDnD.cxx
Log: #i51255# XConnection (partly) replaced with SharedConnection 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.10.38.1&r2=1.10.38.2 Delta lines: +15 -54 --------------------- --- AppControllerDnD.cxx 11 Jul 2005 13:56:44 -0000 1.10.38.1 +++ AppControllerDnD.cxx 20 Jul 2005 10:14:08 -0000 1.10.38.2 @@ -2,9 +2,9 @@ * * $RCSfile: AppControllerDnD.cxx,v $ * - * $Revision: 1.10.38.1 $ + * $Revision: 1.10.38.2 $ * - * last change: $Author: fs $ $Date: 2005/07/11 13:56:44 $ + * last change: $Author: fs $ $Date: 2005/07/20 10:14:08 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -618,7 +618,7 @@ // ----------------------------------------------------------------------------- void OApplicationController::impl_initialize( const Sequence< Any >& aArguments ) { - sal_Bool bInteractive = sal_False; +#if OSL_DEBUG_LEVEL > 0 const Any* pIter = aArguments.getConstArray(); const Any* pEnd = pIter + aArguments.getLength(); PropertyValue aProp; @@ -626,60 +626,14 @@ { if ( (*pIter >>= aProp) && aProp.Name == URL_INTERACTIVE ) { - aProp.Value >>= bInteractive; + 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()); - sal_Bool bNew = sal_False; - if ( bInteractive && m_xModel.is() && !m_xModel->getURL().getLength() && getView() ) - { - WinBits nBits(WB_STDMODAL|WB_SAVEAS); - ::sfx2::FileDialogHelper aFileDlg( ::sfx2::FILESAVE_AUTOEXTENSION,static_cast<sal_uInt32>(nBits) ,getView()); - aFileDlg.SetDisplayDirectory( SvtPathOptions().GetWorkPath() ); - - const SfxFilter* pFilter = getStandardDatabaseFilter(); - if ( pFilter ) - { - aFileDlg.AddFilter(pFilter->GetUIName(),pFilter->GetDefaultExtension()); - aFileDlg.SetCurrentFilter(pFilter->GetUIName()); - } - - Reference< XNameAccess > xDatabaseContext(getORB()->createInstance(SERVICE_SDB_DATABASECONTEXT), UNO_QUERY); - if ( xDatabaseContext.is() ) - { - if ( aFileDlg.Execute() == ERRCODE_NONE ) - { - INetURLObject aURL( aFileDlg.GetPath() ); - if( aURL.GetProtocol() != INET_PROT_NOT_VALID ) - { - ::rtl::OUString sFileName = aURL.GetMainURL( INetURLObject::NO_DECODE ); - if ( ::utl::UCBContentHelper::IsDocument(sFileName) ) - ::utl::UCBContentHelper::Kill(sFileName); - try - { - Sequence< PropertyValue > aArgs; - m_xModel->attachResource(sFileName,aArgs); - attachModel(m_xModel); - Reference<XStorable> xStr(m_xModel,UNO_QUERY); - if ( xStr.is() ) - xStr->store(); - - Execute(SID_DB_APP_DSCONNECTION_TYPE,Sequence<PropertyValue>()); - getContainer()->disableControls(isDataSourceReadOnly()); - } - catch(Exception) - { - } - } - } - else - throw Exception(); - } - - } } // ----------------------------------------------------------------------------- void OApplicationController::getSelectionElementNames(::std::vector< ::rtl::OUString>& _rNames) @@ -1008,7 +962,10 @@ if ( !xDestConnection.is() ) return sal_False; - return m_aTableCopyHelper.copyTagTable(_rDesc, _bCheck,xDestConnection); + SharedConnection xConnection( xDestConnection, false /* don't take ownership */ ); + // TODO: migrate ensureConnection to the SharedConnection-API + + return m_aTableCopyHelper.copyTagTable( _rDesc, _bCheck, xConnection ); } // ----------------------------------------------------------------------------- IMPL_LINK( OApplicationController, OnAsyncDrop, void*, NOTINTERESTEDIN ) @@ -1022,8 +979,12 @@ { Reference<XConnection> xDestConnection; // supports the service sdb::connection ensureConnection( xDestConnection); + + SharedConnection xConnection( xDestConnection, false /* don't take ownership */ ); + // TODO: migrate ensureConnection to the SharedConnection-API + if ( xDestConnection.is() ) - m_aTableCopyHelper.asyncCopyTagTable(m_aAsyncDrop,getDatabaseName(),xDestConnection); + m_aTableCopyHelper.asyncCopyTagTable( m_aAsyncDrop, getDatabaseName(), xConnection ); } else { --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
