diff options
author | Xisco Fauli <xiscofauli@libreoffice.org> | 2022-06-10 11:23:24 +0200 |
---|---|---|
committer | Xisco Fauli <xiscofauli@libreoffice.org> | 2022-06-10 12:11:32 +0200 |
commit | bc937347728a669d9baeee75c6ad5eea9d8d2710 (patch) | |
tree | cf211787c8aaddf4cf7d3a6d98f4a0ed2533d2fb /vcl | |
parent | b7eddf3e9c2db503dde632b35513844806be3c36 (diff) |
tdf#114256: vcl_pdfexport: Add unittest
Change-Id: Iaaeb0b248f84709855d9e83d34cecf22f1169769
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135581
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/qa/cppunit/pdfexport/data/tdf114256.ods | bin | 0 -> 7716 bytes | |||
-rw-r--r-- | vcl/qa/cppunit/pdfexport/pdfexport.cxx | 16 |
2 files changed, 16 insertions, 0 deletions
diff --git a/vcl/qa/cppunit/pdfexport/data/tdf114256.ods b/vcl/qa/cppunit/pdfexport/data/tdf114256.ods Binary files differnew file mode 100644 index 000000000000..1e30a7e31ff6 --- /dev/null +++ b/vcl/qa/cppunit/pdfexport/data/tdf114256.ods diff --git a/vcl/qa/cppunit/pdfexport/pdfexport.cxx b/vcl/qa/cppunit/pdfexport/pdfexport.cxx index bbf9908eb9de..711aaa17742f 100644 --- a/vcl/qa/cppunit/pdfexport/pdfexport.cxx +++ b/vcl/qa/cppunit/pdfexport/pdfexport.cxx @@ -2132,6 +2132,22 @@ CPPUNIT_TEST_FIXTURE(PdfExportTest, testReduceSmallImage) CPPUNIT_ASSERT_EQUAL(16, nHeight); } +CPPUNIT_TEST_FIXTURE(PdfExportTest, testTdf114256) +{ + aMediaDescriptor["FilterName"] <<= OUString("calc_pdf_Export"); + saveAsPDF(u"tdf114256.ods"); + std::unique_ptr<vcl::pdf::PDFiumDocument> pPdfDocument = parseExport(); + CPPUNIT_ASSERT(pPdfDocument); + 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: 13 + // - Actual : 0 + CPPUNIT_ASSERT_EQUAL(13, pPdfPage->getObjectCount()); +} + CPPUNIT_TEST_FIXTURE(PdfExportTest, testTdf147027) { // Load the Calc document. |