diff --git a/oox/source/export/shapes.cxx b/oox/source/export/shapes.cxx index 9033e1d40d88..13c52d22c56e 100644 --- a/oox/source/export/shapes.cxx +++ b/oox/source/export/shapes.cxx @@ -1238,6 +1238,14 @@ void ShapeExport::WriteGraphicObjectShapePart( const Reference< XShape >& xShape if ( pGraphic || bStretch ) pFS->singleElementNS(XML_a, XML_stretch); + if (bHasMediaURL) + { + // Graphic of media shapes is always stretched. + pFS->startElementNS(XML_a, XML_stretch); + pFS->singleElementNS(XML_a, XML_fillRect); + pFS->endElementNS(XML_a, XML_stretch); + } + pFS->endElementNS( mnXmlNamespace, XML_blipFill ); // visual shape properties diff --git a/sd/qa/unit/export-tests-ooxml1.cxx b/sd/qa/unit/export-tests-ooxml1.cxx index 91ce68e20a50..e6b32ff357ca 100644 --- a/sd/qa/unit/export-tests-ooxml1.cxx +++ b/sd/qa/unit/export-tests-ooxml1.cxx @@ -1336,6 +1336,12 @@ void SdOOXMLExportTest1::testNarrationMimeType() // i.e. the bitmap of the narration was lost, some default placeholder was exported instead. CPPUNIT_ASSERT_EQUAL(static_cast(256), aBitmapEx.GetSizePixel().Height()); + // Without the accompanying fix in place, this test would have failed with: + // - Expected: 1 + // - Actual : 0 + // i.e. p:blipFill was missing its a:stretch child element, so the shape was invisible. + assertXPath(pSlideDoc, "/p:sld/p:cSld/p:spTree/p:pic/p:blipFill/a:stretch/a:fillRect", 1); + xDocShRef->DoClose(); }