diff options
author | Xisco Fauli <xiscofauli@libreoffice.org> | 2020-09-18 15:53:12 +0200 |
---|---|---|
committer | Xisco Fauli <xiscofauli@libreoffice.org> | 2020-09-18 22:12:19 +0200 |
commit | 489afd23ed8eff3b9df4c243b4e4c8fbc264b9d8 (patch) | |
tree | b3bf70e67eeae005bcb7f396fc9fe81a36c6ca1c /sd | |
parent | 01024ee24c6e89044c68051f6fd5f1264905e90c (diff) |
tdf#136830: sd_export_ooxml2: Add unittest
Change-Id: If42d57cb88119cc4cfc8266ec17c91d1d880fab4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103008
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'sd')
-rw-r--r-- | sd/qa/unit/data/pptx/tdf136830.pptx | bin | 0 -> 14105 bytes | |||
-rw-r--r-- | sd/qa/unit/export-tests-ooxml2.cxx | 24 |
2 files changed, 24 insertions, 0 deletions
diff --git a/sd/qa/unit/data/pptx/tdf136830.pptx b/sd/qa/unit/data/pptx/tdf136830.pptx Binary files differnew file mode 100644 index 000000000000..b9ca65899243 --- /dev/null +++ b/sd/qa/unit/data/pptx/tdf136830.pptx diff --git a/sd/qa/unit/export-tests-ooxml2.cxx b/sd/qa/unit/export-tests-ooxml2.cxx index 899457e11e4a..20016799091a 100644 --- a/sd/qa/unit/export-tests-ooxml2.cxx +++ b/sd/qa/unit/export-tests-ooxml2.cxx @@ -185,6 +185,7 @@ public: void testTdf125360_1(); void testTdf125360_2(); void testTdf125551(); + void testTdf136830(); void testTdf126234(); void testTdf126741(); void testTdf127372(); @@ -302,6 +303,7 @@ public: CPPUNIT_TEST(testTdf125360_1); CPPUNIT_TEST(testTdf125360_2); CPPUNIT_TEST(testTdf125551); + CPPUNIT_TEST(testTdf136830); CPPUNIT_TEST(testTdf126234); CPPUNIT_TEST(testTdf126741); CPPUNIT_TEST(testTdf127372); @@ -2569,6 +2571,28 @@ void SdOOXMLExportTest2::testTdf125551() CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(8587), xShapeBg->getSize().Height); } +void SdOOXMLExportTest2::testTdf136830() +{ + ::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("sd/qa/unit/data/pptx/tdf136830.pptx"), PPTX); + utl::TempFile tempFile; + xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile); + + // Without the fix in place, the X position of the shapes would have been 0 + uno::Reference<drawing::XShapes> xGroupShape(getShapeFromPage(0, 0, xDocShRef), uno::UNO_QUERY); + + uno::Reference<drawing::XShape> xShape1(xGroupShape->getByIndex(0), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(14134), xShape1->getPosition().X); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(-5321), xShape1->getPosition().Y); + + uno::Reference<drawing::XShape> xShape2(xGroupShape->getByIndex(1), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(8085), xShape2->getPosition().X); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(8085), xShape2->getPosition().Y); + + uno::Reference<drawing::XShape> xShape3(xGroupShape->getByIndex(2), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(8283), xShape3->getPosition().X); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(4620), xShape3->getPosition().Y); +} + void SdOOXMLExportTest2::testTdf100348_convert_Fontwork2TextWarp() { ::sd::DrawDocShellRef xDocShRef = loadURL( |