Tag: cws_src680_warnings01 User: fs Date: 06/05/18 05:06:25 Modified: /dba/connectivity/source/drivers/mozab/ MConnection.cxx, MDriver.cxx, MDriver.hxx /dba/connectivity/source/drivers/mozab/defs/ wntmsci10
Log: #i65444# File Changes: Directory: /dba/connectivity/source/drivers/mozab/ ================================================== File [changed]: MConnection.cxx Url: http://dba.openoffice.org/source/browse/dba/connectivity/source/drivers/mozab/MConnection.cxx?r1=1.19.28.5&r2=1.19.28.6 Delta lines: +3 -10 -------------------- --- MConnection.cxx 7 Apr 2006 20:22:18 -0000 1.19.28.5 +++ MConnection.cxx 18 May 2006 12:06:19 -0000 1.19.28.6 @@ -4,9 +4,9 @@ * * $RCSfile: MConnection.cxx,v $ * - * $Revision: 1.19.28.5 $ + * $Revision: 1.19.28.6 $ * - * last change: $Author: sb $ $Date: 2006/04/07 20:22:18 $ + * last change: $Author: fs $ $Date: 2006/05/18 12:06:19 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -79,13 +79,6 @@ { return (new connectivity::mozab::OConnection( reinterpret_cast<connectivity::mozab::MozabDriver*>(_pDriver) )); } - -extern "C" const void* SAL_CALL getSdbcScheme( short _nScheme ) -{ - return static_cast< const void* >( - ::connectivity::mozab::getSdbcScheme( static_cast< ::connectivity::mozab::SdbcScheme >( _nScheme ) ) ); -} - using namespace dbtools; File [changed]: MDriver.cxx Url: http://dba.openoffice.org/source/browse/dba/connectivity/source/drivers/mozab/MDriver.cxx?r1=1.14.28.5&r2=1.14.28.6 Delta lines: +45 -42 --------------------- --- MDriver.cxx 20 Apr 2006 14:52:04 -0000 1.14.28.5 +++ MDriver.cxx 18 May 2006 12:06:20 -0000 1.14.28.6 @@ -4,9 +4,9 @@ * * $RCSfile: MDriver.cxx,v $ * - * $Revision: 1.14.28.5 $ + * $Revision: 1.14.28.6 $ * - * last change: $Author: sb $ $Date: 2006/04/20 14:52:04 $ + * last change: $Author: fs $ $Date: 2006/05/18 12:06:20 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -64,7 +64,6 @@ : ODriver_BASE(m_aMutex), m_xMSFactory( _rxFactory ) ,m_hModule(NULL) ,m_pCreationFunc(NULL) - ,m_pSchemeFunction( NULL ) { } // ----------------------------------------------------------------------------- @@ -90,7 +89,6 @@ if(m_hModule) { m_pCreationFunc = NULL; - m_pSchemeFunction = NULL; osl_unloadModule(m_hModule); m_hModule = NULL; } @@ -141,10 +139,12 @@ // -------------------------------------------------------------------------------- Reference< XConnection > SAL_CALL MozabDriver::connect( const ::rtl::OUString& url, const Sequence< PropertyValue >& info ) throw(SQLException, RuntimeException) { - if ( ! acceptsURL(url) ) + if ( !ensureInit() ) + return NULL; + + if ( ! acceptsURL( url ) ) return NULL; // create a new connection with the given properties and append it to our vector - registerClient(); Reference< XConnection > xCon; if (m_pCreationFunc) { @@ -172,12 +172,18 @@ sal_Bool SAL_CALL MozabDriver::acceptsURL( const ::rtl::OUString& url ) throw(SQLException, RuntimeException) { + if ( !ensureInit() ) + return sal_False; + // here we have to look if we support this url format return impl_classifyURL(url) != Unknown; } // -------------------------------------------------------------------------------- Sequence< DriverPropertyInfo > SAL_CALL MozabDriver::getPropertyInfo( const ::rtl::OUString& url, const Sequence< PropertyValue >& /*info*/ ) throw(SQLException, RuntimeException) { + if ( !ensureInit() ) + return Sequence< DriverPropertyInfo >(); + if ( acceptsURL(url) ) { if ( impl_classifyURL(url) != LDAP ) @@ -241,22 +247,21 @@ struct __scheme_map { EDriverType eType; - SdbcScheme eSdbcScheme; + const sal_Char* pScheme; } aSchemeMap[] = { #if defined(WNT) || defined(WIN) - { Outlook, SDBC_OUTLOOK_MAPI }, - { OutlookExpress, SDBC_OUTLOOK_EXPRESS }, + { Outlook, "outlook" }, + { OutlookExpress, "outlookexp" }, #endif - { Mozilla, SDBC_MOZILLA }, - { ThunderBird, SDBC_THUNDERBIRD }, - { LDAP, SDBC_LDAP } + { Mozilla, "mozilla" }, + { ThunderBird, "thunderbird" }, + { LDAP, "ldap" } }; for ( size_t i=0; i < sizeof( aSchemeMap ) / sizeof( aSchemeMap[0] ); ++i ) { - const void* scheme = (*m_pSchemeFunction)( static_cast< short >( aSchemeMap[i].eSdbcScheme ) ); - if ( aAddrbookScheme.compareToAscii( static_cast< const sal_Char* >( scheme ) ) == 0 ) + if ( aAddrbookScheme.compareToAscii( aSchemeMap[i].pScheme ) == 0 ) return aSchemeMap[i].eType; } @@ -286,29 +291,29 @@ } // ----------------------------------------------------------------------------- -void MozabDriver::registerClient() +bool MozabDriver::ensureInit() { - if (!m_hModule) - { - OSL_ENSURE(NULL == m_pCreationFunc, "MozabDriver::registerClient: inconsistence: already have a factory function!"); + if ( m_hModule ) + return true; + + OSL_ENSURE(NULL == m_pCreationFunc, "MozabDriver::ensureInit: inconsistence: already have a factory function!"); const ::rtl::OUString sModuleName = ::rtl::OUString::createFromAscii(SAL_MODULENAME( "mozabdrv2" )); // load the dbtools library m_hModule = osl_loadModule(sModuleName.pData, 0); - OSL_ENSURE(NULL != m_hModule, "MozabDriver::registerClient: could not load the dbtools library!"); + OSL_ENSURE(NULL != m_hModule, "MozabDriver::ensureInit: could not load the dbtools library!"); if ( !m_hModule ) - return; + return false; OSetMozabServiceFactory pSetFactoryFunc( NULL ); - lcl_getFunctionFromModuleOrUnload( m_hModule, "getSdbcScheme", m_pSchemeFunction ); lcl_getFunctionFromModuleOrUnload( m_hModule, "setMozabServiceFactory", pSetFactoryFunc ); lcl_getFunctionFromModuleOrUnload( m_hModule, "OMozabConnection_CreateInstance", m_pCreationFunc ); if ( !m_hModule ) // one of the symbols did not exist - return; + return false; if ( m_xMSFactory.is() ) { @@ -317,9 +322,7 @@ m_xMSFactory->acquire(); ( *pSetFactoryFunc )( m_xMSFactory.get() ); } - } + + return true; } // ----------------------------------------------------------------------------- - - - File [changed]: MDriver.hxx Url: http://dba.openoffice.org/source/browse/dba/connectivity/source/drivers/mozab/MDriver.hxx?r1=1.7.30.2&r2=1.7.30.3 Delta lines: +3 -3 ------------------- --- MDriver.hxx 29 Mar 2006 12:39:24 -0000 1.7.30.2 +++ MDriver.hxx 18 May 2006 12:06:21 -0000 1.7.30.3 @@ -4,9 +4,9 @@ * * $RCSfile: MDriver.hxx,v $ * - * $Revision: 1.7.30.2 $ + * $Revision: 1.7.30.3 $ * - * last change: $Author: fs $ $Date: 2006/03/29 12:39:24 $ + * last change: $Author: fs $ $Date: 2006/05/18 12:06:21 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -91,7 +91,7 @@ OMozabConnection_CreateInstanceFunction m_pCreationFunc; OGetSdbcScheme_Function m_pSchemeFunction; - void registerClient(); + bool ensureInit(); virtual ~MozabDriver(); public: Directory: /dba/connectivity/source/drivers/mozab/defs/ ======================================================= File [changed]: wntmsci10 Url: http://dba.openoffice.org/source/browse/dba/connectivity/source/drivers/mozab/defs/wntmsci10?r1=1.78.16.3&r2=1.78.16.4 Delta lines: +10 -0 -------------------- --- wntmsci10 29 Mar 2006 12:39:24 -0000 1.78.16.3 +++ wntmsci10 18 May 2006 12:06:22 -0000 1.78.16.4 @@ -397,3 +397,13 @@ ??Hrtl@@[EMAIL PROTECTED]@[EMAIL PROTECTED]@Z [EMAIL PROTECTED]@rtl@@[EMAIL PROTECTED]@@Z [EMAIL PROTECTED]@[EMAIL PROTECTED]@@[EMAIL PROTECTED]@[EMAIL PROTECTED]@@@Z [EMAIL PROTECTED]@[EMAIL PROTECTED]@@[EMAIL PROTECTED]@Z [EMAIL PROTECTED]@[EMAIL PROTECTED]@@[EMAIL PROTECTED]@Z [EMAIL PROTECTED]@[EMAIL PROTECTED]@@[EMAIL PROTECTED]@Z [EMAIL PROTECTED]@[EMAIL PROTECTED]@@[EMAIL PROTECTED]@[EMAIL PROTECTED]@[EMAIL PROTECTED]@@[EMAIL PROTECTED]@[EMAIL PROTECTED]@[EMAIL PROTECTED]@[EMAIL PROTECTED]@com@@[EMAIL PROTECTED]@345@@cppu@@@[EMAIL PROTECTED]@[EMAIL PROTECTED]@@@osl@@[EMAIL PROTECTED]@[EMAIL PROTECTED]@@[EMAIL PROTECTED]@@[EMAIL PROTECTED]@[EMAIL PROTECTED]@[EMAIL PROTECTED]@@[EMAIL PROTECTED]@[EMAIL PROTECTED]@[EMAIL PROTECTED]@[EMAIL PROTECTED]@com@@[EMAIL PROTECTED]@345@@cppu@@@[EMAIL PROTECTED]@osl@@@Z [EMAIL PROTECTED]@[EMAIL PROTECTED]@cppu@@[EMAIL PROTECTED]@[EMAIL PROTECTED]@[EMAIL PROTECTED]@@[EMAIL PROTECTED]@[EMAIL PROTECTED]@[EMAIL PROTECTED]@[EMAIL PROTECTED]@com@@[EMAIL PROTECTED]@345@@cppu@@@[EMAIL PROTECTED]@[EMAIL PROTECTED]@@@osl@@[EMAIL PROTECTED]@[EMAIL PROTECTED]@@[EMAIL PROTECTED]@@[EMAIL PROTECTED]@[EMAIL PROTECTED]@[EMAIL PROTECTED]@@[EMAIL PROTECTED]@[EMAIL PROTECTED]@[EMAIL PROTECTED]@[EMAIL PROTECTED]@com@@[EMAIL PROTECTED]@345@@cppu@@@[EMAIL PROTECTED]@osl@@@[EMAIL PROTECTED]@A [EMAIL PROTECTED]@[EMAIL PROTECTED]@ [EMAIL PROTECTED]@[EMAIL PROTECTED]@ [EMAIL PROTECTED]@[EMAIL PROTECTED]@ [EMAIL PROTECTED]@[EMAIL PROTECTED]@ [EMAIL PROTECTED]@[EMAIL PROTECTED]@ --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
