Fix --disable-pdfimport build

Change-Id: Ida06b892aea92cfe26fd62372e21ca611d8838d3
Reviewed-on: https://gerrit.libreoffice.org/27447
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Jenkins <ci@libreoffice.org>
This commit is contained in:
Miklos Vajna 2016-07-22 18:14:40 +02:00
parent 580ed47cf7
commit 056fbbf93b
6 changed files with 15 additions and 0 deletions

View File

@ -174,4 +174,9 @@
*/ */
#define HAVE_FEATURE_UI 1 #define HAVE_FEATURE_UI 1
/*
* Whether PDF import is available
*/
#define HAVE_FEATURE_PDFIMPORT 0
#endif #endif

View File

@ -10623,6 +10623,7 @@ ENABLE_PDFIMPORT=
if test $_os != Android -a $_os != iOS -a \( -z "$enable_pdfimport" -o "$enable_pdfimport" = yes \); then if test $_os != Android -a $_os != iOS -a \( -z "$enable_pdfimport" -o "$enable_pdfimport" = yes \); then
AC_MSG_RESULT([yes]) AC_MSG_RESULT([yes])
ENABLE_PDFIMPORT=TRUE ENABLE_PDFIMPORT=TRUE
AC_DEFINE(HAVE_FEATURE_PDFIMPORT)
dnl =================================================================== dnl ===================================================================
dnl Check for system poppler dnl Check for system poppler

View File

@ -517,6 +517,7 @@ void SdExportTest::testTdf62176()
void SdExportTest::testEmbeddedPdf() void SdExportTest::testEmbeddedPdf()
{ {
#if HAVE_FEATURE_PDFIMPORT
sd::DrawDocShellRef xShell = loadURL(m_directories.getURLFromSrc("/sd/qa/unit/data/odp/embedded-pdf.odp"), ODP); sd::DrawDocShellRef xShell = loadURL(m_directories.getURLFromSrc("/sd/qa/unit/data/odp/embedded-pdf.odp"), ODP);
xShell = saveAndReload(xShell, ODP); xShell = saveAndReload(xShell, ODP);
uno::Reference<drawing::XDrawPage> xPage = getPage(0, xShell); uno::Reference<drawing::XDrawPage> xPage = getPage(0, xShell);
@ -525,6 +526,7 @@ void SdExportTest::testEmbeddedPdf()
xShape->getPropertyValue("ReplacementGraphicURL") >>= aReplacementGraphicURL; xShape->getPropertyValue("ReplacementGraphicURL") >>= aReplacementGraphicURL;
CPPUNIT_ASSERT(!aReplacementGraphicURL.isEmpty()); CPPUNIT_ASSERT(!aReplacementGraphicURL.isEmpty());
xShell->DoClose(); xShell->DoClose();
#endif
} }
CPPUNIT_TEST_SUITE_REGISTRATION(SdExportTest); CPPUNIT_TEST_SUITE_REGISTRATION(SdExportTest);

View File

@ -311,6 +311,7 @@ void GraphicObjectTest::testTdf88935()
void GraphicObjectTest::testPdf() void GraphicObjectTest::testPdf()
{ {
#if HAVE_FEATURE_PDFIMPORT
uno::Reference<lang::XComponent> xComponent = loadFromDesktop(m_directories.getURLFromSrc("svtools/qa/unit/data/pdf.odt"), "com.sun.star.text.TextDocument"); uno::Reference<lang::XComponent> xComponent = loadFromDesktop(m_directories.getURLFromSrc("svtools/qa/unit/data/pdf.odt"), "com.sun.star.text.TextDocument");
SwXTextDocument* pTxtDoc = dynamic_cast<SwXTextDocument*>(xComponent.get()); SwXTextDocument* pTxtDoc = dynamic_cast<SwXTextDocument*>(xComponent.get());
CPPUNIT_ASSERT(pTxtDoc); CPPUNIT_ASSERT(pTxtDoc);
@ -339,6 +340,7 @@ void GraphicObjectTest::testPdf()
CPPUNIT_ASSERT(pGraphicObject->GetGraphic().getPdfData().hasElements()); CPPUNIT_ASSERT(pGraphicObject->GetGraphic().getPdfData().hasElements());
xComponent->dispose(); xComponent->dispose();
#endif
} }
CPPUNIT_TEST_SUITE_REGISTRATION(GraphicObjectTest); CPPUNIT_TEST_SUITE_REGISTRATION(GraphicObjectTest);

View File

@ -32,6 +32,7 @@ public:
void XOutdevTest::testPdfGraphicExport() void XOutdevTest::testPdfGraphicExport()
{ {
#if HAVE_FEATURE_PDFIMPORT
// Import the graphic. // Import the graphic.
Graphic aGraphic; Graphic aGraphic;
test::Directories aDirectories; test::Directories aDirectories;
@ -58,6 +59,7 @@ void XOutdevTest::testPdfGraphicExport()
CPPUNIT_ASSERT_EQUAL(static_cast<sal_uInt8>('D'), sFirstBytes[2]); CPPUNIT_ASSERT_EQUAL(static_cast<sal_uInt8>('D'), sFirstBytes[2]);
CPPUNIT_ASSERT_EQUAL(static_cast<sal_uInt8>('F'), sFirstBytes[3]); CPPUNIT_ASSERT_EQUAL(static_cast<sal_uInt8>('F'), sFirstBytes[3]);
CPPUNIT_ASSERT_EQUAL(static_cast<sal_uInt8>('-'), sFirstBytes[4]); CPPUNIT_ASSERT_EQUAL(static_cast<sal_uInt8>('-'), sFirstBytes[4]);
#endif
} }
CPPUNIT_TEST_SUITE_REGISTRATION(XOutdevTest); CPPUNIT_TEST_SUITE_REGISTRATION(XOutdevTest);

View File

@ -8,6 +8,7 @@
*/ */
#include <swmodeltestbase.hxx> #include <swmodeltestbase.hxx>
#include <config_features.h>
#include <initializer_list> #include <initializer_list>
@ -810,12 +811,14 @@ DECLARE_ODFEXPORT_TEST(testCellUserDefineAttr, "userdefattr-tablecell.odt")
getUserDefineAttribute(uno::makeAny(xCellC1), "proName", "v3"); getUserDefineAttribute(uno::makeAny(xCellC1), "proName", "v3");
} }
#if HAVE_FEATURE_PDFIMPORT
DECLARE_ODFEXPORT_TEST(testEmbeddedPdf, "embedded-pdf.odt") DECLARE_ODFEXPORT_TEST(testEmbeddedPdf, "embedded-pdf.odt")
{ {
uno::Reference<drawing::XShape> xShape = getShape(1); uno::Reference<drawing::XShape> xShape = getShape(1);
// This failed, pdf+svm replacement graphics pair didn't survive an ODT roundtrip. // This failed, pdf+svm replacement graphics pair didn't survive an ODT roundtrip.
CPPUNIT_ASSERT(!getProperty<OUString>(xShape, "ReplacementGraphicURL").isEmpty()); CPPUNIT_ASSERT(!getProperty<OUString>(xShape, "ReplacementGraphicURL").isEmpty());
} }
#endif
DECLARE_ODFEXPORT_TEST(testTableStyles1, "table_styles_1.odt") DECLARE_ODFEXPORT_TEST(testTableStyles1, "table_styles_1.odt")
{ {