summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorXisco Fauli <xiscofauli@libreoffice.org>2022-03-03 11:47:28 +0100
committerXisco Fauli <xiscofauli@libreoffice.org>2022-03-03 17:44:23 +0100
commitd04a04d76f8b813b3fc54195f95c7c53e01a1832 (patch)
tree0feddac770d3cf975807676ce5f00c7a2970e688 /vcl
parenta459e6e7984bb3f88f95b587b0cde4a6f8095242 (diff)
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 <xiscofauli@libreoffice.org>
Diffstat (limited to 'vcl')
-rw-r--r--vcl/qa/cppunit/pdfexport/data/tdf128445.odpbin0 -> 41261 bytes
-rw-r--r--vcl/qa/cppunit/pdfexport/pdfexport.cxx20
2 files changed, 20 insertions, 0 deletions
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
--- /dev/null
+++ b/vcl/qa/cppunit/pdfexport/data/tdf128445.odp
Binary files 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.