diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-09-13 14:33:09 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-09-14 08:33:26 +0200 |
commit | 5cc45f148dac2080d5cdc2d69db539d55b1ff816 (patch) | |
tree | 42239b50849dea5e824eb294d651a33e6bc999e5 | |
parent | c70ee4a6b9071468255e5d4fdb893e9c9bdf4fad (diff) |
no need to dynamically ImportCGM symbol
we are preloading this library anyway, so whatever benefit this might
have provided is long gone
Change-Id: I36ca42de5f802c73b2e2da3b52a996657298211f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139865
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r-- | filter/Library_icg.mk | 4 | ||||
-rw-r--r-- | filter/source/graphicfilter/icgm/cgm.cxx | 4 | ||||
-rw-r--r-- | include/filter/importcgm.hxx | 22 | ||||
-rw-r--r-- | sd/CppunitTest_sd_uimpress.mk | 1 | ||||
-rw-r--r-- | sd/Library_sd.mk | 1 | ||||
-rw-r--r-- | sd/source/filter/cgm/sdcgmfilter.cxx | 38 | ||||
-rw-r--r-- | sd/source/filter/sdfilter.cxx | 1 |
7 files changed, 34 insertions, 37 deletions
diff --git a/filter/Library_icg.mk b/filter/Library_icg.mk index 44cb742a6b98..113faa5a2503 100644 --- a/filter/Library_icg.mk +++ b/filter/Library_icg.mk @@ -25,6 +25,10 @@ $(eval $(call gb_Library_use_external,icg,boost_headers)) $(eval $(call gb_Library_use_sdk_api,icg)) +$(eval $(call gb_Library_add_defs,icg,\ + -DFILTER_DLLIMPLEMENTATION \ +)) + $(eval $(call gb_Library_use_libraries,icg,\ comphelper \ cppuhelper \ diff --git a/filter/source/graphicfilter/icgm/cgm.cxx b/filter/source/graphicfilter/icgm/cgm.cxx index d97c8b6be646..62b3b8d67d00 100644 --- a/filter/source/graphicfilter/icgm/cgm.cxx +++ b/filter/source/graphicfilter/icgm/cgm.cxx @@ -17,9 +17,9 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include <com/sun/star/task/XStatusIndicator.hpp> #include <o3tl/safeint.hxx> #include <osl/endian.h> +#include <filter/importcgm.hxx> #include <tools/stream.hxx> #include "bitmap.hxx" #include "chart.hxx" @@ -683,7 +683,7 @@ bool CGM::Write( SvStream& rIStm ) }; // GraphicImport - the exported function -extern "C" SAL_DLLPUBLIC_EXPORT sal_uInt32 +FILTER_DLLPUBLIC sal_uInt32 ImportCGM(SvStream& rIn, uno::Reference< frame::XModel > const & rXModel, css::uno::Reference<css::task::XStatusIndicator> const & aXStatInd) { diff --git a/include/filter/importcgm.hxx b/include/filter/importcgm.hxx new file mode 100644 index 000000000000..a6782e1305a3 --- /dev/null +++ b/include/filter/importcgm.hxx @@ -0,0 +1,22 @@ + +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ +#pragma once + +#include <com/sun/star/frame/XModel.hpp> +#include <com/sun/star/task/XStatusIndicator.hpp> +#include <filter/dllapi.h> + +class SvStream; + +FILTER_DLLPUBLIC sal_uInt32 +ImportCGM(SvStream& rIn, css::uno::Reference<css::frame::XModel> const& rXModel, + css::uno::Reference<css::task::XStatusIndicator> const& aXStatInd); + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/sd/CppunitTest_sd_uimpress.mk b/sd/CppunitTest_sd_uimpress.mk index 63f143978231..4575a06107b5 100644 --- a/sd/CppunitTest_sd_uimpress.mk +++ b/sd/CppunitTest_sd_uimpress.mk @@ -31,6 +31,7 @@ $(eval $(call gb_CppunitTest_use_libraries,sd_uimpress,\ editeng \ i18nlangtag \ i18nutil \ + icg \ msfilter \ oox \ sal \ diff --git a/sd/Library_sd.mk b/sd/Library_sd.mk index 8b441fe0542a..9d29b4063222 100644 --- a/sd/Library_sd.mk +++ b/sd/Library_sd.mk @@ -79,6 +79,7 @@ $(eval $(call gb_Library_use_libraries,sd,\ editeng \ i18nlangtag \ i18nutil \ + icg \ msfilter \ oox \ sal \ diff --git a/sd/source/filter/cgm/sdcgmfilter.cxx b/sd/source/filter/cgm/sdcgmfilter.cxx index 80b11519d45a..a605baec8d06 100644 --- a/sd/source/filter/cgm/sdcgmfilter.cxx +++ b/sd/source/filter/cgm/sdcgmfilter.cxx @@ -18,6 +18,7 @@ */ #include <memory> +#include <filter/importcgm.hxx> #include <tools/urlobj.hxx> #include <unotools/ucbstreamhelper.hxx> #include <sfx2/docfile.hxx> @@ -36,14 +37,6 @@ using namespace ::com::sun::star::uno; using namespace ::com::sun::star::task; using namespace ::com::sun::star::frame; -typedef sal_uInt32 ( *ImportCGMPointer )(SvStream&, Reference< XModel > const &, Reference< XStatusIndicator > const &); - -#ifdef DISABLE_DYNLOADING - -extern "C" sal_uInt32 ImportCGM(SvStream&, Reference< XModel > const &, Reference< XStatusIndicator > const &); - -#endif - SdCGMFilter::SdCGMFilter( SfxMedium& rMedium, ::sd::DrawDocShell& rDocShell ) : SdFilter( rMedium, rDocShell ) { @@ -53,32 +46,11 @@ SdCGMFilter::~SdCGMFilter() { } -namespace -{ - class CGMPointer - { - ImportCGMPointer m_pPointer; - public: - CGMPointer() - { -#ifdef DISABLE_DYNLOADING - m_pPointer = ImportCGM; -#else - m_pPointer = reinterpret_cast<ImportCGMPointer>( - SdFilter::GetLibrarySymbol("icg", "ImportCGM")); -#endif - } - ImportCGMPointer get() { return m_pPointer; } - }; -} - bool SdCGMFilter::Import() { bool bRet = false; - CGMPointer aPointer; - ImportCGMPointer FncImportCGM = aPointer.get(); - if (FncImportCGM && mxModel.is()) + if (mxModel.is()) { OUString aFileURL( mrMedium.GetURLObject().GetMainURL( INetURLObject::DecodeMechanism::NONE ) ); sal_uInt32 nRetValue; @@ -88,7 +60,7 @@ bool SdCGMFilter::Import() CreateStatusIndicator(); std::unique_ptr<SvStream> xIn(::utl::UcbStreamHelper::CreateStream(aFileURL, StreamMode::READ)); - nRetValue = xIn ? FncImportCGM(*xIn, mxModel, mxStatusIndicator) : 0; + nRetValue = xIn ? ImportCGM(*xIn, mxModel, mxStatusIndicator) : 0; if( nRetValue ) { @@ -124,10 +96,8 @@ extern "C" SAL_DLLPUBLIC_EXPORT bool TestImportCGM(SvStream &rStream) ::sd::DrawDocShellRef xDocShRef = new ::sd::DrawDocShell(SfxObjectCreateMode::EMBEDDED, false, DocumentType::Impress); - CGMPointer aPointer; - xDocShRef->GetDoc()->EnableUndo(false); - bool bRet = aPointer.get()(rStream, xDocShRef->GetModel(), css::uno::Reference<css::task::XStatusIndicator>()) == 0; + bool bRet = ImportCGM(rStream, xDocShRef->GetModel(), css::uno::Reference<css::task::XStatusIndicator>()) == 0; xDocShRef->DoClose(); diff --git a/sd/source/filter/sdfilter.cxx b/sd/source/filter/sdfilter.cxx index 11ad11d7617a..3df3edb233c9 100644 --- a/sd/source/filter/sdfilter.cxx +++ b/sd/source/filter/sdfilter.cxx @@ -89,7 +89,6 @@ oslGenericFunction SdFilter::GetLibrarySymbol( const OUString& rLibraryName, con void SdFilter::Preload() { (void)GetLibrarySymbol("sdfilt", "ImportPPT"); - (void)GetLibrarySymbol("icg", "ImportCGM"); } #endif |