summaryrefslogtreecommitdiff
path: root/sd/qa/unit
diff options
context:
space:
mode:
authorXisco Fauli <xiscofauli@libreoffice.org>2022-05-23 13:39:52 +0200
committerBartosz Kosiorek <gang65@poczta.onet.pl>2022-05-24 08:20:06 +0200
commit504d61697bac45236da27fba23c7189daf8c171e (patch)
tree2a238fde7a7fa28a049466770b30095ee055cd59 /sd/qa/unit
parent063d641f023ac90f49116de105e32e38be72a1af (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/qa/unit')
-rw-r--r--sd/qa/unit/data/pptx/tdf149206.pptxbin0 -> 89796 bytes
-rw-r--r--sd/qa/unit/import-tests2.cxx25
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
new file mode 100644
index 000000000000..ec39ec635cc9
--- /dev/null
+++ b/sd/qa/unit/data/pptx/tdf149206.pptx
Binary files differ
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.