diff options
51 files changed, 595 insertions, 40 deletions
diff --git a/cppu/source/uno/lbenv.cxx b/cppu/source/uno/lbenv.cxx index 439d49bf8748..1909274c5d2a 100644 --- a/cppu/source/uno/lbenv.cxx +++ b/cppu/source/uno/lbenv.cxx @@ -1054,7 +1054,7 @@ static bool loadEnv(OUString const & cLibStem, { #ifdef DISABLE_DYNLOADING oslModule hMod; - uno_initEnvironmentFunc fpInit = NULL; + uno_initEnvironmentFunc fpInit; if ( cLibStem == CPPU_CURRENT_LANGUAGE_BINDING_NAME "_uno" ) fpInit = CPPU_ENV_uno_initEnvironment; @@ -1083,13 +1083,13 @@ static bool loadEnv(OUString const & cLibStem, OUString aSymbolName(RTL_CONSTASCII_USTRINGPARAM(UNO_INIT_ENVIRONMENT)); uno_initEnvironmentFunc fpInit = (uno_initEnvironmentFunc) ::osl_getFunctionSymbol( hMod, aSymbolName.pData ); -#endif if (!fpInit) { ::osl_unloadModule( hMod ); return false; } +#endif (*fpInit)( pEnv ); // init of environment ::rtl_registerModuleForUnloading( hMod ); diff --git a/cppu/source/uno/loadmodule.cxx b/cppu/source/uno/loadmodule.cxx index 75c7e549bfe8..9271a89e9e90 100644 --- a/cppu/source/uno/loadmodule.cxx +++ b/cppu/source/uno/loadmodule.cxx @@ -29,6 +29,8 @@ namespace cppu { namespace detail { +#ifndef DISABLE_DYNLOADING + ::oslModule loadModule(rtl::OUString const & name) { rtl::OUStringBuffer b; #if defined SAL_DLLPREFIX @@ -42,6 +44,8 @@ namespace cppu { namespace detail { SAL_LOADMODULE_GLOBAL | SAL_LOADMODULE_LAZY); } +#endif + } } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cppu/source/uno/loadmodule.hxx b/cppu/source/uno/loadmodule.hxx index f7f5a25c0de7..afedb7727fa9 100644 --- a/cppu/source/uno/loadmodule.hxx +++ b/cppu/source/uno/loadmodule.hxx @@ -27,6 +27,8 @@ namespace rtl { class OUString; } namespace cppu { namespace detail { +#ifndef DISABLE_DYNLOADING + /** Load a module. @param name @@ -38,6 +40,8 @@ namespace cppu { namespace detail { */ ::oslModule loadModule(::rtl::OUString const & name); +#endif + } } #endif diff --git a/cppuhelper/source/shlib.cxx b/cppuhelper/source/shlib.cxx index b89fc5b1ead7..ed140f00f8a5 100644 --- a/cppuhelper/source/shlib.cxx +++ b/cppuhelper/source/shlib.cxx @@ -595,7 +595,9 @@ Reference< XInterface > SAL_CALL loadSharedLibComponentFactory( if (! xRet.is()) { +#ifndef DISABLE_DYNLOADING osl_unloadModule( lib ); +#endif #if OSL_DEBUG_LEVEL > 1 out( "### cannot activate factory: " ); out( aExcMsg ); diff --git a/dbaccess/source/ui/dlg/odbcconfig.cxx b/dbaccess/source/ui/dlg/odbcconfig.cxx index 5adbbf36b4af..c6047a15639d 100644 --- a/dbaccess/source/ui/dlg/odbcconfig.cxx +++ b/dbaccess/source/ui/dlg/odbcconfig.cxx @@ -133,6 +133,8 @@ sal_Bool OOdbcLibWrapper::load(const sal_Char* _pLibPath) // load the module m_pOdbcLib = osl_loadModule(m_sLibPath.pData, SAL_LOADMODULE_NOW); return (NULL != m_pOdbcLib); +#else + return sal_False; #endif } @@ -289,6 +291,8 @@ void OOdbcEnumeration::getDatasourceNames(StringBag& _rNames) _rNames.insert(aCurrentDsn); } } +#else + (void) _rNames; #endif } diff --git a/dbaccess/source/ui/dlg/odbcconfig.hxx b/dbaccess/source/ui/dlg/odbcconfig.hxx index d24b57afd6ab..7ecadd29c9e9 100644 --- a/dbaccess/source/ui/dlg/odbcconfig.hxx +++ b/dbaccess/source/ui/dlg/odbcconfig.hxx @@ -22,7 +22,7 @@ #include "commontypes.hxx" -#if defined(WNT) || defined (UNX) +#if defined(WNT) || (defined (UNX) && !defined(ANDROID) && !defined(IOS)) #define HAVE_ODBC_SUPPORT #endif diff --git a/filter/source/graphicfilter/egif/egif.cxx b/filter/source/graphicfilter/egif/egif.cxx index 959e3a4a7ece..675f159d4ae0 100644 --- a/filter/source/graphicfilter/egif/egif.cxx +++ b/filter/source/graphicfilter/egif/egif.cxx @@ -558,6 +558,10 @@ void GIFWriter::WriteTerminator() // ------------------------------------------------------------------------ +#ifdef DISABLE_DYNLOADING +#define GraphicExport egiGraphicExport +#endif + extern "C" SAL_DLLPUBLIC_EXPORT sal_Bool __LOADONCALLAPI GraphicExport( SvStream& rStream, Graphic& rGraphic, FilterConfigItem* pConfigItem, sal_Bool ) diff --git a/filter/source/graphicfilter/eos2met/eos2met.cxx b/filter/source/graphicfilter/eos2met/eos2met.cxx index 08280a6c3c4e..6849e5408d1a 100644 --- a/filter/source/graphicfilter/eos2met/eos2met.cxx +++ b/filter/source/graphicfilter/eos2met/eos2met.cxx @@ -2585,6 +2585,10 @@ sal_Bool METWriter::WriteMET( const GDIMetaFile& rMTF, SvStream& rTargetStream, //================== GraphicExport - the exported Function ================ +#ifdef DISABLE_DYNLOADING +#define GraphicExport emeGraphicExport +#endif + extern "C" SAL_DLLPUBLIC_EXPORT sal_Bool __LOADONCALLAPI GraphicExport( SvStream & rStream, Graphic & rGraphic, FilterConfigItem* pFilterConfigItem, sal_Bool ) { METWriter aMETWriter; diff --git a/filter/source/graphicfilter/epbm/epbm.cxx b/filter/source/graphicfilter/epbm/epbm.cxx index 12245693aba5..6fa40f6b69df 100644 --- a/filter/source/graphicfilter/epbm/epbm.cxx +++ b/filter/source/graphicfilter/epbm/epbm.cxx @@ -189,6 +189,10 @@ void PBMWriter::ImplWriteNumber(sal_Int32 nNumber) // - exported function - // --------------------- +#ifdef DISABLE_DYNLOADING +#define GraphicExport epbGraphicExport +#endif + extern "C" SAL_DLLPUBLIC_EXPORT sal_Bool __LOADONCALLAPI GraphicExport(SvStream& rStream, Graphic& rGraphic, FilterConfigItem* pFilterConfigItem, sal_Bool) { diff --git a/filter/source/graphicfilter/epgm/epgm.cxx b/filter/source/graphicfilter/epgm/epgm.cxx index d64539c8e340..ee1531602e5c 100644 --- a/filter/source/graphicfilter/epgm/epgm.cxx +++ b/filter/source/graphicfilter/epgm/epgm.cxx @@ -214,6 +214,10 @@ void PGMWriter::ImplWriteNumber(sal_Int32 nNumber) // - exported function - // --------------------- +#ifdef DISABLE_DYNLOADING +#define GraphicExport epgGraphicExport +#endif + extern "C" SAL_DLLPUBLIC_EXPORT sal_Bool __LOADONCALLAPI GraphicExport(SvStream& rStream, Graphic& rGraphic, FilterConfigItem* pFilterConfigItem, sal_Bool) { diff --git a/filter/source/graphicfilter/epict/epict.cxx b/filter/source/graphicfilter/epict/epict.cxx index bf337c329965..fe1c05c8d20a 100644 --- a/filter/source/graphicfilter/epict/epict.cxx +++ b/filter/source/graphicfilter/epict/epict.cxx @@ -2298,6 +2298,10 @@ sal_Bool PictWriter::WritePict(const GDIMetaFile & rMTF, SvStream & rTargetStrea //================== GraphicExport - the exported Function ================ +#ifdef DISABLE_DYNLOADING +#define GraphicExport eptGraphicExport +#endif + extern "C" SAL_DLLPUBLIC_EXPORT sal_Bool __LOADONCALLAPI GraphicExport(SvStream & rStream, Graphic & rGraphic, FilterConfigItem* pFilterConfigItem, sal_Bool) { diff --git a/filter/source/graphicfilter/eppm/eppm.cxx b/filter/source/graphicfilter/eppm/eppm.cxx index 2948c4d4e9cb..d908002734fd 100644 --- a/filter/source/graphicfilter/eppm/eppm.cxx +++ b/filter/source/graphicfilter/eppm/eppm.cxx @@ -222,6 +222,10 @@ void PPMWriter::ImplWriteNumber(sal_Int32 nNumber) // - exported function - // --------------------- +#ifdef DISABLE_DYNLOADING +#define GraphicExport eppGraphicExport +#endif + extern "C" SAL_DLLPUBLIC_EXPORT sal_Bool __LOADONCALLAPI GraphicExport(SvStream& rStream, Graphic& rGraphic, FilterConfigItem* pFilterConfigItem, sal_Bool) { diff --git a/filter/source/graphicfilter/eps/eps.cxx b/filter/source/graphicfilter/eps/eps.cxx index ec33629f69b5..ba9f1a3dfae8 100644 --- a/filter/source/graphicfilter/eps/eps.cxx +++ b/filter/source/graphicfilter/eps/eps.cxx @@ -2771,6 +2771,10 @@ sal_Bool PSWriter::ImplGetBoundingBox( double* nNumb, sal_uInt8* pSource, sal_uL //================== GraphicExport - die exportierte Funktion ================ +#ifdef DISABLE_DYNLOADING +#define GraphicExport epsGraphicExport +#endif + extern "C" SAL_DLLPUBLIC_EXPORT sal_Bool __LOADONCALLAPI GraphicExport(SvStream & rStream, Graphic & rGraphic, FilterConfigItem* pFilterConfigItem, sal_Bool) { diff --git a/filter/source/graphicfilter/eras/eras.cxx b/filter/source/graphicfilter/eras/eras.cxx index 16e20b3acf3a..350239e7bf36 100644 --- a/filter/source/graphicfilter/eras/eras.cxx +++ b/filter/source/graphicfilter/eras/eras.cxx @@ -269,6 +269,10 @@ void RASWriter::ImplPutByte( sal_uInt8 nPutThis ) // - exported function - // --------------------- +#ifdef DISABLE_DYNLOADING +#define GraphicExport eraGraphicExport +#endif + extern "C" SAL_DLLPUBLIC_EXPORT sal_Bool __LOADONCALLAPI GraphicExport(SvStream& rStream, Graphic& rGraphic, FilterConfigItem* pFilterConfigItem, sal_Bool) { diff --git a/filter/source/graphicfilter/etiff/etiff.cxx b/filter/source/graphicfilter/etiff/etiff.cxx index 7ca35766c322..ee79f50bb777 100644 --- a/filter/source/graphicfilter/etiff/etiff.cxx +++ b/filter/source/graphicfilter/etiff/etiff.cxx @@ -599,6 +599,10 @@ void TIFFWriter::EndCompression() // - exported function - // --------------------- +#ifdef DISABLE_DYNLOADING +#define GraphicExport etiGraphicExport +#endif + extern "C" SAL_DLLPUBLIC_EXPORT sal_Bool __LOADONCALLAPI GraphicExport(SvStream& rStream, Graphic& rGraphic, FilterConfigItem* pFilterConfigItem, sal_Bool) { diff --git a/filter/source/graphicfilter/expm/expm.cxx b/filter/source/graphicfilter/expm/expm.cxx index fd582dadb472..51cafa036ae3 100644 --- a/filter/source/graphicfilter/expm/expm.cxx +++ b/filter/source/graphicfilter/expm/expm.cxx @@ -250,6 +250,10 @@ void XPMWriter::ImplWriteColor( sal_uInt16 nNumber ) // - exported function - // --------------------- +#ifdef DISABLE_DYNLOADING +#define GraphicExport expGraphicExport +#endif + extern "C" SAL_DLLPUBLIC_EXPORT sal_Bool __LOADONCALLAPI GraphicExport(SvStream& rStream, Graphic& rGraphic, FilterConfigItem* pFilterConfigItem, sal_Bool) { diff --git a/filter/source/graphicfilter/idxf/idxf.cxx b/filter/source/graphicfilter/idxf/idxf.cxx index b40dfccf8099..13915ffee0b9 100644 --- a/filter/source/graphicfilter/idxf/idxf.cxx +++ b/filter/source/graphicfilter/idxf/idxf.cxx @@ -29,6 +29,10 @@ class FilterConfigItem; //================== GraphicImport - die exportierte Funktion ================ +#ifdef DISABLE_DYNLOADING +#define GraphicImport idxGraphicImport +#endif + extern "C" SAL_DLLPUBLIC_EXPORT sal_Bool __LOADONCALLAPI GraphicImport(SvStream & rStream, Graphic & rGraphic, FilterConfigItem*, sal_Bool) { diff --git a/filter/source/graphicfilter/ieps/ieps.cxx b/filter/source/graphicfilter/ieps/ieps.cxx index ab56b416465c..252dadd9db66 100644 --- a/filter/source/graphicfilter/ieps/ieps.cxx +++ b/filter/source/graphicfilter/ieps/ieps.cxx @@ -495,6 +495,10 @@ void MakePreview(sal_uInt8* pBuf, sal_uInt32 nBytesRead, //================== GraphicImport - die exportierte Funktion ================ +#ifdef DISABLE_DYNLOADING +#define GraphicImport ipsGraphicImport +#endif + extern "C" SAL_DLLPUBLIC_EXPORT sal_Bool __LOADONCALLAPI GraphicImport(SvStream & rStream, Graphic & rGraphic, FilterConfigItem*, sal_Bool) { diff --git a/filter/source/graphicfilter/ios2met/ios2met.cxx b/filter/source/graphicfilter/ios2met/ios2met.cxx index 4da779f20b59..21dae7b075eb 100644 --- a/filter/source/graphicfilter/ios2met/ios2met.cxx +++ b/filter/source/graphicfilter/ios2met/ios2met.cxx @@ -2719,6 +2719,10 @@ void OS2METReader::ReadOS2MET( SvStream & rStreamOS2MET, GDIMetaFile & rGDIMetaF //================== GraphicImport - die exportierte Funktion ================ +#ifdef DISABLE_DYNLOADING +#define GraphicImport imeGraphicImport +#endif + extern "C" SAL_DLLPUBLIC_EXPORT sal_Bool __LOADONCALLAPI GraphicImport(SvStream & rStream, Graphic & rGraphic, FilterConfigItem*, sal_Bool) { diff --git a/filter/source/graphicfilter/ipbm/ipbm.cxx b/filter/source/graphicfilter/ipbm/ipbm.cxx index fabe4f05530a..abb28ef99b79 100644 --- a/filter/source/graphicfilter/ipbm/ipbm.cxx +++ b/filter/source/graphicfilter/ipbm/ipbm.cxx @@ -520,6 +520,10 @@ sal_Bool PBMReader::ImplReadBody() //================== GraphicImport - die exportierte Funktion ================ +#ifdef DISABLE_DYNLOADING +#define GraphicImport ipbGraphicImport +#endif + extern "C" SAL_DLLPUBLIC_EXPORT sal_Bool __LOADONCALLAPI GraphicImport(SvStream & rStream, Graphic & rGraphic, FilterConfigItem*, sal_Bool) { diff --git a/filter/source/graphicfilter/ipcd/ipcd.cxx b/filter/source/graphicfilter/ipcd/ipcd.cxx index 07e6711d3a2c..f0928fb4a14d 100644 --- a/filter/source/graphicfilter/ipcd/ipcd.cxx +++ b/filter/source/graphicfilter/ipcd/ipcd.cxx @@ -367,6 +367,10 @@ void PCDReader::ReadImage(sal_uLong nMinPercent, sal_uLong nMaxPercent) //================== GraphicImport - the exported Function ================ +#ifdef DISABLE_DYNLOADING +#define GraphicImport icdGraphicImport +#endif + extern "C" SAL_DLLPUBLIC_EXPORT sal_Bool __LOADONCALLAPI GraphicImport(SvStream & rStream, Graphic & rGraphic, FilterConfigItem* pConfigItem, sal_Bool) { diff --git a/filter/source/graphicfilter/ipcx/ipcx.cxx b/filter/source/graphicfilter/ipcx/ipcx.cxx index 324c8abf6f6f..b51c2221ad2f 100644 --- a/filter/source/graphicfilter/ipcx/ipcx.cxx +++ b/filter/source/graphicfilter/ipcx/ipcx.cxx @@ -400,6 +400,10 @@ void PCXReader::ImplReadPalette( sal_uLong nCol ) //================== GraphicImport - die exportierte Funktion ================ +#ifdef DISABLE_DYNLOADING +#define GraphicImport ipxGraphicImport +#endif + extern "C" SAL_DLLPUBLIC_EXPORT sal_Bool __LOADONCALLAPI GraphicImport(SvStream & rStream, Graphic & rGraphic, FilterConfigItem*, sal_Bool) { diff --git a/filter/source/graphicfilter/ipict/ipict.cxx b/filter/source/graphicfilter/ipict/ipict.cxx index 8344a5f44e68..97e90d7b1fac 100644 --- a/filter/source/graphicfilter/ipict/ipict.cxx +++ b/filter/source/graphicfilter/ipict/ipict.cxx @@ -1864,6 +1864,10 @@ void PictReader::ReadPict( SvStream & rStreamPict, GDIMetaFile & rGDIMetaFile ) //================== GraphicImport - die exportierte Funktion ================ +#ifdef DISABLE_DYNLOADING +#define GraphicImport iptGraphicImport +#endif + extern "C" SAL_DLLPUBLIC_EXPORT sal_Bool __LOADONCALLAPI GraphicImport( SvStream& rIStm, Graphic & rGraphic, FilterConfigItem*, sal_Bool) { diff --git a/filter/source/graphicfilter/ipsd/ipsd.cxx b/filter/source/graphicfilter/ipsd/ipsd.cxx index 41bd66c5001f..21597a61553c 100644 --- a/filter/source/graphicfilter/ipsd/ipsd.cxx +++ b/filter/source/graphicfilter/ipsd/ipsd.cxx @@ -720,6 +720,10 @@ sal_Bool PSDReader::ImplReadBody() //================== GraphicImport - the exported function ================ +#ifdef DISABLE_DYNLOADING +#define GraphicImport ipdGraphicImport +#endif + extern "C" SAL_DLLPUBLIC_EXPORT sal_Bool __LOADONCALLAPI GraphicImport(SvStream & rStream, Graphic & rGraphic, FilterConfigItem*, sal_Bool) { diff --git a/filter/source/graphicfilter/iras/iras.cxx b/filter/source/graphicfilter/iras/iras.cxx index 8b690387737a..833d2fefcd83 100644 --- a/filter/source/graphicfilter/iras/iras.cxx +++ b/filter/source/graphicfilter/iras/iras.cxx @@ -338,6 +338,10 @@ sal_uInt8 RASReader::ImplGetByte() //================== GraphicImport - die exportierte Funktion ================ +#ifdef DISABLE_DYNLOADING +#define GraphicImport iraGraphicImport +#endif + extern "C" SAL_DLLPUBLIC_EXPORT sal_Bool __LOADONCALLAPI GraphicImport(SvStream & rStream, Graphic & rGraphic, FilterConfigItem*, sal_Bool) { diff --git a/filter/source/graphicfilter/itga/itga.cxx b/filter/source/graphicfilter/itga/itga.cxx index 40746835bee1..7a00af411362 100644 --- a/filter/source/graphicfilter/itga/itga.cxx +++ b/filter/source/graphicfilter/itga/itga.cxx @@ -742,6 +742,10 @@ sal_Bool TGAReader::ImplReadPalette() //================== GraphicImport - die exportierte Funktion ================ +#ifdef DISABLE_DYNLOADING +#define GraphicImport itgGraphicImport +#endif + extern "C" SAL_DLLPUBLIC_EXPORT sal_Bool __LOADONCALLAPI GraphicImport(SvStream & rStream, Graphic & rGraphic, FilterConfigItem*, sal_Bool) { diff --git a/filter/source/graphicfilter/itiff/itiff.cxx b/filter/source/graphicfilter/itiff/itiff.cxx index 37cbf779fe44..961acdd1ba98 100644 --- a/filter/source/graphicfilter/itiff/itiff.cxx +++ b/filter/source/graphicfilter/itiff/itiff.cxx @@ -1365,6 +1365,10 @@ sal_Bool TIFFReader::ReadTIFF(SvStream & rTIFF, Graphic & rGraphic ) //================== GraphicImport - the exported Function ================ +#ifdef DISABLE_DYNLOADING +#define GraphicImport itiGraphicImport +#endif + extern "C" SAL_DLLPUBLIC_EXPORT sal_Bool __LOADONCALLAPI GraphicImport(SvStream & rStream, Graphic & rGraphic, FilterConfigItem*, sal_Bool) { diff --git a/jvmfwk/source/framework.cxx b/jvmfwk/source/framework.cxx index 324b112b4e7e..2f1760aae209 100644 --- a/jvmfwk/source/framework.cxx +++ b/jvmfwk/source/framework.cxx @@ -53,6 +53,41 @@ sal_Bool areEqualJavaInfo( } } +#ifdef DISABLE_DYNLOADING + +extern "C" +javaPluginError jfw_plugin_getAllJavaInfos( + rtl_uString *sVendor, + rtl_uString *sMinVersion, + rtl_uString *sMaxVersion, + rtl_uString * *arExcludeList, + sal_Int32 nLenList, + JavaInfo*** parJavaInfo, + sal_Int32 *nLenInfoList); + +extern "C" +javaPluginError jfw_plugin_getJavaInfoByPath( + rtl_uString *path, + rtl_uString *sVendor, + rtl_uString *sMinVersion, + rtl_uString *sMaxVersion, + rtl_uString * *arExcludeList, + sal_Int32 nLenList, + JavaInfo ** ppInfo); + +extern "C" +javaPluginError jfw_plugin_startJavaVirtualMachine( + const JavaInfo *pInfo, + const JavaVMOption* arOptions, + sal_Int32 cOptions, + JavaVM ** ppVm, + JNIEnv ** ppEnv); + +extern "C" +javaPluginError jfw_plugin_existJRE(const JavaInfo *pInfo, sal_Bool *exist); + +#endif + javaFrameworkError SAL_CALL jfw_findAllJREs(JavaInfo ***pparInfo, sal_Int32 *pSize) { javaFrameworkError retVal = JFW_E_NONE; @@ -67,12 +102,13 @@ javaFrameworkError SAL_CALL jfw_findAllJREs(JavaInfo ***pparInfo, sal_Int32 *pSi //Get a list of plugins which provide Java information std::vector<jfw::PluginLibrary> vecPlugins = aVendorSettings.getPluginData(); - +#ifndef DISABLE_DYNLOADING //Create a vector that holds the libraries, which will be later //dynamically loaded; boost::scoped_array<osl::Module> sarModules; sarModules.reset(new osl::Module[vecPlugins.size()]); osl::Module * arModules = sarModules.get(); +#endif //Add the JavaInfos found by jfw_plugin_getAllJavaInfos to the vector //Make sure that the contents are destroyed if this //function returns with an error @@ -95,6 +131,7 @@ javaFrameworkError SAL_CALL jfw_findAllJREs(JavaInfo ***pparInfo, sal_Int32 *pSi const jfw::PluginLibrary & library = *i; jfw::VersionInfo versionInfo = aVendorSettings.getVersionInformation(library.sVendor); +#ifndef DISABLE_DYNLOADING arModules[cModule].load(library.sPath); osl::Module & pluginLib = arModules[cModule]; @@ -109,7 +146,10 @@ javaFrameworkError SAL_CALL jfw_findAllJREs(JavaInfo ***pparInfo, sal_Int32 *pSi jfw_plugin_getAllJavaInfos_ptr getAllJavaFunc = (jfw_plugin_getAllJavaInfos_ptr) pluginLib.getFunctionSymbol( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("jfw_plugin_getAllJavaInfos"))); - +#else + jfw_plugin_getAllJavaInfos_ptr getAllJavaFunc = + jfw_plugin_getAllJavaInfos; +#endif OSL_ASSERT(getAllJavaFunc); if (getAllJavaFunc == NULL) return JFW_E_ERROR; @@ -138,10 +178,14 @@ javaFrameworkError SAL_CALL jfw_findAllJREs(JavaInfo ***pparInfo, sal_Int32 *pSi //Check if the current plugin can detect JREs at the location // of the paths added by jfw_setJRELocations or jfw_addJRELocation //get the function from the plugin +#ifndef DISABLE_DYNLOADING jfw_plugin_getJavaInfoByPath_ptr jfw_plugin_getJavaInfoByPathFunc = (jfw_plugin_getJavaInfoByPath_ptr) pluginLib.getFunctionSymbol( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("jfw_plugin_getJavaInfoByPath"))); - +#else + jfw_plugin_getJavaInfoByPath_ptr jfw_plugin_getJavaInfoByPathFunc = + jfw_plugin_getJavaInfoByPath; +#endif OSL_ASSERT(jfw_plugin_getJavaInfoByPathFunc); if (jfw_plugin_getJavaInfoByPathFunc == NULL) return JFW_E_ERROR; @@ -347,6 +391,7 @@ javaFrameworkError SAL_CALL jfw_startVM(JavaVMOption *arOptions, sal_Int32 cOpti if ( ! modulePlugin) return JFW_E_NO_PLUGIN; +#ifndef DISABLE_DYNLOADING rtl::OUString sFunctionName( RTL_CONSTASCII_USTRINGPARAM("jfw_plugin_startJavaVirtualMachine")); jfw_plugin_startJavaVirtualMachine_ptr pFunc = @@ -354,6 +399,10 @@ javaFrameworkError SAL_CALL jfw_startVM(JavaVMOption *arOptions, sal_Int32 cOpti osl_getFunctionSymbol(modulePlugin, sFunctionName.pData); if (pFunc == NULL) return JFW_E_ERROR; +#else + jfw_plugin_startJavaVirtualMachine_ptr pFunc = + jfw_plugin_startJavaVirtualMachine; +#endif // create JavaVMOptions array that is passed to the plugin // it contains the classpath and all options set in the @@ -445,12 +494,13 @@ javaFrameworkError SAL_CALL jfw_findAndSelectJRE(JavaInfo **pInfo) jfw::VendorSettings aVendorSettings; std::vector<jfw::PluginLibrary> vecPlugins = aVendorSettings.getPluginData(); +#ifndef DISABLE_DYNLOADING //Create a vector that holds the libraries, which will be later //dynamically loaded; boost::scoped_array<osl::Module> sarModules; sarModules.reset(new osl::Module[vecPlugins.size()]); osl::Module * arModules = sarModules.get(); - +#endif //Use every plug-in library to get Java installations. At the first usable //Java the loop will break typedef std::vector<jfw::PluginLibrary>::const_iterator ci_pl; @@ -460,7 +510,7 @@ javaFrameworkError SAL_CALL jfw_findAndSelectJRE(JavaInfo **pInfo) const jfw::PluginLibrary & library = *i; jfw::VersionInfo versionInfo = aVendorSettings.getVersionInformation(library.sVendor); - +#ifndef DISABLE_DYNLOADING arModules[cModule].load(library.sPath); osl::Module & pluginLib = arModules[cModule]; if (pluginLib.is() == sal_False) @@ -469,7 +519,10 @@ javaFrameworkError SAL_CALL jfw_findAndSelectJRE(JavaInfo **pInfo) jfw_plugin_getAllJavaInfos_ptr getAllJavaFunc = (jfw_plugin_getAllJavaInfos_ptr) pluginLib.getFunctionSymbol( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("jfw_plugin_getAllJavaInfos"))); - +#else + jfw_plugin_getAllJavaInfos_ptr getAllJavaFunc = + jfw_plugin_getAllJavaInfos; +#endif OSL_ASSERT(getAllJavaFunc); if (getAllJavaFunc == NULL) continue; @@ -542,7 +595,7 @@ javaFrameworkError SAL_CALL jfw_findAndSelectJRE(JavaInfo **pInfo) const jfw::PluginLibrary & library = *i; jfw::VersionInfo versionInfo = aVendorSettings.getVersionInformation(library.sVendor); - +#ifndef DISABLE_DYNLOADING osl::Module pluginLib(library.sPath); if (pluginLib.is() == sal_False) return JFW_E_NO_PLUGIN; @@ -552,7 +605,10 @@ javaFrameworkError SAL_CALL jfw_findAndSelectJRE(JavaInfo **pInfo) jfw_plugin_getJavaInfoByPath_ptr jfw_plugin_getJavaInfoByPathFunc = (jfw_plugin_getJavaInfoByPath_ptr) pluginLib.getFunctionSymbol( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("jfw_plugin_getJavaInfoByPath"))); - +#else + jfw_plugin_getJavaInfoByPath_ptr jfw_plugin_getJavaInfoByPathFunc = + jfw_plugin_getJavaInfoByPath; +#endif OSL_ASSERT(jfw_plugin_getJavaInfoByPathFunc); if (jfw_plugin_getJavaInfoByPathFunc == NULL) return JFW_E_ERROR; @@ -742,12 +798,13 @@ javaFrameworkError SAL_CALL jfw_getJavaInfoByPath( //Get a list of plugins which provide Java information std::vector<jfw::PluginLibrary> vecPlugins = aVendorSettings.getPluginData(); +#ifndef DISABLE_DYNLOADING //Create a vector that holds the libraries, which will be later //dynamically loaded; boost::scoped_array<osl::Module> sarModules; sarModules.reset(new osl::Module[vecPlugins.size()]); osl::Module * arModules = sarModules.get(); - +#endif typedef std::vector<rtl::OUString>::const_iterator CIT_VENDOR; std::vector<rtl::OUString> vecVendors = aVendorSettings.getSupportedVendors(); @@ -762,6 +819,8 @@ javaFrameworkError SAL_CALL jfw_getJavaInfoByPath( const jfw::PluginLibrary & library = *i; jfw::VersionInfo versionInfo = aVendorSettings.getVersionInformation(library.sVendor); + +#ifndef DISABLE_DYNLOADING arModules[cModule].load(library.sPath); osl::Module & pluginLib = arModules[cModule]; if (pluginLib.is() == sal_False) @@ -776,7 +835,10 @@ javaFrameworkError SAL_CALL jfw_getJavaInfoByPath( jfw_plugin_getJavaInfoByPath_ptr jfw_plugin_getJavaInfoByPathFunc = (jfw_plugin_getJavaInfoByPath_ptr) pluginLib.getFunctionSymbol( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("jfw_plugin_getJavaInfoByPath"))); - +#else + jfw_plugin_getJavaInfoByPath_ptr jfw_plugin_getJavaInfoByPathFunc = + jfw_plugin_getJavaInfoByPath; +#endif OSL_ASSERT(jfw_plugin_getJavaInfoByPathFunc); if (jfw_plugin_getJavaInfoByPathFunc == NULL) continue; @@ -1112,6 +1174,7 @@ javaFrameworkError jfw_existJRE(const JavaInfo *pInfo, sal_Bool *exist) jfw::VendorSettings aVendorSettings; jfw::CJavaInfo aInfo; aInfo = (const ::JavaInfo*) pInfo; //makes a copy of pInfo +#ifndef DISABLE_DYNLOADING rtl::OUString sLibPath = aVendorSettings.getPluginLibrary(aInfo.getVendor()); osl::Module modulePlugin(sLibPath); if ( ! modulePlugin) @@ -1123,7 +1186,10 @@ javaFrameworkError jfw_existJRE(const JavaInfo *pInfo, sal_Bool *exist) osl_getFunctionSymbol(modulePlugin, sFunctionName.pData); if (pFunc == NULL) return JFW_E_ERROR; - +#else + jfw_plugin_existJRE_ptr pFunc = + jfw_plugin_existJRE; +#endif javaPluginError plerr = (*pFunc)(pInfo, exist); javaFrameworkError ret = JFW_E_NONE; diff --git a/salhelper/source/dynload.cxx b/salhelper/source/dynload.cxx index 2e392af66ac1..f69ace831168 100644 --- a/salhelper/source/dynload.cxx +++ b/salhelper/source/dynload.cxx @@ -43,6 +43,13 @@ ORealDynamicLoader* ORealDynamicLoader::newInstance(ORealDynamicLoader ** ppSetT const rtl::OUString& moduleName, const rtl::OUString& initFunction) { +#ifdef DISABLE_DYNLOADING + (void) ppSetToZeroInDestructor; + (void) moduleName; + (void) initFunction; + + return NULL; +#else ApiInitFunction initFunc; oslModule pModule = osl_loadModule(moduleName.pData, SAL_LOADMODULE_DEFAULT); @@ -64,6 +71,7 @@ ORealDynamicLoader* ORealDynamicLoader::newInstance(ORealDynamicLoader ** ppSetT initFunction, initFunc(), pModule)); +#endif } ORealDynamicLoader::~ORealDynamicLoader() @@ -74,7 +82,9 @@ ORealDynamicLoader::~ORealDynamicLoader() if (m_pModule) { +#ifndef DISABLE_DYNLOADING osl_unloadModule(m_pModule); +#endif m_pModule = NULL; } } diff --git a/sc/source/core/tool/callform.cxx b/sc/source/core/tool/callform.cxx index 5d20ad29c2f2..8ba120bf861b 100644 --- a/sc/source/core/tool/callform.cxx +++ b/sc/source/core/tool/callform.cxx @@ -89,7 +89,14 @@ friend class ModuleCollection; osl::Module* pInstance; public: ModuleData(const rtl::OUString& rStr, osl::Module* pInst) : aName(rStr), pInstance(pInst) {} - ModuleData(const ModuleData& rData) : aName(rData.aName) {pInstance = new osl::Module(aName);} + ModuleData(const ModuleData& rData) : aName(rData.aName) + { +#ifndef DISABLE_DYNLOADING + pInstance = new osl::Module(aName); +#else + pInstance = NULL; +#endif + } ~ModuleData() { delete pInstance; } const rtl::OUString& GetName() const { return aName; } @@ -174,6 +181,10 @@ ModuleCollection aModuleCollection; bool InitExternalFunc(const rtl::OUString& rModuleName) { +#ifdef DISABLE_DYNLOADING + (void) rModuleName; + return false; +#else // Module already loaded? const ModuleData* pTemp = aModuleCollection.findByName(rModuleName); if (pTemp) @@ -252,6 +263,7 @@ bool InitExternalFunc(const rtl::OUString& rModuleName) else delete pLib; return bRet; +#endif } //------------------------------------------------------------------------ @@ -265,6 +277,10 @@ void ExitExternalFunc() bool FuncData::Call(void** ppParam) const { +#ifdef DISABLE_DYNLOADING + (void) ppParam; + return false; +#else bool bRet = false; osl::Module* pLib = pModuleData->GetInstance(); FARPROC fProc = (FARPROC)pLib->getFunctionSymbol(aFuncName); @@ -354,12 +370,17 @@ bool FuncData::Call(void** ppParam) const } } return bRet; +#endif } //------------------------------------------------------------------------ bool FuncData::Unadvice( double nHandle ) { +#ifdef DISABLE_DYNLOADING + (void) nHandle; + return false; +#else bool bRet = false; osl::Module* pLib = pModuleData->GetInstance(); FARPROC fProc = (FARPROC)pLib->getFunctionSymbol(UNADVICE); @@ -369,6 +390,7 @@ bool FuncData::Unadvice( double nHandle ) bRet = true; } return bRet; +#endif } //------------------------------------------------------------------------ diff --git a/sc/source/ui/attrdlg/scabstdlg.cxx b/sc/source/ui/attrdlg/scabstdlg.cxx index 98b0efae6515..654fb76df9b4 100644 --- a/sc/source/ui/attrdlg/scabstdlg.cxx +++ b/sc/source/ui/attrdlg/scabstdlg.cxx @@ -36,10 +36,19 @@ using ::rtl::OUStringBuffer; typedef ScAbstractDialogFactory* (__LOADONCALLAPI *ScFuncPtrCreateDialogFactory)(); +#ifndef DISABLE_DYNLOADING + extern "C" { static void SAL_CALL thisModule() {} } +#else + +extern "C" ScAbstractDialogFactory* ScCreateDialogFactory(); + +#endif + ScAbstractDialogFactory* ScAbstractDialogFactory::Create() { +#ifndef DISABLE_DYNLOADING ScFuncPtrCreateDialogFactory fp = 0; static ::osl::Module aDialogLibrary; @@ -53,6 +62,9 @@ ScAbstractDialogFactory* ScAbstractDialogFactory::Create() if ( fp ) return fp(); return 0; +#else + return ScCreateDialogFactory(); +#endif } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/attrdlg/scuiexp.cxx b/sc/source/ui/attrdlg/scuiexp.cxx index c2581ea7b578..77e5b2e9f2ea 100644 --- a/sc/source/ui/attrdlg/scuiexp.cxx +++ b/sc/source/ui/attrdlg/scuiexp.cxx @@ -36,6 +36,10 @@ namespace scui } } +#ifdef DISABLE_DYNLOADING +#define CreateDialogFactory ScCreateDialogFactory +#endif + extern "C" { SAL_DLLPUBLIC_EXPORT ScAbstractDialogFactory* CreateDialogFactory() diff --git a/sd/inc/sdfilter.hxx b/sd/inc/sdfilter.hxx index 1f3ea8024930..d44121487001 100644 --- a/sd/inc/sdfilter.hxx +++ b/sd/inc/sdfilter.hxx @@ -57,8 +57,9 @@ protected: SdDrawDocument& mrDocument; sal_Bool mbIsDraw : 1; sal_Bool mbShowProgress : 1; - +#ifndef DISABLE_DYNLOADING ::osl::Module* OpenLibrary( const ::rtl::OUString& rLibraryName ) const; +#endif void CreateStatusIndicator(); private: diff --git a/sd/source/filter/cgm/sdcgmfilter.cxx b/sd/source/filter/cgm/sdcgmfilter.cxx index 6c6ef43ce22a..7135ee81fc1d 100644 --- a/sd/source/filter/cgm/sdcgmfilter.cxx +++ b/sd/source/filter/cgm/sdcgmfilter.cxx @@ -66,8 +66,16 @@ using namespace ::com::sun::star::frame; // - Typedefs - // ------------ -typedef sal_uInt32 ( __LOADONCALLAPI *ImportCGM )( ::rtl::OUString&, Reference< XModel >&, sal_uInt32, Reference< XStatusIndicator >& ); -typedef sal_Bool ( __LOADONCALLAPI *ExportCGM )( ::rtl::OUString&, Reference< XModel >&, Reference< XStatusIndicator >&, void* ); + +typedef sal_uInt32 ( __LOADONCALLAPI *ImportCGMPointer )( ::rtl::OUString&, Reference< XModel >&, sal_uInt32, Reference< XStatusIndicator >& ); +typedef sal_Bool ( __LOADONCALLAPI *ExportCGMPointer )( ::rtl::OUString&, Reference< XModel >&, Reference< XStatusIndicator >&, void* ); + +#ifdef DISABLE_DYNLOADING + +extern "C" sal_uInt32 ImportCGM( ::rtl::OUString&, Reference< XModel >&, sal_uInt32, Reference< XStatusIndicator >& ); +extern "C" sal_Bool ExportCGM( ::rtl::OUString&, Reference< XModel >&, Reference< XStatusIndicator >&, void* ); + +#endif // --------------- // - SdPPTFilter - @@ -88,12 +96,22 @@ SdCGMFilter::~SdCGMFilter() sal_Bool SdCGMFilter::Import() { +#ifndef DISABLE_DYNLOADING ::osl::Module* pLibrary = OpenLibrary( mrMedium.GetFilter()->GetUserData() ); +#endif sal_Bool bRet = sal_False; - if( pLibrary && mxModel.is() ) + if( +#ifndef DISABLE_DYNLOADING + pLibrary && +#endif + mxModel.is() ) { - ImportCGM FncImportCGM = reinterpret_cast< ImportCGM >( pLibrary->getFunctionSymbol( "ImportCGM" ) ); +#ifndef DISABLE_DYNLOADING + ImportCGMPointer FncImportCGM = reinterpret_cast< ImportCGM >( pLibrary->getFunctionSymbol( "ImportCGM" ) ); +#else + ImportCGMPointer FncImportCGM = ImportCGM; +#endif ::rtl::OUString aFileURL( mrMedium.GetURLObject().GetMainURL( INetURLObject::NO_DECODE ) ); sal_uInt32 nRetValue; @@ -122,9 +140,9 @@ sal_Bool SdCGMFilter::Import() } } } - +#ifndef DISABLE_DYNLOADING delete pLibrary; - +#endif return bRet; } @@ -132,12 +150,22 @@ sal_Bool SdCGMFilter::Import() sal_Bool SdCGMFilter::Export() { +#ifndef DISABLE_DYNLOADING ::osl::Module* pLibrary = OpenLibrary( mrMedium.GetFilter()->GetUserData() ); +#endif sal_Bool bRet = sal_False; - if( pLibrary && mxModel.is() ) + if( +#ifndef DISABLE_DYNLOADING + pLibrary && +#endif + mxModel.is() ) { - ExportCGM FncCGMExport = reinterpret_cast< ExportCGM >( pLibrary->getFunctionSymbol( "ExportCGM" ) ); +#ifndef DISABLE_DYNLOADING + ExportCGMPointer FncCGMExport = reinterpret_cast< ExportCGM >( pLibrary->getFunctionSymbol( "ExportCGM" ) ); +#else + ExportCGMPointer FncCGMExport = ExportCGM; +#endif if( FncCGMExport ) { @@ -148,8 +176,9 @@ sal_Bool SdCGMFilter::Export() } } +#ifndef DISABLE_DYNLOADING delete pLibrary; - +#endif return bRet; } diff --git a/sd/source/filter/sdfilter.cxx b/sd/source/filter/sdfilter.cxx index ec245925a3af..d379ffd1780f 100644 --- a/sd/source/filter/sdfilter.cxx +++ b/sd/source/filter/sdfilter.cxx @@ -85,6 +85,7 @@ SdFilter::~SdFilter() // ----------------------------------------------------------------------------- +#ifndef DISABLE_DYNLOADING extern "C" { static void SAL_CALL thisModule() {} } ::osl::Module* SdFilter::OpenLibrary( const ::rtl::OUString& rLibraryName ) const @@ -95,6 +96,8 @@ extern "C" { static void SAL_CALL thisModule() {} } ? mod.release() : 0; } +#endif + // ----------------------------------------------------------------------------- void SdFilter::CreateStatusIndicator() diff --git a/sd/source/filter/sdpptwrp.cxx b/sd/source/filter/sdpptwrp.cxx index 6be40e8e9535..c11c9585ece5 100644 --- a/sd/source/filter/sdpptwrp.cxx +++ b/sd/source/filter/sdpptwrp.cxx @@ -49,14 +49,27 @@ using namespace ::com::sun::star::beans; using namespace ::com::sun::star::task; using namespace ::com::sun::star::frame; -typedef sal_Bool ( __LOADONCALLAPI *ExportPPT )( const std::vector< com::sun::star::beans::PropertyValue >&, SvStorageRef&, +typedef sal_Bool ( __LOADONCALLAPI *ExportPPTPointer )( const std::vector< com::sun::star::beans::PropertyValue >&, SvStorageRef&, Reference< XModel > &, Reference< XStatusIndicator > &, SvMemoryStream*, sal_uInt32 nCnvrtFlags ); -typedef sal_Bool ( SAL_CALL *ImportPPT )( SdDrawDocument*, SvStream&, SvStorage&, SfxMedium& ); +typedef sal_Bool ( SAL_CALL *ImportPPTPointer )( SdDrawDocument*, SvStream&, SvStorage&, SfxMedium& ); -typedef sal_Bool ( __LOADONCALLAPI *SaveVBA )( SfxObjectShell&, SvMemoryStream*& ); +typedef sal_Bool ( __LOADONCALLAPI *SaveVBAPointer )( SfxObjectShell&, SvMemoryStream*& ); + +#ifdef DISABLE_DYNLOADING + +extern "C" sal_Bool ExportPPT( const std::vector< com::sun::star::beans::PropertyValue >&, SvStorageRef&, + Reference< XModel > &, + Reference< XStatusIndicator > &, + SvMemoryStream*, sal_uInt32 nCnvrtFlags ); + +extern "C" sal_Bool ImportPPT( SdDrawDocument*, SvStream&, SvStorage&, SfxMedium& ); + +extern "C" sal_Bool SaveVBA( SfxObjectShell&, SvMemoryStream*& ); + +#endif // --------------- // - SdPPTFilter - @@ -102,16 +115,22 @@ sal_Bool SdPPTFilter::Import() mrMedium.SetError( ERRCODE_SVX_READ_FILTER_PPOINT, OSL_LOG_PREFIX ); else { +#ifndef DISABLE_DYNLOADING ::osl::Module* pLibrary = OpenLibrary( mrMedium.GetFilter()->GetUserData() ); if ( pLibrary ) { - ImportPPT PPTImport = reinterpret_cast< ImportPPT >( pLibrary->getFunctionSymbol( "ImportPPT" ) ); + ImportPPTPointer PPTImport = reinterpret_cast< ImportPPT >( pLibrary->getFunctionSymbol( "ImportPPT" ) ); if ( PPTImport ) bRet = PPTImport( &mrDocument, *pDocStream, *pStorage, mrMedium ); if ( !bRet ) mrMedium.SetError( SVSTREAM_WRONGVERSION, OSL_LOG_PREFIX ); } +#else + bRet = ImportPPT( &mrDocument, *pDocStream, *pStorage, mrMedium ); + if ( !bRet ) + mrMedium.SetError( SVSTREAM_WRONGVERSION, OSL_LOG_PREFIX ); +#endif } delete pDocStream; @@ -125,15 +144,23 @@ sal_Bool SdPPTFilter::Import() sal_Bool SdPPTFilter::Export() { +#ifndef DISABLE_DYNLOADING ::osl::Module* pLibrary = OpenLibrary( mrMedium.GetFilter()->GetUserData() ); +#endif sal_Bool bRet = sal_False; +#ifndef DISABLE_DYNLOADING if( pLibrary ) +#endif { if( mxModel.is() ) { SotStorageRef xStorRef = new SotStorage( mrMedium.GetOutStream(), sal_False ); - ExportPPT PPTExport = reinterpret_cast<ExportPPT>(pLibrary->getFunctionSymbol( "ExportPPT" )); +#ifndef DISABLE_DYNLOADING + ExportPPTPointer PPTExport = reinterpret_cast<ExportPPT>(pLibrary->getFunctionSymbol( "ExportPPT" )); +#else + ExportPPTPointer PPTExport = ExportPPT; +#endif if( PPTExport && xStorRef.Is() ) { @@ -166,7 +193,9 @@ sal_Bool SdPPTFilter::Export() xStorRef->Commit(); } } +#ifndef DISABLE_DYNLOADING delete pLibrary; +#endif } return bRet; } @@ -176,15 +205,19 @@ void SdPPTFilter::PreSaveBasic() const SvtFilterOptions& rFilterOptions = SvtFilterOptions::Get(); if( rFilterOptions.IsLoadPPointBasicStorage() ) { +#ifndef DISABLE_DYNLOADING ::osl::Module* pLibrary = OpenLibrary( mrMedium.GetFilter()->GetUserData() ); if( pLibrary ) { - SaveVBA pSaveVBA= reinterpret_cast<SaveVBA>(pLibrary->getFunctionSymbol( "SaveVBA" )); + SaveVBAPointer pSaveVBA= reinterpret_cast<SaveVBA>(pLibrary->getFunctionSymbol( "SaveVBA" )); if( pSaveVBA ) { pSaveVBA( (SfxObjectShell&) mrDocShell, pBas ); } } +#else + SaveVBA( (SfxObjectShell&) mrDocShell, pBas ); +#endif } } diff --git a/sd/source/ui/dlg/sdabstdlg.cxx b/sd/source/ui/dlg/sdabstdlg.cxx index 520f5a4a4926..6c4951e40ffe 100644 --- a/sd/source/ui/dlg/sdabstdlg.cxx +++ b/sd/source/ui/dlg/sdabstdlg.cxx @@ -35,10 +35,19 @@ typedef SdAbstractDialogFactory* (__LOADONCALLAPI *SdFuncPtrCreateDialogFactory)(); +#ifndef DISABLE_DYNLOADING + extern "C" { static void SAL_CALL thisModule() {} } +#else + +extern "C" SdAbstractDialogFactory* SdCreateDialogFactory(); + +#endif + SdAbstractDialogFactory* SdAbstractDialogFactory::Create() { +#ifndef DISABLE_DYNLOADING SdFuncPtrCreateDialogFactory fp = 0; static ::osl::Module aDialogLibrary; static const ::rtl::OUString sLibName(::vcl::unohelper::CreateLibraryName("sdui", sal_True)); @@ -48,6 +57,9 @@ SdAbstractDialogFactory* SdAbstractDialogFactory::Create() if ( fp ) return fp(); return 0; +#else + return SdCreateDialogFactory(); +#endif } diff --git a/sd/source/ui/dlg/sduiexp.cxx b/sd/source/ui/dlg/sduiexp.cxx index 962f86cdbf5a..d9505a198514 100644 --- a/sd/source/ui/dlg/sduiexp.cxx +++ b/sd/source/ui/dlg/sduiexp.cxx @@ -34,6 +34,10 @@ #include "sddlgfact.hxx" #include "sal/types.h" +#ifdef DISABLE_DYNLOADING +#define CreateDialogFactory SdCreateDialogFactory +#endif + extern "C" { SAL_DLLPUBLIC_EXPORT SdAbstractDialogFactory* CreateDialogFactory() diff --git a/sfx2/source/appl/appinit.cxx b/sfx2/source/appl/appinit.cxx index 4d53e49d5fc5..d79f838118f6 100644 --- a/sfx2/source/appl/appinit.cxx +++ b/sfx2/source/appl/appinit.cxx @@ -166,8 +166,16 @@ typedef bool ( *PFunc_getSpecialCharsForEdit)( Window* i_pParent, const Font& i_ // a library above us. //==================================================================== +#ifndef DISABLE_DYNLOADING + extern "C" { static void SAL_CALL thisModule() {} } +#else + +extern "C" bool GetSpecialCharsForEdit( Window* i_pParent, const Font& i_rFont, String& o_rOutString ); + +#endif + String GetSpecialCharsForEdit(Window* pParent, const Font& rFont) { static bool bDetermineFunction = false; @@ -178,6 +186,7 @@ String GetSpecialCharsForEdit(Window* pParent, const Font& rFont) { bDetermineFunction = true; +#ifndef DISABLE_DYNLOADING static ::rtl::OUString aLibName( SVLIBRARY( "cui" ) ); oslModule handleMod = osl_loadModuleRelative( &thisModule, aLibName.pData, 0 ); @@ -186,6 +195,9 @@ String GetSpecialCharsForEdit(Window* pParent, const Font& rFont) ::rtl::OUString aSymbol( "GetSpecialCharsForEdit" ); pfunc_getSpecialCharsForEdit = (PFunc_getSpecialCharsForEdit)osl_getFunctionSymbol( handleMod, aSymbol.pData ); DBG_ASSERT( pfunc_getSpecialCharsForEdit, "GetSpecialCharsForEdit() not found!" ); +#else + pfunc_getSpecialCharsForEdit = GetSpecialCharsForEdit; +#endif } String aRet; diff --git a/sfx2/source/appl/appserv.cxx b/sfx2/source/appl/appserv.cxx index 6135f7bfa6e3..08d0352c6b63 100644 --- a/sfx2/source/appl/appserv.cxx +++ b/sfx2/source/appl/appserv.cxx @@ -834,16 +834,28 @@ void SfxApplication::MiscState_Impl(SfxItemSet &rSet) } } +#ifndef DISABLE_SCRIPTING + typedef rtl_uString* (SAL_CALL *basicide_choose_macro)(XModel*, sal_Bool, rtl_uString*); typedef void (SAL_CALL *basicide_macro_organizer)( sal_Int16 ); #define DOSTRING( x ) #x #define STRING( x ) DOSTRING( x ) +#ifndef DISABLE_DYNLOADING + extern "C" { static void SAL_CALL thisModule() {} } +#else + +extern "C" rtl_uString* basicide_choose_macro(XModel*, sal_Bool, rtl_uString*); +extern "C" void basicide_macro_organizer( sal_Int16 ); + +#endif + ::rtl::OUString ChooseMacro( const Reference< XModel >& rxLimitToDocument, sal_Bool bChooseOnly, const ::rtl::OUString& rMacroDesc = ::rtl::OUString() ) { +#ifndef DISABLE_DYNLOADING // get basctl dllname static ::rtl::OUString aLibName( SVLIBRARY( "basctl" ) ); @@ -854,16 +866,24 @@ extern "C" { static void SAL_CALL thisModule() {} } // get symbol ::rtl::OUString aSymbol( "basicide_choose_macro" ); basicide_choose_macro pSymbol = (basicide_choose_macro) osl_getFunctionSymbol( handleMod, aSymbol.pData ); +#else +#define pSymbol basicide_choose_macro +#endif // call basicide_choose_macro in basctl rtl_uString* pScriptURL = pSymbol( rxLimitToDocument.get(), bChooseOnly, rMacroDesc.pData ); ::rtl::OUString aScriptURL( pScriptURL ); rtl_uString_release( pScriptURL ); return aScriptURL; + +#ifdef DISABLE_DYNLOADING +#undef pSymbol +#endif } void MacroOrganizer( sal_Int16 nTabId ) { +#ifndef DISABLE_DYNLOADING // get basctl dllname static ::rtl::OUString aLibName( SVLIBRARY( "basctl" ) ); @@ -874,11 +894,17 @@ void MacroOrganizer( sal_Int16 nTabId ) // get symbol ::rtl::OUString aSymbol( "basicide_macro_organizer" ); basicide_macro_organizer pSymbol = (basicide_macro_organizer) osl_getFunctionSymbol( handleMod, aSymbol.pData ); - // call basicide_macro_organizer in basctl pSymbol( nTabId ); +#else + basicide_macro_organizer( nTabId ); +#endif + } +#endif + + #define RID_ERRBOX_MODULENOTINSTALLED (RID_OFA_START + 72) ResMgr* SfxApplication::GetOffResManager_Impl() @@ -890,6 +916,7 @@ ResMgr* SfxApplication::GetOffResManager_Impl() namespace { +#ifndef DISABLE_SCRIPTING Window* lcl_getDialogParent( const Reference< XFrame >& _rxFrame, Window* _pFallback ) { if ( !_rxFrame.is() ) @@ -964,6 +991,7 @@ namespace } return NULL; } +#endif // !DISABLE_SCRIPTING } static ::rtl::OUString getConfigurationStringValue( @@ -1076,7 +1104,7 @@ void SfxApplication::OfaExec_Impl( SfxRequest& rReq ) } break; } - +#ifndef DISABLE_SCRIPTING case SID_BASICIDE_APPEAR: { SfxViewFrame* pView = lcl_getBasicIDEViewFrame( NULL ); @@ -1258,6 +1286,7 @@ void SfxApplication::OfaExec_Impl( SfxRequest& rReq ) rReq.Done(); } break; +#endif // !DISABLE_SCRIPTING case SID_OFFICE_CHECK_PLZ: { diff --git a/svtools/source/filter/filter.cxx b/svtools/source/filter/filter.cxx index aaacb12884f8..6428c2ea6b4b 100644 --- a/svtools/source/filter/filter.cxx +++ b/svtools/source/filter/filter.cxx @@ -915,7 +915,9 @@ class ImpFilterLibCache; struct ImpFilterLibCacheEntry { ImpFilterLibCacheEntry* mpNext; +#ifndef DISABLE_DYNLOADING osl::Module maLibrary; +#endif String maFiltername; PFilterCall mpfnImport; PFilterDlgCall mpfnImportDlg; @@ -930,19 +932,67 @@ struct ImpFilterLibCacheEntry ImpFilterLibCacheEntry::ImpFilterLibCacheEntry( const String& rPathname, const String& rFiltername ) : mpNext ( NULL ), +#ifndef DISABLE_DYNLOADING maLibrary ( rPathname ), +#endif maFiltername ( rFiltername ), mpfnImport ( NULL ), mpfnImportDlg ( NULL ) { +#ifdef DISABLE_DYNLOADING + (void) rPathname; +#endif } // ------------------------------------------------------------------------ +#ifdef DISABLE_DYNLOADING + +extern "C" sal_Bool icdGraphicImport( SvStream& rStream, Graphic& rGraphic, FilterConfigItem* pConfigItem, sal_Bool ); +extern "C" sal_Bool idxGraphicImport( SvStream& rStream, Graphic& rGraphic, FilterConfigItem* pConfigItem, sal_Bool ); +extern "C" sal_Bool imeGraphicImport( SvStream& rStream, Graphic& rGraphic, FilterConfigItem* pConfigItem, sal_Bool ); +extern "C" sal_Bool ipbGraphicImport( SvStream& rStream, Graphic& rGraphic, FilterConfigItem* pConfigItem, sal_Bool ); +extern "C" sal_Bool ipdGraphicImport( SvStream& rStream, Graphic& rGraphic, FilterConfigItem* pConfigItem, sal_Bool ); +extern "C" sal_Bool ipsGraphicImport( SvStream& rStream, Graphic& rGraphic, FilterConfigItem* pConfigItem, sal_Bool ); +extern "C" sal_Bool iptGraphicImport( SvStream& rStream, Graphic& rGraphic, FilterConfigItem* pConfigItem, sal_Bool ); +extern "C" sal_Bool ipxGraphicImport( SvStream& rStream, Graphic& rGraphic, FilterConfigItem* pConfigItem, sal_Bool ); +extern "C" sal_Bool iraGraphicImport( SvStream& rStream, Graphic& rGraphic, FilterConfigItem* pConfigItem, sal_Bool ); +extern "C" sal_Bool itgGraphicImport( SvStream& rStream, Graphic& rGraphic, FilterConfigItem* pConfigItem, sal_Bool ); +extern "C" sal_Bool itiGraphicImport( SvStream& rStream, Graphic& rGraphic, FilterConfigItem* pConfigItem, sal_Bool ); + +#endif + PFilterCall ImpFilterLibCacheEntry::GetImportFunction() { if( !mpfnImport ) + { +#ifndef DISABLE_DYNLOADING mpfnImport = (PFilterCall) maLibrary.getFunctionSymbol(rtl::OUString(IMPORT_FUNCTION_NAME)); +#else + if( maFiltername.EqualsAscii( "icd" ) ) + mpfnImport = icdGraphicImport; + else if( maFiltername.EqualsAscii( "idx" ) ) + mpfnImport = idxGraphicImport; + else if( maFiltername.EqualsAscii( "ime" ) ) + mpfnImport = imeGraphicImport; + else if( maFiltername.EqualsAscii( "ipb" ) ) + mpfnImport = ipbGraphicImport; + else if( maFiltername.EqualsAscii( "ipd" ) ) + mpfnImport = ipdGraphicImport; + else if( maFiltername.EqualsAscii( "ips" ) ) + mpfnImport = ipsGraphicImport; + else if( maFiltername.EqualsAscii( "ipt" ) ) + mpfnImport = iptGraphicImport; + else if( maFiltername.EqualsAscii( "ipx" ) ) + mpfnImport = ipxGraphicImport; + else if( maFiltername.EqualsAscii( "ira" ) ) + mpfnImport = iraGraphicImport; + else if( maFiltername.EqualsAscii( "itg" ) ) + mpfnImport = itgGraphicImport; + else if( maFiltername.EqualsAscii( "iti" ) ) + mpfnImport = itiGraphicImport; +#endif + } return mpfnImport; } @@ -1003,19 +1053,22 @@ ImpFilterLibCacheEntry* ImpFilterLibCache::GetFilter( const String& rFilterPath, { String aPhysicalName( ImpCreateFullFilterPath( rFilterPath, rFilterName ) ); pEntry = new ImpFilterLibCacheEntry( aPhysicalName, rFilterName ); - +#ifndef DISABLE_DYNLOADING if ( pEntry->maLibrary.is() ) +#endif { if( !mpFirst ) mpFirst = mpLast = pEntry; else mpLast = mpLast->mpNext = pEntry; } +#ifndef DISABLE_DYNLOADING else { delete pEntry; pEntry = NULL; } +#endif } return pEntry; }; @@ -1735,6 +1788,21 @@ sal_uInt16 GraphicFilter::ExportGraphic( const Graphic& rGraphic, const INetURLO // ------------------------------------------------------------------------ +#ifdef DISABLE_DYNLOADING + +extern "C" sal_Bool egiGraphicExport( SvStream& rStream, Graphic& rGraphic, FilterConfigItem* pConfigItem, sal_Bool ); +extern "C" sal_Bool emeGraphicExport( SvStream& rStream, Graphic& rGraphic, FilterConfigItem* pConfigItem, sal_Bool ); +extern "C" sal_Bool epbGraphicExport( SvStream& rStream, Graphic& rGraphic, FilterConfigItem* pConfigItem, sal_Bool ); +extern "C" sal_Bool epgGraphicExport( SvStream& rStream, Graphic& rGraphic, FilterConfigItem* pConfigItem, sal_Bool ); +extern "C" sal_Bool eppGraphicExport( SvStream& rStream, Graphic& rGraphic, FilterConfigItem* pConfigItem, sal_Bool ); +extern "C" sal_Bool epsGraphicExport( SvStream& rStream, Graphic& rGraphic, FilterConfigItem* pConfigItem, sal_Bool ); +extern "C" sal_Bool eptGraphicExport( SvStream& rStream, Graphic& rGraphic, FilterConfigItem* pConfigItem, sal_Bool ); +extern "C" sal_Bool eraGraphicExport( SvStream& rStream, Graphic& rGraphic, FilterConfigItem* pConfigItem, sal_Bool ); +extern "C" sal_Bool etiGraphicExport( SvStream& rStream, Graphic& rGraphic, FilterConfigItem* pConfigItem, sal_Bool ); +extern "C" sal_Bool expGraphicExport( SvStream& rStream, Graphic& rGraphic, FilterConfigItem* pConfigItem, sal_Bool ); + +#endif + sal_uInt16 GraphicFilter::ExportGraphic( const Graphic& rGraphic, const String& rPath, SvStream& rOStm, sal_uInt16 nFormat, const uno::Sequence< beans::PropertyValue >* pFilterData ) { @@ -2050,11 +2118,35 @@ sal_uInt16 GraphicFilter::ExportGraphic( const Graphic& rGraphic, const String& sal_Int32 i, nTokenCount = getTokenCount(aFilterPath, ';'); for ( i = 0; i < nTokenCount; i++ ) { +#ifndef DISABLE_DYNLOADING String aPhysicalName( ImpCreateFullFilterPath( getToken(aFilterPath, i, ';'), aFilterName ) ); osl::Module aLibrary( aPhysicalName ); PFilterCall pFunc = (PFilterCall) aLibrary.getFunctionSymbol(rtl::OUString(EXPORT_FUNCTION_NAME)); // Dialog in DLL ausfuehren +#else + PFilterCall pFunc = NULL; + if( aFilterName.EqualsAscii( "egi" ) ) + pFunc = egiGraphicExport; + else if( aFilterName.EqualsAscii( "eme" ) ) + pFunc = emeGraphicExport; + else if( aFilterName.EqualsAscii( "epb" ) ) + pFunc = epbGraphicExport; + else if( aFilterName.EqualsAscii( "epg" ) ) + pFunc = epgGraphicExport; + else if( aFilterName.EqualsAscii( "epp" ) ) + pFunc = eppGraphicExport; + else if( aFilterName.EqualsAscii( "eps" ) ) + pFunc = epsGraphicExport; + else if( aFilterName.EqualsAscii( "ept" ) ) + pFunc = eptGraphicExport; + else if( aFilterName.EqualsAscii( "era" ) ) + pFunc = eraGraphicExport; + else if( aFilterName.EqualsAscii( "eti" ) ) + pFunc = etiGraphicExport; + else if( aFilterName.EqualsAscii( "exp" ) ) + pFunc = expGraphicExport; +#endif if( pFunc ) { if ( !(*pFunc)( rOStm, aGraphic, &aConfigItem, sal_False ) ) diff --git a/svtools/source/misc/svtaccessiblefactory.cxx b/svtools/source/misc/svtaccessiblefactory.cxx index f08fb7db1aac..013e946bba95 100644 --- a/svtools/source/misc/svtaccessiblefactory.cxx +++ b/svtools/source/misc/svtaccessiblefactory.cxx @@ -265,7 +265,11 @@ namespace svt } //-------------------------------------------------------------------- +#ifndef DISABLE_DYNLOADING extern "C" { static void SAL_CALL thisModule() {} } +#else + extern "C" void* getSvtAccessibilityComponentFactory(); +#endif void AccessibleFactoryAccess::ensureInitialized() { @@ -281,6 +285,7 @@ namespace svt // load the library implementing the factory if ( !s_pFactory.get() ) { +#ifndef DISABLE_DYNLOADING const ::rtl::OUString sModuleName( SVLIBRARY( "acc" )); s_hAccessibleImplementationModule = osl_loadModuleRelative( &thisModule, sModuleName.pData, 0 ); if ( s_hAccessibleImplementationModule != NULL ) @@ -291,7 +296,9 @@ namespace svt } OSL_ENSURE( s_pAccessibleFactoryFunc, "ac_registerClient: could not load the library, or not retrieve the needed symbol!" ); - +#else + s_pAccessibleFactoryFunc = getSvtAccessibilityComponentFactory; +#endif // get a factory instance if ( s_pAccessibleFactoryFunc ) { 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; } diff --git a/sw/inc/init.hxx b/sw/inc/init.hxx index daad12c42c67..9fe7fd9f3e70 100644 --- a/sw/inc/init.hxx +++ b/sw/inc/init.hxx @@ -47,8 +47,9 @@ public: Filters(); ~Filters(); - +#ifndef DISABLE_DYNLOADING oslGenericFunction GetMswordLibSymbol( const char *pSymbol ); +#endif private: osl::Module msword_; diff --git a/sw/source/filter/basflt/fltini.cxx b/sw/source/filter/basflt/fltini.cxx index 659177565f63..13fb977523bf 100644 --- a/sw/source/filter/basflt/fltini.cxx +++ b/sw/source/filter/basflt/fltini.cxx @@ -126,8 +126,12 @@ inline void _SetFltPtr( sal_uInt16 rPos, SwRead pReader ) namespace { +#ifndef DISABLE_DYNLOADING + extern "C" { static void SAL_CALL thisModule() {} } +#endif + } namespace sw { @@ -153,6 +157,8 @@ Filters::~Filters() } } +#ifndef DISABLE_DYNLOADING + oslGenericFunction Filters::GetMswordLibSymbol( const char *pSymbol ) { if (!msword_.is()) @@ -165,6 +171,8 @@ oslGenericFunction Filters::GetMswordLibSymbol( const char *pSymbol ) return NULL; } +#endif + } namespace SwReaderWriter { @@ -818,44 +826,75 @@ void SwAsciiOptions::WriteUserData( String& rStr ) rStr += ','; } +#ifdef DISABLE_DYNLOADING + +extern "C" { + Reader *ImportRTF(); + void ExportRTF( const String&, const String& rBaseURL, WriterRef& ); + Reader *ImportDOC(); + void ExportDOC( const String&, const String& rBaseURL, WriterRef& ); + sal_uLong SaveOrDelMSVBAStorage_ww8( SfxObjectShell&, SotStorage&, sal_Bool, const String& ); + sal_uLong GetSaveWarningOfMSVBAStorage_ww8( SfxObjectShell& ); +} + +#endif + Reader* GetRTFReader() { +#ifndef DISABLE_DYNLOADING + FnGetReader pFunction = reinterpret_cast<FnGetReader>( SwGlobals::getFilters().GetMswordLibSymbol( "ImportRTF" ) ); if ( pFunction ) return (*pFunction)(); return NULL; +#else + return ImportRTF(); +#endif + } void GetRTFWriter( const String& rFltName, const String& rBaseURL, WriterRef& xRet ) { +#ifndef DISABLE_DYNLOADING FnGetWriter pFunction = reinterpret_cast<FnGetWriter>( SwGlobals::getFilters().GetMswordLibSymbol( "ExportRTF" ) ); if ( pFunction ) (*pFunction)( rFltName, rBaseURL, xRet ); else xRet = WriterRef(0); +#else + ExportRTF( rFltName, rBaseURL, xRet ); +#endif } Reader* GetWW8Reader() { +#ifndef DISABLE_DYNLOADING FnGetReader pFunction = reinterpret_cast<FnGetReader>( SwGlobals::getFilters().GetMswordLibSymbol( "ImportDOC" ) ); if ( pFunction ) return (*pFunction)(); return NULL; +#else + return ImportDOC(); +#endif } void GetWW8Writer( const String& rFltName, const String& rBaseURL, WriterRef& xRet ) { +#ifndef DISABLE_DYNLOADING FnGetWriter pFunction = reinterpret_cast<FnGetWriter>( SwGlobals::getFilters().GetMswordLibSymbol( "ExportDOC" ) ); if ( pFunction ) (*pFunction)( rFltName, rBaseURL, xRet ); else xRet = WriterRef(0); +#else + ExportDOC( rFltName, rBaseURL, xRet ); +#endif } typedef sal_uLong ( __LOADONCALLAPI *SaveOrDel )( SfxObjectShell&, SotStorage&, sal_Bool, const String& ); @@ -863,18 +902,26 @@ typedef sal_uLong ( __LOADONCALLAPI *GetSaveWarning )( SfxObjectShell& ); sal_uLong SaveOrDelMSVBAStorage( SfxObjectShell& rDoc, SotStorage& rStor, sal_Bool bSaveInto, const String& rStorageName ) { +#ifndef DISABLE_DYNLOADING SaveOrDel pFunction = reinterpret_cast<SaveOrDel>( SwGlobals::getFilters().GetMswordLibSymbol( "SaveOrDelMSVBAStorage_ww8" ) ); if( pFunction ) - return pFunction( rDoc, rStor, bSaveInto, rStorageName ); - return ERRCODE_NONE; + return pFunction( rDoc, rStor, bSaveInto, rStorageName ); + return ERRCODE_NONE; +#else + return SaveOrDelMSVBAStorage_ww8( rDoc, rStor, bSaveInto, rStorageName ); +#endif } sal_uLong GetSaveWarningOfMSVBAStorage( SfxObjectShell &rDocS ) { +#ifndef DISABLE_DYNLOADING GetSaveWarning pFunction = reinterpret_cast<GetSaveWarning>( SwGlobals::getFilters().GetMswordLibSymbol( "GetSaveWarningOfMSVBAStorage_ww8" ) ); if( pFunction ) - return pFunction( rDocS ); - return ERRCODE_NONE; + return pFunction( rDocS ); + return ERRCODE_NONE; +#else + return GetSaveWarningOfMSVBAStorage_ww8( rDocS ); +#endif } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/dbui/swdbtoolsclient.cxx b/sw/source/ui/dbui/swdbtoolsclient.cxx index e18db2b4138a..cf1ebf58e142 100644 --- a/sw/source/ui/dbui/swdbtoolsclient.cxx +++ b/sw/source/ui/dbui/swdbtoolsclient.cxx @@ -94,8 +94,16 @@ SwDbtoolsClient::~SwDbtoolsClient() } } +#ifndef DISABLE_DYNLOADING + extern "C" { static void SAL_CALL thisModule() {} } +#else + +extern "C" void * createDataAccessToolsFactory(); + +#endif + void SwDbtoolsClient::registerClient() { ::osl::MutexGuard aGuard(getDbtoolsClientMutex()); @@ -104,6 +112,7 @@ void SwDbtoolsClient::registerClient() OSL_ENSURE(NULL == getDbToolsClientModule(), "SwDbtoolsClient::registerClient: inconsistence: already have a module!"); OSL_ENSURE(NULL == getDbToolsClientFactoryFunction(), "SwDbtoolsClient::registerClient: inconsistence: already have a factory function!"); +#ifndef DISABLE_DYNLOADING const ::rtl::OUString sModuleName(RTL_CONSTASCII_USTRINGPARAM(SVLIBRARY("dbtools"))); // load the dbtools library @@ -125,6 +134,9 @@ void SwDbtoolsClient::registerClient() getDbToolsClientModule() = NULL; } } +#else + getDbToolsClientFactoryFunction() = createDataAccessToolsFactory; +#endif } } @@ -133,9 +145,11 @@ void SwDbtoolsClient::revokeClient() ::osl::MutexGuard aGuard(getDbtoolsClientMutex()); if (0 == --getDbToolsClientClients()) { +#ifndef DISABLE_DYNLOADING getDbToolsClientFactoryFunction() = NULL; if (getDbToolsClientModule()) osl_unloadModule(getDbToolsClientModule()); +#endif getDbToolsClientModule() = NULL; } } diff --git a/sw/source/ui/dialog/swabstdlg.cxx b/sw/source/ui/dialog/swabstdlg.cxx index 982f74520c09..8efc77f721b3 100644 --- a/sw/source/ui/dialog/swabstdlg.cxx +++ b/sw/source/ui/dialog/swabstdlg.cxx @@ -35,10 +35,19 @@ typedef SwAbstractDialogFactory* (__LOADONCALLAPI *SwFuncPtrCreateDialogFactory)(); +#ifndef DISABLE_DYNLOADING + extern "C" { static void SAL_CALL thisModule() {} } +#else + +extern "C" SwAbstractDialogFactory* SwCreateDialogFactory(); + +#endif + SwAbstractDialogFactory* SwAbstractDialogFactory::Create() { +#ifndef DISABLE_DYNLOADING SwFuncPtrCreateDialogFactory fp = 0; static ::osl::Module aDialogLibrary; static const ::rtl::OUString sLibName(::vcl::unohelper::CreateLibraryName("swui", sal_True)); @@ -49,6 +58,9 @@ SwAbstractDialogFactory* SwAbstractDialogFactory::Create() if ( fp ) return fp(); return 0; +#else + return SwCreateDialogFactory(); +#endif } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/dialog/swuiexp.cxx b/sw/source/ui/dialog/swuiexp.cxx index 62d92c277eb5..7b92e8928b9c 100644 --- a/sw/source/ui/dialog/swuiexp.cxx +++ b/sw/source/ui/dialog/swuiexp.cxx @@ -33,6 +33,10 @@ namespace swui } } +#ifdef DISABLE_DYNLOADING +#define CreateDialogFactory SwCreateDialogFactory +#endif + extern "C" { SAL_DLLPUBLIC_EXPORT SwAbstractDialogFactory* CreateDialogFactory() diff --git a/toolkit/source/helper/accessibilityclient.cxx b/toolkit/source/helper/accessibilityclient.cxx index cbc729362895..4a1cb993fb14 100644 --- a/toolkit/source/helper/accessibilityclient.cxx +++ b/toolkit/source/helper/accessibilityclient.cxx @@ -178,7 +178,11 @@ namespace toolkit } //-------------------------------------------------------------------- +#ifndef DISABLE_DYNLOADING extern "C" { static void SAL_CALL thisModule() {} } +#else + extern "C" void *getStandardAccessibleFactory(); +#endif void AccessibilityClient::ensureInitialized() { @@ -194,6 +198,7 @@ namespace toolkit // load the library implementing the factory if ( !s_pFactory.get() ) { +#ifndef DISABLE_DYNLOADING const ::rtl::OUString sModuleName( SVLIBRARY( "acc" ) ); s_hAccessibleImplementationModule = osl_loadModuleRelative( &thisModule, sModuleName.pData, 0 ); if ( s_hAccessibleImplementationModule != NULL ) @@ -205,6 +210,9 @@ namespace toolkit } OSL_ENSURE( s_pAccessibleFactoryFunc, "AccessibilityClient::ensureInitialized: could not load the library, or not retrieve the needed symbol!" ); +#else + s_pAccessibleFactoryFunc = getStandardAccessibleFactory; +#endif // get a factory instance if ( s_pAccessibleFactoryFunc ) diff --git a/vcl/source/window/abstdlg.cxx b/vcl/source/window/abstdlg.cxx index 3186ba9bc2fe..6db6b95a8978 100644 --- a/vcl/source/window/abstdlg.cxx +++ b/vcl/source/window/abstdlg.cxx @@ -34,16 +34,24 @@ typedef VclAbstractDialogFactory* (__LOADONCALLAPI *FuncPtrCreateDialogFactory)(); +#ifndef DISABLE_DYNLOADING extern "C" { static void SAL_CALL thisModule() {} } +#else +extern "C" VclAbstractDialogFactory* CreateDialogFactory(); +#endif VclAbstractDialogFactory* VclAbstractDialogFactory::Create() { FuncPtrCreateDialogFactory fp = 0; +#ifndef DISABLE_DYNLOADING static ::osl::Module aDialogLibrary; if ( aDialogLibrary.is() || aDialogLibrary.loadRelative( &thisModule, String( CUI_DLL_NAME ), SAL_LOADMODULE_GLOBAL | SAL_LOADMODULE_LAZY ) ) fp = ( VclAbstractDialogFactory* (__LOADONCALLAPI*)() ) aDialogLibrary.getFunctionSymbol( ::rtl::OUString("CreateDialogFactory") ); +#else + fp = CreateDialogFactory; +#endif if ( fp ) return fp(); return 0; diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx index 1fdad861112b..86c06d109067 100644 --- a/vcl/source/window/builder.cxx +++ b/vcl/source/window/builder.cxx @@ -25,6 +25,10 @@ #include <svids.hrc> #include <window.h> +#ifdef DISABLE_DYNLOADING +#include <dlfcn.h> // For RTLD_DEFAULT +#endif + namespace { SymbolType mapStockToSymbol(OString sType) @@ -474,7 +478,9 @@ bool VclBuilder::extractImage(const OString &id, stringmap &rMap) return false; } +#ifndef DISABLE_DYNLOADING extern "C" { static void SAL_CALL thisModule() {} } +#endif Window *VclBuilder::makeObject(Window *pParent, const OString &name, const OString &id, stringmap &rMap) { @@ -664,6 +670,7 @@ Window *VclBuilder::makeObject(Window *pParent, const OString &name, const OStri sal_Int32 nDelim = name.indexOf(':'); if (nDelim != -1) { +#ifndef DISABLE_DYNLOADING OUStringBuffer sModule; #ifdef SAL_DLLPREFIX sModule.append(SAL_DLLPREFIX); @@ -672,10 +679,15 @@ Window *VclBuilder::makeObject(Window *pParent, const OString &name, const OStri #ifdef SAL_DLLEXTENSION sModule.append(SAL_DLLEXTENSION); #endif +#endif OUString sFunction(OStringToOUString(OString("make") + name.copy(nDelim+1), RTL_TEXTENCODING_UTF8)); +#ifndef DISABLE_DYNLOADING osl::Module aModule; aModule.loadRelative(&thisModule, sModule.makeStringAndClear()); customMakeWidget pFunction = (customMakeWidget)aModule.getFunctionSymbol(sFunction); +#else + customMakeWidget pFunction = (customMakeWidget)osl_getFunctionSymbol((oslModule) RTLD_DEFAULT, sFunction.pData); +#endif if (pFunction) pWindow = (*pFunction)(pParent, rMap); } |