diff options
author | Xisco Fauli <xiscofauli@libreoffice.org> | 2022-05-23 13:39:52 +0200 |
---|---|---|
committer | Bartosz Kosiorek <gang65@poczta.onet.pl> | 2022-05-24 08:20:06 +0200 |
commit | 504d61697bac45236da27fba23c7189daf8c171e (patch) | |
tree | 2a238fde7a7fa28a049466770b30095ee055cd59 /sd | |
parent | 063d641f023ac90f49116de105e32e38be72a1af (diff) |
tdf#149206: sd_import_tests2: Add unittest
Change-Id: I1ff0974d1fa2ae6eb45fc95115fad665eecc45bb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134818
Tested-by: Jenkins
Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
Diffstat (limited to 'sd')
-rw-r--r-- | sd/qa/unit/data/pptx/tdf149206.pptx | bin | 0 -> 89796 bytes | |||
-rw-r--r-- | sd/qa/unit/import-tests2.cxx | 25 |
2 files changed, 25 insertions, 0 deletions
diff --git a/sd/qa/unit/data/pptx/tdf149206.pptx b/sd/qa/unit/data/pptx/tdf149206.pptx Binary files differnew file mode 100644 index 000000000000..ec39ec635cc9 --- /dev/null +++ b/sd/qa/unit/data/pptx/tdf149206.pptx diff --git a/sd/qa/unit/import-tests2.cxx b/sd/qa/unit/import-tests2.cxx index b06a699b04bd..fd875abe79cc 100644 --- a/sd/qa/unit/import-tests2.cxx +++ b/sd/qa/unit/import-tests2.cxx @@ -116,6 +116,7 @@ public: std::vector<sal_uInt8>& rExpected); void testPatternImport(); void testPptCrop(); + void testTdf149206(); void testTdf120028(); void testDescriptionImport(); void testTdf83247(); @@ -178,6 +179,7 @@ public: CPPUNIT_TEST(testTdf77747); CPPUNIT_TEST(testTdf116266); CPPUNIT_TEST(testPptCrop); + CPPUNIT_TEST(testTdf149206); CPPUNIT_TEST(testTdf120028); CPPUNIT_TEST(testDescriptionImport); CPPUNIT_TEST(testTdf83247); @@ -1531,6 +1533,29 @@ void SdImportTest2::testPptCrop() xDocShRef->DoClose(); } +void SdImportTest2::testTdf149206() +{ + // Check that the image is cropped + ::sd::DrawDocShellRef xDocShRef + = loadURL(m_directories.getURLFromSrc(u"/sd/qa/unit/data/pptx/tdf149206.pptx"), PPTX); + uno::Reference<drawing::XDrawPagesSupplier> xDoc(xDocShRef->GetDoc()->getUnoModel(), + uno::UNO_QUERY); + + uno::Reference<beans::XPropertySet> xPropertySet( + getShapeFromPage(/*nShape=*/0, /*nPage=*/0, xDocShRef)); + text::GraphicCrop aCrop; + xPropertySet->getPropertyValue("GraphicCrop") >>= aCrop; + + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0), aCrop.Top); + + // Without the fix in place, this test would have failed with + // - Expected: 5937 + // - Actual : 0 + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(5937), aCrop.Bottom); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0), aCrop.Left); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0), aCrop.Right); +} + void SdImportTest2::testTdf120028() { // Check that the text shape has 4 columns. |