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>
This commit is contained in:
Xisco Fauli 2022-06-10 11:23:24 +02:00
parent b7eddf3e9c
commit bc93734772
2 changed files with 16 additions and 0 deletions

Binary file not shown.

View file

@ -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.