From db39b68c3c85531744ddeb8105b3ddb9b2dab099 Mon Sep 17 00:00:00 2001 From: Gülşah Köse Date: Mon, 22 Mar 2021 23:39:17 +0300 Subject: tdf#140714 Import graphics cropped into custom geometry as custom shapes. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I2054d24ce41c9f0d6cc1675f461274067c3b2898 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112943 Tested-by: Jenkins Reviewed-by: Jan Holesovsky Reviewed-by: Gülşah Köse --- oox/source/drawingml/shape.cxx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'oox') 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); -- cgit