diff options
-rw-r--r-- | oox/source/export/drawingml.cxx | 6 | ||||
-rw-r--r-- | oox/source/export/shapes.cxx | 31 |
2 files changed, 14 insertions, 23 deletions
diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx index 469420e0d616..d3ccf3d81223 100644 --- a/oox/source/export/drawingml.cxx +++ b/oox/source/export/drawingml.cxx @@ -2089,7 +2089,6 @@ void DrawingML::WriteParagraphNumbering(const Reference< XPropertySet >& rXPropS sal_Unicode aBulletChar = 0x2022; // a bullet awt::FontDescriptor aFontDesc; bool bHasFontDesc = false; - OUString aGraphicURL; uno::Reference<graphic::XGraphic> xGraphic; sal_Int16 nBulletRelSize = 0; sal_Int16 nStartWith = 1; @@ -2153,11 +2152,6 @@ void DrawingML::WriteParagraphNumbering(const Reference< XPropertySet >& rXPropS auto xBitmap = pPropValue[i].Value.get<uno::Reference<awt::XBitmap>>(); xGraphic.set(xBitmap, uno::UNO_QUERY); } - else if ( aPropName == "GraphicURL" ) - { - aGraphicURL = *o3tl::doAccess<OUString>(pPropValue[i].Value); - SAL_INFO("oox.shape", "graphic url: " << aGraphicURL); - } else if ( aPropName == "GraphicSize" ) { aGraphicSize = *o3tl::doAccess<awt::Size>(pPropValue[i].Value); diff --git a/oox/source/export/shapes.cxx b/oox/source/export/shapes.cxx index 21ceaa11440c..6a2706693611 100644 --- a/oox/source/export/shapes.cxx +++ b/oox/source/export/shapes.cxx @@ -1097,21 +1097,23 @@ void ShapeExport::WriteGraphicObjectShapePart( const Reference< XShape >& xShape SAL_INFO("oox.shape", "graphicObject without text"); - OUString sGraphicURL; uno::Reference<graphic::XGraphic> xGraphic; OUString sMediaURL; Reference< XPropertySet > xShapeProps( xShape, UNO_QUERY ); - bool bHasGraphicURL = xShapeProps.is() && xShapeProps->getPropertySetInfo()->hasPropertyByName("GraphicURL") && (xShapeProps->getPropertyValue("GraphicURL") >>= sGraphicURL); - - if (xShapeProps.is() && xShapeProps->getPropertySetInfo()->hasPropertyByName("Graphic")) + if (pGraphic) + { + xGraphic.set(pGraphic->GetXGraphic()); + } + else if (xShapeProps.is() && xShapeProps->getPropertySetInfo()->hasPropertyByName("Graphic")) + { xShapeProps->getPropertyValue("Graphic") >>= xGraphic; + } - bool bHasAnyGraphic = bHasGraphicURL || xGraphic.is(); bool bHasMediaURL = xShapeProps.is() && xShapeProps->getPropertySetInfo()->hasPropertyByName("MediaURL") && (xShapeProps->getPropertyValue("MediaURL") >>= sMediaURL); - if (!pGraphic && !bHasAnyGraphic && !bHasMediaURL) + if (!xGraphic.is() && !bHasMediaURL) { SAL_INFO("oox.shape", "no graphic or media URL found"); return; @@ -1169,24 +1171,19 @@ void ShapeExport::WriteGraphicObjectShapePart( const Reference< XShape >& xShape { WriteXGraphicBlip(xShapeProps, xGraphic, false); } - else if (pGraphic || bHasGraphicURL) - { - WriteBlip(xShapeProps, sGraphicURL, false, pGraphic); - } else if (bHasMediaURL) { - Reference<graphic::XGraphic> rGraphic; + Reference<graphic::XGraphic> xFallbackGraphic; if (xShapeProps->getPropertySetInfo()->hasPropertyByName("FallbackGraphic")) - xShapeProps->getPropertyValue("FallbackGraphic") >>= rGraphic; + xShapeProps->getPropertyValue("FallbackGraphic") >>= xFallbackGraphic; - Graphic aGraphic(rGraphic); - WriteBlip(xShapeProps, sMediaURL, false, &aGraphic); + WriteXGraphicBlip(xShapeProps, xFallbackGraphic, false); } - if (bHasGraphicURL) - WriteSrcRect(xShapeProps, sGraphicURL); - else if (xGraphic.is()) + if (xGraphic.is()) + { WriteSrcRectXGraphic(xShapeProps, xGraphic); + } // now we stretch always when we get pGraphic (when changing that // behavior, test n#780830 for regression, where the OLE sheet might get tiled |