sw/qa/extras/htmlexport/htmlexport2.cxx | 4 +++- sw/qa/extras/pdf/HybridPdfTest.cxx | 7 +++++++ 2 files changed, 10 insertions(+), 1 deletion(-)
New commits: commit ca8f94720e4d1e08c5136b2cbc7f93717e2566b1 Author: Noel Grandin <noelgran...@gmail.com> AuthorDate: Mon Apr 7 20:14:18 2025 +0200 Commit: Noel Grandin <noelgran...@gmail.com> CommitDate: Tue Apr 8 10:00:05 2025 +0200 some unit tests not valid when the pdfimport feature is disabled Change-Id: I1d4b7e449192a689fc107ef0ce500501f6722185 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183814 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/sw/qa/extras/htmlexport/htmlexport2.cxx b/sw/qa/extras/htmlexport/htmlexport2.cxx index 75ee544f5875..943a37b41007 100644 --- a/sw/qa/extras/htmlexport/htmlexport2.cxx +++ b/sw/qa/extras/htmlexport/htmlexport2.cxx @@ -8,7 +8,7 @@ */ #include "htmlmodeltestbase.hxx" - +#include <config_poppler.h> #include <memory> #include <com/sun/star/document/XTypeDetection.hpp> @@ -1160,6 +1160,7 @@ CPPUNIT_TEST_FIXTURE(SwHtmlDomExportTest, testReqIF_NoPreserveSpaces) CPPUNIT_TEST_FIXTURE(SwHtmlDomExportTest, testReqIF_ExportFormulasAsPDF) { +#if ENABLE_PDFIMPORT // Given a document with a formula: createSwDoc("embedded_formula.fodt"); @@ -1188,6 +1189,7 @@ CPPUNIT_TEST_FIXTURE(SwHtmlDomExportTest, testReqIF_ExportFormulasAsPDF) CPPUNIT_ASSERT_EQUAL(u"pdf_Portable_Document_Format"_ustr, xTypeDetection->queryTypeByDescriptor(descr, true)); +#endif } CPPUNIT_TEST_FIXTURE(SwHtmlDomExportTest, testReqIF_NoBrClearForImageWrap) diff --git a/sw/qa/extras/pdf/HybridPdfTest.cxx b/sw/qa/extras/pdf/HybridPdfTest.cxx index 0ec4e7ae385b..5302f5494a8e 100644 --- a/sw/qa/extras/pdf/HybridPdfTest.cxx +++ b/sw/qa/extras/pdf/HybridPdfTest.cxx @@ -10,6 +10,7 @@ #include <swmodeltestbase.hxx> #include <docsh.hxx> #include <unotxdoc.hxx> +#include <config_poppler.h> namespace { @@ -34,15 +35,18 @@ public: void HybridPdfTest::testNoHybridDataInPDF() { +#if ENABLE_PDFIMPORT // Load PDF document without attached ODT document loadFromFile(u"PDFOnly.pdf"); uno::Reference<lang::XServiceInfo> xServiceInfo(mxComponent, uno::UNO_QUERY_THROW); // Draw document is expected in this case - default when importing PDF CPPUNIT_ASSERT(xServiceInfo->supportsService(u"com.sun.star.drawing.DrawingDocument"_ustr)); +#endif } void HybridPdfTest::testHybridWithAdditionalStreams() { +#if ENABLE_PDFIMPORT // Load PDF document with an embedded ODT document // The ODT document is embedded in "/AdditionalStreams" structure that is in the PDF trailer createSwDoc("Hybrid_AdditionalStreamsOnly.pdf"); @@ -51,10 +55,12 @@ void HybridPdfTest::testHybridWithAdditionalStreams() // This wouldn't be possible with a PDF, so the opened document has to be ODT CPPUNIT_ASSERT_EQUAL(u"He heard quiet steps behind him. That didn't bode well."_ustr, getParagraph(1)->getString()); +#endif } void HybridPdfTest::testHybridWithAdditionalStreamsAndAttachedFile() { +#if ENABLE_PDFIMPORT // Load PDF document with an embedded ODT document // The ODT document is embedded in "/AdditionalStreams" structure that is in the PDF trailer // and is included as an attached file conforming to the PDF specs @@ -64,6 +70,7 @@ void HybridPdfTest::testHybridWithAdditionalStreamsAndAttachedFile() // This wouldn't be possible with a PDF, so the opened document has to be ODT CPPUNIT_ASSERT_EQUAL(u"He heard quiet steps behind him. That didn't bode well."_ustr, getParagraph(1)->getString()); +#endif } } // end of anonymous namespace