summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2022-09-14 12:59:00 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2022-09-15 09:24:37 +0200
commit7bc10ea4fae2f2cbaa485f2a9820cfa3f9cfe121 (patch)
treecbd0194e80498fb517dc546d7f86d4ee2e7f80a2 /sd
parent18edbe1e0d96e8df029ea6ae7ec85bb26b18ab72 (diff)
no need to load SaveVBA symbol at runtime
Change-Id: I246168902d07dbc75b68142c73f148e711320d03 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139938 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sd')
-rw-r--r--sd/inc/sdfilter.hxx13
-rw-r--r--sd/source/filter/eppt/eppt.cxx2
-rw-r--r--sd/source/filter/sdfilter.cxx38
-rw-r--r--sd/source/filter/sdpptwrp.cxx18
4 files changed, 5 insertions, 66 deletions
diff --git a/sd/inc/sdfilter.hxx b/sd/inc/sdfilter.hxx
index 928a1c0575d4..1a8c8b6739a6 100644
--- a/sd/inc/sdfilter.hxx
+++ b/sd/inc/sdfilter.hxx
@@ -32,6 +32,7 @@ namespace osl { class Module; }
namespace sd { class DrawDocShell; }
class SdDrawDocument;
class SfxMedium;
+class SfxObjectShell;
class SotStorage;
class SvMemoryStream;
@@ -44,11 +45,6 @@ public:
bool IsDraw() const { return mbIsDraw; }
virtual bool Export() = 0;
-#ifndef DISABLE_DYNLOADING
- /// Open library @rLibraryName and lookup symbol @rFnSymbol
- static oslGenericFunction GetLibrarySymbol( const OUString& rLibraryName, const OUString &rFnSymbol );
-#endif
-
protected:
css::uno::Reference< css::frame::XModel > mxModel;
css::uno::Reference< css::task::XStatusIndicator > mxStatusIndicator;
@@ -58,11 +54,6 @@ protected:
SdDrawDocument& mrDocument;
bool mbIsDraw : 1;
void CreateStatusIndicator();
-
-private:
-
- static OUString ImplGetFullLibraryName( std::u16string_view rLibraryName );
-
};
SD_DLLPUBLIC bool ExportPPT( const std::vector< css::beans::PropertyValue >& rMediaData,
@@ -76,4 +67,6 @@ SD_DLLPUBLIC bool ExportPPT( const std::vector< css::beans::PropertyValue >& rMe
SD_DLLPUBLIC bool ImportPPT(
SdDrawDocument* pDocument, SvStream& rDocStream, SotStorage& rStorage, SfxMedium& rMedium );
+SD_DLLPUBLIC bool SaveVBA( SfxObjectShell& rDocShell, SvMemoryStream*& pBas );
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sd/source/filter/eppt/eppt.cxx b/sd/source/filter/eppt/eppt.cxx
index 34f85553e8bf..64df662c7e68 100644
--- a/sd/source/filter/eppt/eppt.cxx
+++ b/sd/source/filter/eppt/eppt.cxx
@@ -1431,7 +1431,7 @@ SAL_DLLPUBLIC_EXPORT bool ExportPPT( const std::vector< css::beans::PropertyValu
return bStatus;
}
-extern "C" SAL_DLLPUBLIC_EXPORT sal_Bool SaveVBA( SfxObjectShell& rDocShell, SvMemoryStream*& pBas )
+SAL_DLLPUBLIC_EXPORT bool SaveVBA( SfxObjectShell& rDocShell, SvMemoryStream*& pBas )
{
tools::SvRef<SotStorage> xDest( new SotStorage( new SvMemoryStream(), true ) );
SvxImportMSVBasic aMSVBas( rDocShell, *xDest );
diff --git a/sd/source/filter/sdfilter.cxx b/sd/source/filter/sdfilter.cxx
index af001e611883..e1ee1393226e 100644
--- a/sd/source/filter/sdfilter.cxx
+++ b/sd/source/filter/sdfilter.cxx
@@ -50,44 +50,6 @@ SdFilter::~SdFilter()
{
}
-OUString SdFilter::ImplGetFullLibraryName( std::u16string_view rLibraryName )
-{
- return OUString(SVLIBRARY("?")).replaceFirst( "?", rLibraryName );
-}
-
-#ifndef DISABLE_DYNLOADING
-
-static std::map<OUString, std::unique_ptr<osl::Module>> g_SdModuleMap;
-
-extern "C" { static void thisModule() {} }
-
-oslGenericFunction SdFilter::GetLibrarySymbol( const OUString& rLibraryName, const OUString &rFnSymbol )
-{
- osl::Module *pMod = nullptr;
- auto it = g_SdModuleMap.find(rLibraryName);
- if (it != g_SdModuleMap.end())
- pMod = it->second.get();
-
- if (!pMod)
- {
- pMod = new osl::Module;
- if (pMod->loadRelative(&thisModule, ImplGetFullLibraryName(rLibraryName),
- SAL_LOADMODULE_GLOBAL | SAL_LOADMODULE_LAZY))
- g_SdModuleMap[rLibraryName] = std::unique_ptr<osl::Module>(pMod);
- else
- {
- delete pMod;
- pMod = nullptr;
- }
- }
- if (!pMod)
- return nullptr;
- else
- return pMod->getFunctionSymbol(rFnSymbol);
-}
-
-#endif
-
void SdFilter::CreateStatusIndicator()
{
// The status indicator must be retrieved from the provided medium arguments
diff --git a/sd/source/filter/sdpptwrp.cxx b/sd/source/filter/sdpptwrp.cxx
index 0f9e2f4a38fc..168fe11ffa1a 100644
--- a/sd/source/filter/sdpptwrp.cxx
+++ b/sd/source/filter/sdpptwrp.cxx
@@ -40,15 +40,6 @@ using namespace ::com::sun::star::beans;
using namespace ::com::sun::star::task;
using namespace ::com::sun::star::frame;
-typedef sal_Bool ( *SaveVBAPointer )( SfxObjectShell&, SvMemoryStream*& );
-
-#ifdef DISABLE_DYNLOADING
-
-extern "C" sal_Bool SaveVBA( SfxObjectShell&, SvMemoryStream*& );
-
-#endif
-
-
SdPPTFilter::SdPPTFilter( SfxMedium& rMedium, ::sd::DrawDocShell& rDocShell ) :
SdFilter( rMedium, rDocShell ),
pBas ( nullptr )
@@ -331,14 +322,7 @@ void SdPPTFilter::PreSaveBasic()
const SvtFilterOptions& rFilterOptions = SvtFilterOptions::Get();
if( rFilterOptions.IsLoadPPointBasicStorage() )
{
-#ifdef DISABLE_DYNLOADING
- SaveVBAPointer pSaveVBA= SaveVBA;
-#else
- SaveVBAPointer pSaveVBA = reinterpret_cast< SaveVBAPointer >(
- SdFilter::GetLibrarySymbol(mrMedium.GetFilter()->GetUserData(), "SaveVBA"));
-#endif
- if( pSaveVBA )
- pSaveVBA( static_cast<SfxObjectShell&>(mrDocShell), pBas );
+ SaveVBA( static_cast<SfxObjectShell&>(mrDocShell), pBas );
}
}