diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2018-03-06 16:48:24 +0900 |
---|---|---|
committer | Tomaž Vajngerl <quikee@gmail.com> | 2018-03-07 03:22:46 +0100 |
commit | d55a7fca9c1bb1989d5a70d2d9098a9156c82ac4 (patch) | |
tree | 235b36432b570714325d813d4cf6c8af98bc3c56 /oox/source/export/shapes.cxx | |
parent | f7d3fc13333774f3ada2af1c752bc8a63055a2ff (diff) |
oox: remove use of "GraphicURL" property
Change-Id: I9e65eecf9a1065015ab0872734a41afdd04abb8d
Reviewed-on: https://gerrit.libreoffice.org/50792
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'oox/source/export/shapes.cxx')
-rw-r--r-- | oox/source/export/shapes.cxx | 31 |
1 files changed, 14 insertions, 17 deletions
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 |