summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorTor Lillqvist <tml@iki.fi>2012-10-07 07:52:26 +0300
committerTor Lillqvist <tml@iki.fi>2012-10-07 07:59:15 +0300
commit97593ae24a98daca89fad176dc2492e582b3a821 (patch)
treef52189545a5c5ffbc7cece7bca595b2cd18c9cc0 /svx
parent1691752dd29d661552700d9bcac5d3a3953fb91a (diff)
Handle lack of module loading/unloading API when DISABLE_DYNLOADING
There are basicically two classes of cases: 1) Where the code is for obscure historical reasons or what I see as misguided "optimization" split into a more libraries than necessary, and these then are loaded at run-time. Instead, just use direct linking. 2) Where dynamic loading is part of the functionality offered to some upper (scripting etc) layer, or where some system-specific non-LO library is loaded dynamically, as it is not necessarily present on end-user machines. Can't have such in the DISABLE_DYNLOADING case. Change-Id: I9eceac5fb635245def2f4f3320821447bb7cd8c0
Diffstat (limited to 'svx')
-rw-r--r--svx/source/form/dbtoolsclient.cxx15
1 files changed, 15 insertions, 0 deletions
diff --git a/svx/source/form/dbtoolsclient.cxx b/svx/source/form/dbtoolsclient.cxx
index a7a2b03f5d8f..9d87d4bb7804 100644
--- a/svx/source/form/dbtoolsclient.cxx
+++ b/svx/source/form/dbtoolsclient.cxx
@@ -105,8 +105,17 @@ namespace svxform
}
//--------------------------------------------------------------------
+
+#ifndef DISABLE_DYNLOADING
+
extern "C" { static void SAL_CALL thisModule() {} }
+#else
+
+ extern "C" void * createDataAccessToolsFactory();
+
+#endif
+
void ODbtoolsClient::registerClient()
{
::osl::MutexGuard aGuard(theODbtoolsClientMutex::get());
@@ -115,6 +124,7 @@ namespace svxform
OSL_ENSURE(NULL == s_hDbtoolsModule, "ODbtoolsClient::registerClient: inconsistence: already have a module!");
OSL_ENSURE(NULL == s_pFactoryCreationFunc, "ODbtoolsClient::registerClient: inconsistence: already have a factory function!");
+#ifndef DISABLE_DYNLOADING
const ::rtl::OUString sModuleName( SVLIBRARY( "dbtools" )
);
@@ -137,6 +147,9 @@ namespace svxform
s_hDbtoolsModule = NULL;
}
}
+#else
+ s_pFactoryCreationFunc = createDataAccessToolsFactory;
+#endif
}
}
@@ -146,9 +159,11 @@ namespace svxform
::osl::MutexGuard aGuard(theODbtoolsClientMutex::get());
if (0 == --s_nClients)
{
+#ifndef DISABLE_DYNLOADING
s_pFactoryCreationFunc = NULL;
if (s_hDbtoolsModule)
osl_unloadModule(s_hDbtoolsModule);
+#endif
s_hDbtoolsModule = NULL;
}