summaryrefslogtreecommitdiff
path: root/sdext
diff options
context:
space:
mode:
authorAshod Nakashian <ashod.nakashian@collabora.co.uk>2019-03-06 22:06:35 -0500
committerAndras Timar <andras.timar@collabora.com>2019-03-07 11:43:25 +0100
commit0d8c670797f6becc584cf2eca4f414df7a3d0d85 (patch)
treea197ba053e698bc398b16509b2bddc726770c276 /sdext
parentcac705fe8ef6deaf808f04e6112dd21666e501a7 (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> Reviewed-on: https://gerrit.libreoffice.org/68842 Tested-by: Jenkins
Diffstat (limited to 'sdext')
-rw-r--r--sdext/Module_sdext.mk7
-rw-r--r--sdext/source/pdfimport/test/tests.cxx13
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 8596859f791f..4cbf870dc28a 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"
@@ -453,6 +454,7 @@ namespace
public:
void testXPDFParser()
{
+#if HAVE_FEATURE_POPPLER
std::shared_ptr<TestSink> pSink( new TestSink() );
CPPUNIT_ASSERT(
pdfi::xpdf_ImportFromFile(
@@ -462,10 +464,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() );
@@ -477,10 +481,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() );
@@ -492,10 +498,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());
@@ -506,10 +514,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());
@@ -521,10 +531,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());
@@ -535,6 +547,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);