diff options
-rw-r--r-- | oox/source/drawingml/shape.cxx | 6 | ||||
-rw-r--r-- | sd/qa/unit/data/pptx/tdf140714.pptx | bin | 0 -> 28384 bytes | |||
-rw-r--r-- | sd/qa/unit/export-tests.cxx | 16 |
3 files changed, 20 insertions, 2 deletions
diff --git a/oox/source/drawingml/shape.cxx b/oox/source/drawingml/shape.cxx index 45a7a7e64307..b11ccbb5f97c 100644 --- a/oox/source/drawingml/shape.cxx +++ b/oox/source/drawingml/shape.cxx @@ -727,8 +727,10 @@ Reference< XShape > const & Shape::createAndInsert( } // Use custom shape instead of GraphicObjectShape if the image is cropped to // shape. Except rectangle, which does not require further cropping - bool bIsCroppedGraphic = (aServiceName == "com.sun.star.drawing.GraphicObjectShape" && mpCustomShapePropertiesPtr->getShapePresetType() >= 0 - && mpCustomShapePropertiesPtr->getShapePresetType() != XML_Rect && mpCustomShapePropertiesPtr->getShapePresetType() != XML_rect); + bool bIsCroppedGraphic = (aServiceName == "com.sun.star.drawing.GraphicObjectShape" && + (mpCustomShapePropertiesPtr->getShapePresetType() >= 0 || mpCustomShapePropertiesPtr->getPath2DList().size() > 0) && + mpCustomShapePropertiesPtr->getShapePresetType() != XML_Rect && + mpCustomShapePropertiesPtr->getShapePresetType() != XML_rect); bool bIsCustomShape = ( aServiceName == "com.sun.star.drawing.CustomShape" || aServiceName == "com.sun.star.drawing.ConnectorShape" || bIsCroppedGraphic); diff --git a/sd/qa/unit/data/pptx/tdf140714.pptx b/sd/qa/unit/data/pptx/tdf140714.pptx Binary files differnew file mode 100644 index 000000000000..6f5e98ec66f1 --- /dev/null +++ b/sd/qa/unit/data/pptx/tdf140714.pptx diff --git a/sd/qa/unit/export-tests.cxx b/sd/qa/unit/export-tests.cxx index e101731d0238..73201189ab81 100644 --- a/sd/qa/unit/export-tests.cxx +++ b/sd/qa/unit/export-tests.cxx @@ -81,6 +81,7 @@ public: void testShadowBlur(); void testRhbz1870501(); void testTdf128550(); + void testTdf140714(); CPPUNIT_TEST_SUITE(SdExportTest); @@ -120,6 +121,7 @@ public: CPPUNIT_TEST(testShadowBlur); CPPUNIT_TEST(testRhbz1870501); CPPUNIT_TEST(testTdf128550); + CPPUNIT_TEST(testTdf140714); CPPUNIT_TEST_SUITE_END(); @@ -1351,6 +1353,20 @@ void SdExportTest::testTdf128550() } +void SdExportTest::testTdf140714() +{ + //Without the fix in place, shape will be imported as GraphicObjectShape instead of CustomShape. + + auto xDocShRef = loadURL(m_directories.getURLFromSrc(u"sd/qa/unit/data/pptx/tdf140714.pptx"), PPTX); + utl::TempFile tempFile; + xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile); + + uno::Reference<drawing::XShape> xShape(getShapeFromPage(0, 0, xDocShRef), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(OUString{"com.sun.star.drawing.CustomShape"}, xShape->getShapeType()); + + xDocShRef->DoClose(); +} + CPPUNIT_TEST_SUITE_REGISTRATION(SdExportTest); CPPUNIT_PLUGIN_IMPLEMENT(); |