desktop/qa/desktop_lib/test_desktop_lib.cxx | 2 ++ filter/qa/pdf.cxx | 9 ++++++++- svx/qa/unit/core.cxx | 2 ++ svx/source/svdraw/svdpdf.cxx | 2 +- vcl/qa/cppunit/filter/ipdf/ipdf.cxx | 2 ++ 5 files changed, 15 insertions(+), 2 deletions(-)
New commits: commit a1a5f60d388a6d367b5aee0ff6241e26fad9b530 Author: Caolán McNamara <caol...@redhat.com> AuthorDate: Wed Aug 10 09:00:34 2022 +0100 Commit: Michael Stahl <michael.st...@allotropia.de> CommitDate: Mon Aug 15 11:25:52 2022 +0200 some --disable-pdfium fixes Change-Id: I33867397cd5783adb90e9dc2c62b037ced131e26 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138116 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.st...@allotropia.de> diff --git a/desktop/qa/desktop_lib/test_desktop_lib.cxx b/desktop/qa/desktop_lib/test_desktop_lib.cxx index ba9009cb0f30..1898d3f1377f 100644 --- a/desktop/qa/desktop_lib/test_desktop_lib.cxx +++ b/desktop/qa/desktop_lib/test_desktop_lib.cxx @@ -697,6 +697,8 @@ void DesktopLOKTest::testSaveAsJsonOptions() SvMemoryStream aMemory; aMemory.WriteStream(aFile); std::shared_ptr<vcl::pdf::PDFium> pPDFium = vcl::pdf::PDFiumLibrary::get(); + if (!pPDFium) + return; std::unique_ptr<vcl::pdf::PDFiumDocument> pPdfDocument = pPDFium->openDocument(aMemory.GetData(), aMemory.GetSize(), OString()); CPPUNIT_ASSERT(pPdfDocument); diff --git a/filter/qa/pdf.cxx b/filter/qa/pdf.cxx index 04bd4170c17e..207fa803b0cb 100644 --- a/filter/qa/pdf.cxx +++ b/filter/qa/pdf.cxx @@ -59,6 +59,10 @@ constexpr OUStringLiteral DATA_DIRECTORY = u"/filter/qa/data/"; CPPUNIT_TEST_FIXTURE(Test, testSignCertificateSubjectName) { + std::shared_ptr<vcl::pdf::PDFium> pPDFium = vcl::pdf::PDFiumLibrary::get(); + if (!pPDFium) + return; + uno::Reference<xml::crypto::XSEInitializer> xSEInitializer = xml::crypto::SEInitializer::create(mxComponentContext); uno::Reference<xml::crypto::XXMLSecurityContext> xSecurityContext @@ -98,7 +102,6 @@ CPPUNIT_TEST_FIXTURE(Test, testSignCertificateSubjectName) xFilter->filter(aDescriptor); // Then make sure the resulting PDF has a signature: - std::shared_ptr<vcl::pdf::PDFium> pPDFium = vcl::pdf::PDFiumLibrary::get(); std::unique_ptr<vcl::pdf::PDFiumDocument> pPdfDocument = pPDFium->openDocument(aStream.GetData(), aStream.GetSize(), OString()); // Without the accompanying fix in place, this test would have failed, as signing was enabled @@ -109,6 +112,10 @@ CPPUNIT_TEST_FIXTURE(Test, testSignCertificateSubjectName) CPPUNIT_TEST_FIXTURE(Test, testPdfDecompositionSize) { + std::shared_ptr<vcl::pdf::PDFium> pPDFium = vcl::pdf::PDFiumLibrary::get(); + if (!pPDFium) + return; + // Given an empty Writer document: getComponent().set( loadFromDesktop("private:factory/swriter", "com.sun.star.text.TextDocument")); diff --git a/svx/qa/unit/core.cxx b/svx/qa/unit/core.cxx index 27e5783e20db..3966010012e6 100644 --- a/svx/qa/unit/core.cxx +++ b/svx/qa/unit/core.cxx @@ -70,6 +70,8 @@ CPPUNIT_TEST_FIXTURE(Test, testChartExportToPdf) // Then make sure we get a valid, non-empty PDF: auto pPdfium = vcl::pdf::PDFiumLibrary::get(); + if (!pPdfium) + return; SvMemoryStream aMemory; aMemory.WriteStream(*aTempFile.GetStream(StreamMode::READ)); std::unique_ptr<vcl::pdf::PDFiumDocument> pPdfDocument diff --git a/svx/source/svdraw/svdpdf.cxx b/svx/source/svdraw/svdpdf.cxx index 9f9cd2c5a8de..7beba145a1ea 100644 --- a/svx/source/svdraw/svdpdf.cxx +++ b/svx/source/svdraw/svdpdf.cxx @@ -115,7 +115,7 @@ ImpSdrPdfImport::ImpSdrPdfImport(SdrModel& rModel, SdrLayerID nLay, const tools: auto const& rVectorGraphicData = rGraphic.getVectorGraphicData(); auto* pData = rVectorGraphicData->getBinaryDataContainer().getData(); sal_Int32 nSize = rVectorGraphicData->getBinaryDataContainer().getSize(); - mpPdfDocument = mpPDFium->openDocument(pData, nSize, OString()); + mpPdfDocument = mpPDFium ? mpPDFium->openDocument(pData, nSize, OString()) : nullptr; if (!mpPdfDocument) return; diff --git a/vcl/qa/cppunit/filter/ipdf/ipdf.cxx b/vcl/qa/cppunit/filter/ipdf/ipdf.cxx index b57ead0f6702..c34bb4794700 100644 --- a/vcl/qa/cppunit/filter/ipdf/ipdf.cxx +++ b/vcl/qa/cppunit/filter/ipdf/ipdf.cxx @@ -129,6 +129,8 @@ CPPUNIT_TEST_FIXTURE(VclFilterIpdfTest, testPDFAddVisibleSignatureLastPage) // Then: count the # of shapes on the signature widget/annotation. std::shared_ptr<vcl::pdf::PDFium> pPDFium = vcl::pdf::PDFiumLibrary::get(); + if (!pPDFium) + return; SvFileStream aFile(aTempFile.GetURL(), StreamMode::READ); SvMemoryStream aMemory; aMemory.WriteStream(aFile);