summaryrefslogtreecommitdiff
path: root/oox
diff options
context:
space:
mode:
authorGülşah Köse <gulsah.kose@collabora.com>2021-03-22 23:39:17 +0300
committerJan Holesovsky <kendy@collabora.com>2021-03-25 22:39:59 +0100
commiteea9c8069cbd1deeca5af6866090984f28892ac8 (patch)
treec119880d21f172d3fae87727d41b392979dbfa77 /oox
parent65990058f041c3f1d280a69d411eb4ceacf5a721 (diff)
tdf#140714 Import graphics cropped into custom geometry as custom shapes.
Change-Id: I2054d24ce41c9f0d6cc1675f461274067c3b2898 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112943 Tested-by: Jenkins Reviewed-by: Jan Holesovsky <kendy@collabora.com> Reviewed-by: Gülşah Köse <gulsah.kose@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113003 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Diffstat (limited to 'oox')
-rw-r--r--oox/source/drawingml/shape.cxx6
1 files changed, 4 insertions, 2 deletions
diff --git a/oox/source/drawingml/shape.cxx b/oox/source/drawingml/shape.cxx
index 9e324ef69ed1..803e130b349a 100644
--- a/oox/source/drawingml/shape.cxx
+++ b/oox/source/drawingml/shape.cxx
@@ -726,8 +726,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);