diff options
author | Ashod Nakashian <ashod.nakashian@collabora.co.uk> | 2019-03-06 22:06:35 -0500 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2019-03-07 09:10:27 +0100 |
commit | 5b8e16a8ce7738a659fcf8bbe92d6b590dcd3027 (patch) | |
tree | 56ae40b00543f85a5cfe38ccfdc8eb1c59859237 /sdext | |
parent | 6f696fd39cabfe212b60152ff11126817d77b89d (diff) |
build: support disabling poppler
This adds --enable-poppler configure option.
Poppler can be enabled/disabled by setting this
parameter to yes or no.
Change-Id: I42ba2d27de7b5014d28523394310616d20073b71
Reviewed-on: https://gerrit.libreoffice.org/68602
Reviewed-by: Andras Timar <andras.timar@collabora.com>
Tested-by: Andras Timar <andras.timar@collabora.com>
Diffstat (limited to 'sdext')
-rw-r--r-- | sdext/Module_sdext.mk | 7 | ||||
-rw-r--r-- | sdext/source/pdfimport/test/tests.cxx | 13 |
2 files changed, 19 insertions, 1 deletions
diff --git a/sdext/Module_sdext.mk b/sdext/Module_sdext.mk index 44ccba59a754..fd1d191b4939 100644 --- a/sdext/Module_sdext.mk +++ b/sdext/Module_sdext.mk @@ -20,10 +20,15 @@ $(eval $(call gb_Module_add_targets,sdext,\ ifeq ($(ENABLE_PDFIMPORT),TRUE) $(eval $(call gb_Module_add_targets,sdext,\ CustomTarget_pdfimport \ - Executable_xpdfimport \ Library_pdfimport \ +)) + +ifeq ($(ENABLE_POPPLER),TRUE) +$(eval $(call gb_Module_add_targets,sdext,\ + Executable_xpdfimport \ Package_pdfimport_xpdfimport \ )) +endif $(eval $(call gb_Module_add_check_targets,sdext,\ CppunitTest_sdext_pdfimport \ diff --git a/sdext/source/pdfimport/test/tests.cxx b/sdext/source/pdfimport/test/tests.cxx index bbc0a008c7b8..8fb2e87c5da8 100644 --- a/sdext/source/pdfimport/test/tests.cxx +++ b/sdext/source/pdfimport/test/tests.cxx @@ -17,6 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include <config_features.h> #include <zlib.h> #include "outputwrap.hxx" @@ -452,6 +453,7 @@ namespace public: void testXPDFParser() { +#if HAVE_FEATURE_POPPLER std::shared_ptr<TestSink> pSink( new TestSink() ); CPPUNIT_ASSERT( pdfi::xpdf_ImportFromFile( @@ -461,10 +463,12 @@ namespace OUString(), getComponentContext(), "" ) ); pSink->check(); +#endif } void testOdfDrawExport() { +#if HAVE_FEATURE_POPPLER rtl::Reference<pdfi::PDFIRawAdaptor> xAdaptor( new pdfi::PDFIRawAdaptor(OUString(), getComponentContext()) ); xAdaptor->setTreeVisitorFactory( createDrawTreeVisitorFactory() ); @@ -476,10 +480,12 @@ namespace new OutputWrap(tempFileURL), nullptr )); osl::File::remove( tempFileURL ); +#endif } void testOdfWriterExport() { +#if HAVE_FEATURE_POPPLER rtl::Reference<pdfi::PDFIRawAdaptor> xAdaptor( new pdfi::PDFIRawAdaptor(OUString(), getComponentContext()) ); xAdaptor->setTreeVisitorFactory( createWriterTreeVisitorFactory() ); @@ -491,10 +497,12 @@ namespace new OutputWrap(tempFileURL), nullptr )); osl::File::remove( tempFileURL ); +#endif } void testTdf96993() { +#if HAVE_FEATURE_POPPLER rtl::Reference<pdfi::PDFIRawAdaptor> xAdaptor(new pdfi::PDFIRawAdaptor(OUString(), getComponentContext())); xAdaptor->setTreeVisitorFactory(createDrawTreeVisitorFactory()); @@ -505,10 +513,12 @@ namespace nullptr)); // This ensures that the imported image arrives properly flipped CPPUNIT_ASSERT(aOutput.indexOf("draw:transform=\"matrix(18520.8333333333 0 0 26281.9444444444 0 0)\"") != -1); +#endif } void testTdf98421() { +#if HAVE_FEATURE_POPPLER rtl::Reference<pdfi::PDFIRawAdaptor> xAdaptor(new pdfi::PDFIRawAdaptor(OUString(), getComponentContext())); xAdaptor->setTreeVisitorFactory(createWriterTreeVisitorFactory()); @@ -520,10 +530,12 @@ namespace // This ensures that the imported image arrives properly flipped CPPUNIT_ASSERT(aOutput.indexOf("draw:transform=\"scale( 1.0 -1.0 ) translate( 0mm 0mm )\"") != -1); CPPUNIT_ASSERT(aOutput.indexOf("svg:height=\"-262.82mm\"") != -1); +#endif } void testTdf105536() { +#if HAVE_FEATURE_POPPLER rtl::Reference<pdfi::PDFIRawAdaptor> xAdaptor(new pdfi::PDFIRawAdaptor(OUString(), getComponentContext())); xAdaptor->setTreeVisitorFactory(createDrawTreeVisitorFactory()); @@ -534,6 +546,7 @@ namespace nullptr)); // This ensures that the imported image arrives properly flipped CPPUNIT_ASSERT(aOutput.indexOf("draw:transform=\"matrix(-21488.4 0 0 -27978.1 21488.4 27978.1)\"") != -1); +#endif } CPPUNIT_TEST_SUITE(PDFITest); |