vcl/qa/cppunit/pdfexport/data/tdf128445.odp |binary vcl/qa/cppunit/pdfexport/pdfexport.cxx | 20 ++++++++++++++++++++ 2 files changed, 20 insertions(+)
New commits: commit d04a04d76f8b813b3fc54195f95c7c53e01a1832 Author: Xisco Fauli <xiscofa...@libreoffice.org> AuthorDate: Thu Mar 3 11:47:28 2022 +0100 Commit: Xisco Fauli <xiscofa...@libreoffice.org> CommitDate: Thu Mar 3 17:44:23 2022 +0100 tdf#128445: vcl_pdfexport: Add unittest I couldn't revert the fix to check the test without the fix in place so instead I checked with branch libreoffice-7-2 See https://gerrit.libreoffice.org/c/core/+/130921 Change-Id: I895a2d0a8034a247a69ddedd9253e97bad60b3f1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130920 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org> diff --git a/vcl/qa/cppunit/pdfexport/data/tdf128445.odp b/vcl/qa/cppunit/pdfexport/data/tdf128445.odp new file mode 100644 index 000000000000..adabdb2235d9 Binary files /dev/null and b/vcl/qa/cppunit/pdfexport/data/tdf128445.odp differ diff --git a/vcl/qa/cppunit/pdfexport/pdfexport.cxx b/vcl/qa/cppunit/pdfexport/pdfexport.cxx index 750e3ca8ed76..60ac42adf707 100644 --- a/vcl/qa/cppunit/pdfexport/pdfexport.cxx +++ b/vcl/qa/cppunit/pdfexport/pdfexport.cxx @@ -1401,6 +1401,26 @@ CPPUNIT_TEST_FIXTURE(PdfExportTest, testTdf105954) CPPUNIT_ASSERT_LESS(static_cast<tools::Long>(250), aMeta.getWidth()); } +CPPUNIT_TEST_FIXTURE(PdfExportTest, testTdf128445) +{ + // Import the bugdoc and export as PDF. + aMediaDescriptor["FilterName"] <<= OUString("impress_pdf_Export"); + saveAsPDF(u"tdf128445.odp"); + std::unique_ptr<vcl::pdf::PDFiumDocument> pPdfDocument = parseExport(); + CPPUNIT_ASSERT(pPdfDocument); + + // The document has one page. + CPPUNIT_ASSERT_EQUAL(1, pPdfDocument->getPageCount()); + + std::unique_ptr<vcl::pdf::PDFiumPage> pPdfPage = pPdfDocument->openPage(/*nIndex=*/0); + CPPUNIT_ASSERT(pPdfPage); + + // Without the fix in place, this test would have failed with + // - Expected: 7 + // - Actual : 6 + CPPUNIT_ASSERT_EQUAL(7, pPdfPage->getObjectCount()); +} + CPPUNIT_TEST_FIXTURE(PdfExportTest, testTdf128630) { // Import the bugdoc and export as PDF.