Kaydet (Commit) 056fbbf9 authored tarafından Miklos Vajna's avatar Miklos Vajna

Fix --disable-pdfimport build

Change-Id: Ida06b892aea92cfe26fd62372e21ca611d8838d3
Reviewed-on: https://gerrit.libreoffice.org/27447Reviewed-by: 's avatarMiklos Vajna <vmiklos@collabora.co.uk>
Tested-by: 's avatarJenkins <ci@libreoffice.org>
üst 580ed47c
......@@ -174,4 +174,9 @@
*/
#define HAVE_FEATURE_UI 1
/*
* Whether PDF import is available
*/
#define HAVE_FEATURE_PDFIMPORT 0
#endif
......@@ -10623,6 +10623,7 @@ ENABLE_PDFIMPORT=
if test $_os != Android -a $_os != iOS -a \( -z "$enable_pdfimport" -o "$enable_pdfimport" = yes \); then
AC_MSG_RESULT([yes])
ENABLE_PDFIMPORT=TRUE
AC_DEFINE(HAVE_FEATURE_PDFIMPORT)
dnl ===================================================================
dnl Check for system poppler
......
......@@ -517,6 +517,7 @@ void SdExportTest::testTdf62176()
void SdExportTest::testEmbeddedPdf()
{
#if HAVE_FEATURE_PDFIMPORT
sd::DrawDocShellRef xShell = loadURL(m_directories.getURLFromSrc("/sd/qa/unit/data/odp/embedded-pdf.odp"), ODP);
xShell = saveAndReload(xShell, ODP);
uno::Reference<drawing::XDrawPage> xPage = getPage(0, xShell);
......@@ -525,6 +526,7 @@ void SdExportTest::testEmbeddedPdf()
xShape->getPropertyValue("ReplacementGraphicURL") >>= aReplacementGraphicURL;
CPPUNIT_ASSERT(!aReplacementGraphicURL.isEmpty());
xShell->DoClose();
#endif
}
CPPUNIT_TEST_SUITE_REGISTRATION(SdExportTest);
......
......@@ -311,6 +311,7 @@ void GraphicObjectTest::testTdf88935()
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");
SwXTextDocument* pTxtDoc = dynamic_cast<SwXTextDocument*>(xComponent.get());
CPPUNIT_ASSERT(pTxtDoc);
......@@ -339,6 +340,7 @@ void GraphicObjectTest::testPdf()
CPPUNIT_ASSERT(pGraphicObject->GetGraphic().getPdfData().hasElements());
xComponent->dispose();
#endif
}
CPPUNIT_TEST_SUITE_REGISTRATION(GraphicObjectTest);
......
......@@ -32,6 +32,7 @@ public:
void XOutdevTest::testPdfGraphicExport()
{
#if HAVE_FEATURE_PDFIMPORT
// Import the graphic.
Graphic aGraphic;
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>('F'), sFirstBytes[3]);
CPPUNIT_ASSERT_EQUAL(static_cast<sal_uInt8>('-'), sFirstBytes[4]);
#endif
}
CPPUNIT_TEST_SUITE_REGISTRATION(XOutdevTest);
......
......@@ -8,6 +8,7 @@
*/
#include <swmodeltestbase.hxx>
#include <config_features.h>
#include <initializer_list>
......@@ -810,12 +811,14 @@ DECLARE_ODFEXPORT_TEST(testCellUserDefineAttr, "userdefattr-tablecell.odt")
getUserDefineAttribute(uno::makeAny(xCellC1), "proName", "v3");
}
#if HAVE_FEATURE_PDFIMPORT
DECLARE_ODFEXPORT_TEST(testEmbeddedPdf, "embedded-pdf.odt")
{
uno::Reference<drawing::XShape> xShape = getShape(1);
// This failed, pdf+svm replacement graphics pair didn't survive an ODT roundtrip.
CPPUNIT_ASSERT(!getProperty<OUString>(xShape, "ReplacementGraphicURL").isEmpty());
}
#endif
DECLARE_ODFEXPORT_TEST(testTableStyles1, "table_styles_1.odt")
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment