summaryrefslogtreecommitdiff
path: root/connectivity/source/drivers/mozab/MDriver.cxx
diff options
context:
space:
mode:
authorFrank Schönheit <fs@openoffice.org>2001-10-23 16:45:21 +0000
committerFrank Schönheit <fs@openoffice.org>2001-10-23 16:45:21 +0000
commit86a703dcd78fa70ea5af80bc5641da9433780bf1 (patch)
tree1e60a2f717ee7963357a512bd5546bbf9a232abc /connectivity/source/drivers/mozab/MDriver.cxx
parent12a9ee00bdc8321dad685cdecdccf06dd8247fd3 (diff)
#89577# need to announce the driver's service factory to the mozabdrv library
Diffstat (limited to 'connectivity/source/drivers/mozab/MDriver.cxx')
-rw-r--r--connectivity/source/drivers/mozab/MDriver.cxx19
1 files changed, 17 insertions, 2 deletions
diff --git a/connectivity/source/drivers/mozab/MDriver.cxx b/connectivity/source/drivers/mozab/MDriver.cxx
index f9431f48f0ea..6f09bc518e32 100644
--- a/connectivity/source/drivers/mozab/MDriver.cxx
+++ b/connectivity/source/drivers/mozab/MDriver.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: MDriver.cxx,v $
*
- * $Revision: 1.4 $
+ * $Revision: 1.5 $
*
- * last change: $Author: oj $ $Date: 2001-10-23 09:08:04 $
+ * last change: $Author: fs $ $Date: 2001-10-23 17:45:21 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -280,6 +280,21 @@ void MozabDriver::registerClient()
OSL_ENSURE(NULL != s_hModule, "MozabDriver::registerClient: could not load the dbtools library!");
if (NULL != s_hModule)
{
+ // first, we need to announce our service factory to the lib
+ // see the documentation of setMozabServiceFactory for more details
+ const ::rtl::OUString sSetFactoryFuncName( RTL_CONSTASCII_USTRINGPARAM( "setMozabServiceFactory" ) );
+ OSetMozabServiceFactory pSetFactoryFunc =
+ reinterpret_cast< OSetMozabServiceFactory >( osl_getSymbol( s_hModule, sSetFactoryFuncName.pData ) );
+
+ OSL_ENSURE( pSetFactoryFunc, "MozabDriver::registerClient: missing an entry point!" );
+ if ( pSetFactoryFunc && m_xMSFactory.is() )
+ {
+ // for purpose of transfer safety, the interface needs to be acuired once
+ // (will be release by the callee)
+ m_xMSFactory->acquire();
+ ( *pSetFactoryFunc )( m_xMSFactory.get() );
+ }
+
// get the symbol for the method creating the factory
const ::rtl::OUString sFactoryCreationFunc = ::rtl::OUString::createFromAscii("OMozabConnection_CreateInstance");
s_pCreationFunc = reinterpret_cast<OMozabConnection_CreateInstanceFunction>(osl_getSymbol(s_hModule, sFactoryCreationFunc.pData));