diff options
-rw-r--r-- | sd/qa/unit/data/pptx/crop-to-shape.pptx | bin | 0 -> 83338 bytes | |||
-rw-r--r-- | sd/qa/unit/import-tests.cxx | 26 |
2 files changed, 26 insertions, 0 deletions
diff --git a/sd/qa/unit/data/pptx/crop-to-shape.pptx b/sd/qa/unit/data/pptx/crop-to-shape.pptx Binary files differnew file mode 100644 index 000000000000..929b07e009ce --- /dev/null +++ b/sd/qa/unit/data/pptx/crop-to-shape.pptx diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx index 331bc251c82f..04ac4b474ab8 100644 --- a/sd/qa/unit/import-tests.cxx +++ b/sd/qa/unit/import-tests.cxx @@ -52,6 +52,7 @@ #include <com/sun/star/presentation/ClickAction.hpp> #include <com/sun/star/presentation/XPresentationPage.hpp> #include <com/sun/star/presentation/XPresentationSupplier.hpp> +#include <com/sun/star/drawing/BitmapMode.hpp> #include <com/sun/star/drawing/GraphicExportFilter.hpp> #include <com/sun/star/drawing/XDrawPage.hpp> #include <com/sun/star/drawing/XDrawPagesSupplier.hpp> @@ -204,6 +205,7 @@ public: void testTdf47365(); void testTdf122899(); void testOOXTheme(); + void testCropToShape(); CPPUNIT_TEST_SUITE(SdImportTest); @@ -294,6 +296,7 @@ public: CPPUNIT_TEST(testTdf47365); CPPUNIT_TEST(testTdf122899); CPPUNIT_TEST(testOOXTheme); + CPPUNIT_TEST(testCropToShape); CPPUNIT_TEST_SUITE_END(); }; @@ -2775,6 +2778,29 @@ void SdImportTest::testOOXTheme() xDocShRef->DoClose(); } +void SdImportTest::testCropToShape() +{ + sd::DrawDocShellRef xDocShRef + = loadURL(m_directories.getURLFromSrc("/sd/qa/unit/data/pptx/crop-to-shape.pptx"), PPTX); + uno::Reference<drawing::XDrawPagesSupplier> xDrawPagesSupplier( + xDocShRef->GetDoc()->getUnoModel(), uno::UNO_QUERY_THROW); + CPPUNIT_ASSERT_MESSAGE("Could not get XDrawPagesSupplier", xDrawPagesSupplier.is()); + uno::Reference<drawing::XDrawPages> xDrawPages(xDrawPagesSupplier->getDrawPages()); + uno::Reference<drawing::XDrawPage> xDrawPage(xDrawPages->getByIndex(0), uno::UNO_QUERY_THROW); + CPPUNIT_ASSERT_MESSAGE("Could not get xDrawPage", xDrawPage.is()); + uno::Reference<drawing::XShape> xShape(xDrawPage->getByIndex(0), uno::UNO_QUERY); + uno::Reference<drawing::XShapeDescriptor> xDesc(xShape, uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(OUString{"com.sun.star.drawing.CustomShape"}, xDesc->getShapeType()); + CPPUNIT_ASSERT_MESSAGE("Could not get xShape", xShape.is()); + uno::Reference<beans::XPropertySet> xShapeProps(xShape, uno::UNO_QUERY); + css::drawing::FillStyle fillStyle; + xShapeProps->getPropertyValue("FillStyle") >>= fillStyle; + CPPUNIT_ASSERT_EQUAL(css::drawing::FillStyle_BITMAP, fillStyle); + css::drawing::BitmapMode bitmapmode; + xShapeProps->getPropertyValue("FillBitmapMode") >>= bitmapmode; + CPPUNIT_ASSERT_EQUAL(css::drawing::BitmapMode_STRETCH, bitmapmode); +} + CPPUNIT_TEST_SUITE_REGISTRATION(SdImportTest); CPPUNIT_PLUGIN_IMPLEMENT(); |