summaryrefslogtreecommitdiff
path: root/oox/source/vml
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2020-08-18 17:43:57 +0200
committerMiklos Vajna <vmiklos@collabora.com>2020-08-18 21:51:22 +0200
commitb2d834d6727626f070bb4dde3e1c65da1169f729 (patch)
tree7fdce9d90a25aef9530357aec30556a719a27235 /oox/source/vml
parent54691ea52a91491ae251473c83b61f9adaf0b581 (diff)
tdf#132555 PPTX VML import: handle stroke properties of image shapes
ComplexShape::implConvertAndInsert() returns early in the graphic object shape case, so stroke model is not applied at all. Also fix a problem in ShapeBase::finalizeFragmentImport(), where the shape type had no stroke, but the shape itself had, and the later should win. The warning in OleObjectGraphicDataContext::onCreateContext() now points out that <mc:AlternateContent> is ignored as a child of <a:graphicData>, which probably should be addressed at some stage, but it's not required to fix the missing stroke. Change-Id: I4ab43b4c6d40d9f43caad22b85f5b885fa8b4ef1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100952 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
Diffstat (limited to 'oox/source/vml')
-rw-r--r--oox/source/vml/vmlshape.cxx15
1 files changed, 15 insertions, 0 deletions
diff --git a/oox/source/vml/vmlshape.cxx b/oox/source/vml/vmlshape.cxx
index b6fe01b08347..f22a98576a16 100644
--- a/oox/source/vml/vmlshape.cxx
+++ b/oox/source/vml/vmlshape.cxx
@@ -292,7 +292,15 @@ void ShapeBase::finalizeFragmentImport()
if (aType[ 0 ] == '#')
aType = aType.copy(1);
if( const ShapeType* pShapeType = mrDrawing.getShapes().getShapeTypeById( aType ) )
+ {
+ // Make sure that the stroke props from maTypeModel have priority over the stroke props from
+ // the shape type.
+ StrokeModel aMergedStrokeModel;
+ aMergedStrokeModel.assignUsed(pShapeType->getTypeModel().maStrokeModel);
+ aMergedStrokeModel.assignUsed(maTypeModel.maStrokeModel);
maTypeModel.assignUsed( pShapeType->getTypeModel() );
+ maTypeModel.maStrokeModel = aMergedStrokeModel;
+ }
else {
// Temporary fix, shapetype not found if referenced from different substream
// FIXME: extend scope of ShapeContainer to store all shapetypes from the document
@@ -1346,6 +1354,13 @@ Reference< XShape > ComplexShape::implConvertAndInsert( const Reference< XShapes
// AS_CHARACTER shape: vertical orientation default is bottom, MSO default is top.
if ( maTypeModel.maPosition != "absolute" && maTypeModel.maPosition != "relative" )
PropertySet( xShape ).setAnyProperty( PROP_VertOrient, makeAny(text::VertOrientation::TOP));
+
+ // Apply stroke props from the type model.
+ oox::drawingml::ShapePropertyMap aPropMap(mrDrawing.getFilter().getModelObjectHelper());
+ const GraphicHelper& rGraphicHelper = mrDrawing.getFilter().getGraphicHelper();
+ maTypeModel.maStrokeModel.pushToPropMap(aPropMap, rGraphicHelper);
+ PropertySet(xShape).setProperties(aPropMap);
+
return xShape;
}