diff options
-rw-r--r-- | emfio/source/reader/wmfreader.cxx | 7 | ||||
-rw-r--r-- | sd/qa/unit/SVGExportTests.cxx | 15 | ||||
-rw-r--r-- | vcl/qa/cppunit/pdfexport/data/tdf145873.pptx (renamed from sd/qa/unit/data/pptx/tdf145873.pptx) | bin | 52342 -> 52342 bytes | |||
-rw-r--r-- | vcl/qa/cppunit/pdfexport/pdfexport.cxx | 35 |
4 files changed, 41 insertions, 16 deletions
diff --git a/emfio/source/reader/wmfreader.cxx b/emfio/source/reader/wmfreader.cxx index 47513101777d..f84fdcce4cc6 100644 --- a/emfio/source/reader/wmfreader.cxx +++ b/emfio/source/reader/wmfreader.cxx @@ -1690,12 +1690,17 @@ namespace emfio bRet = false; break; } - else if ( nFunction == W_META_EOF ) + else if ( nRSize == 3 && nFunction == W_META_EOF ) { break; } switch( nFunction ) { + case W_META_EOF: + { + return; + } + case W_META_SETWINDOWORG: { aWinOrg = ReadYX(); diff --git a/sd/qa/unit/SVGExportTests.cxx b/sd/qa/unit/SVGExportTests.cxx index 1257478e5ed2..d43815264d26 100644 --- a/sd/qa/unit/SVGExportTests.cxx +++ b/sd/qa/unit/SVGExportTests.cxx @@ -35,7 +35,6 @@ #define SVG_USE *[name()='use'] #define SVG_PATTERN *[name()='pattern'] #define SVG_RECT *[name()='rect'] -#define SVG_FONT *[name()='font'] using namespace css; @@ -335,19 +334,6 @@ public: assertXPathContent(svgDoc, SAL_STRINGIFY( /SVG_SVG/SVG_DEFS[9]/SVG_G[2]/SVG_G[2]/SVG_G[7]/SVG_G/SVG_TEXT/SVG_TSPAN/SVG_TSPAN/SVG_TSPAN ), "<number>"); } - void testTdf145873() - { - load( u"/sd/qa/unit/data/pptx/", "tdf145873.pptx" ); - save(); - - xmlDocUniquePtr svgDoc = parseXml(maTempFile); - CPPUNIT_ASSERT(svgDoc); - - // Witout the fix in place, it would have filed with: - // - Expected: 22 - Actual : 3 - number of child-nodes is incorrect - assertXPathChildren(svgDoc, SAL_STRINGIFY( /SVG_SVG/SVG_DEFS[6]/SVG_FONT ), 22); - } - CPPUNIT_TEST_SUITE(SdSVGFilterTest); CPPUNIT_TEST(testSVGExportTextDecorations); CPPUNIT_TEST(testSVGExportJavascriptURL); @@ -356,7 +342,6 @@ public: CPPUNIT_TEST(testSVGExportSlideBitmapBackground); CPPUNIT_TEST(testSVGExportSlideTileBitmapBackground); CPPUNIT_TEST(testSVGPlaceholderLocale); - CPPUNIT_TEST(testTdf145873); CPPUNIT_TEST_SUITE_END(); }; diff --git a/sd/qa/unit/data/pptx/tdf145873.pptx b/vcl/qa/cppunit/pdfexport/data/tdf145873.pptx Binary files differindex 8a5eaa83824a..8a5eaa83824a 100644 --- a/sd/qa/unit/data/pptx/tdf145873.pptx +++ b/vcl/qa/cppunit/pdfexport/data/tdf145873.pptx diff --git a/vcl/qa/cppunit/pdfexport/pdfexport.cxx b/vcl/qa/cppunit/pdfexport/pdfexport.cxx index 2ca8e3764a19..af5f396db14d 100644 --- a/vcl/qa/cppunit/pdfexport/pdfexport.cxx +++ b/vcl/qa/cppunit/pdfexport/pdfexport.cxx @@ -2837,6 +2837,41 @@ CPPUNIT_TEST_FIXTURE(PdfExportTest, testTdf144222) #endif } +CPPUNIT_TEST_FIXTURE(PdfExportTest, testTdf145873) +{ + // Import the bugdoc and export as PDF. + aMediaDescriptor["FilterName"] <<= OUString("impress_pdf_Export"); + saveAsPDF(u"tdf145873.pptx"); + + 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); + int nPageObjectCount = pPdfPage->getObjectCount(); + + // tdf#145873: Without the fix #1 in place, this test would have failed with + // - Expected: 318 + // - Actual : 3 + CPPUNIT_ASSERT_EQUAL(318, nPageObjectCount); + + auto pObject = pPdfPage->getObject(4); + CPPUNIT_ASSERT_MESSAGE("no object", pObject != nullptr); + + // tdf#145873: Without the fix #2 in place, this test would have failed with + // - Expected: 3.23 + // - Actual : 3.57... + // - Delta : 0.1 + CPPUNIT_ASSERT_DOUBLES_EQUAL(3.23, pObject->getBounds().getWidth(), 0.1); + // - Expected: 3.49 + // - Actual : 3.74... + // - Delta : 0.1 + CPPUNIT_ASSERT_DOUBLES_EQUAL(3.49, pObject->getBounds().getHeight(), 0.1); +} + } // end anonymous namespace CPPUNIT_PLUGIN_IMPLEMENT(); |