User: vg Date: 05/03/10 08:45:22 Modified: /dba/dbaccess/source/ui/browser/ dbloader.cxx
Log: INTEGRATION: CWS dba24 (1.20.22); FILE MERGED 2005/02/18 12:35:38 oj 1.20.22.2: #i42460# changes for the separation of datasource and database document(model) 2005/02/03 13:52:13 oj 1.20.22.1: #i41913# release view if exception occured while loading File Changes: Directory: /dba/dbaccess/source/ui/browser/ =========================================== File [changed]: dbloader.cxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/ui/browser/dbloader.cxx?r1=1.20&r2=1.21 Delta lines: +19 -11 --------------------- --- dbloader.cxx 13 Dec 2004 12:23:06 -0000 1.20 +++ dbloader.cxx 10 Mar 2005 16:45:19 -0000 1.21 @@ -122,6 +122,9 @@ #ifndef _SV_SVAPP_HXX #include <vcl/svapp.hxx> #endif +#ifndef DBAUI_TOOLS_HXX +#include "UITools.hxx" +#endif using namespace ::com::sun::star::uno; using namespace ::com::sun::star::frame; @@ -269,9 +272,9 @@ if(bSuccess = xController.is()) { + Reference<XModel> xModel; if ( bAttachModel ) { - Reference<XModel> xModel; PropertyValue aValue; const PropertyValue* pIter = m_aArgs.getConstArray(); const PropertyValue* pEnd = pIter + m_aArgs.getLength(); @@ -280,21 +283,17 @@ { if(0 == pIter->Name.compareToAscii(PROPERTY_DATASOURCE)) { - xModel.set(pIter->Value,UNO_QUERY); + Reference<XDataSource> xProp(pIter->Value,UNO_QUERY); + xModel.set(getDataSourceOrModel(xProp),UNO_QUERY); break; } else if(0 == pIter->Name.compareToAscii(PROPERTY_DATASOURCENAME)) { ::rtl::OUString sDataSource; pIter->Value >>= sDataSource; + Reference< XNameAccess > xDatabaseContext(m_xServiceFactory->createInstance(SERVICE_SDB_DATABASECONTEXT), UNO_QUERY); - try - { - xModel.set(xDatabaseContext->getByName(sDataSource),UNO_QUERY); - } - catch(Exception) - { - } + xModel.set(getDataSourceOrModel(getDataSourceByName_displayError(xDatabaseContext,sDataSource,NULL,m_xServiceFactory,sal_False)),UNO_QUERY); break; } else if ( 0 == pIter->Name.compareToAscii( PROPERTY_ACTIVECONNECTION ) ) @@ -304,7 +303,7 @@ { OSL_ENSURE( Reference< XDataSource >( xAsChild->getParent(), UNO_QUERY ).is(), "DBContentLoader::load: a connection whose parent is no data source?" ); - xModel = xModel.query( xAsChild->getParent() ); + xModel.set(getDataSourceOrModel( xAsChild->getParent() ),UNO_QUERY); } } } @@ -350,6 +349,15 @@ catch(Exception&) { bSuccess = sal_False; + try + { + xController->attachModel(NULL); + xModel->disconnectController( xController ); + } + catch( const Exception& ) + { + OSL_ENSURE( sal_False, "DBContentLoader::load: caught an exception!" ); + } } } --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
