From d55a7fca9c1bb1989d5a70d2d9098a9156c82ac4 Mon Sep 17 00:00:00 2001 From: Tomaž Vajngerl Date: Tue, 6 Mar 2018 16:48:24 +0900 Subject: oox: remove use of "GraphicURL" property MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I9e65eecf9a1065015ab0872734a41afdd04abb8d Reviewed-on: https://gerrit.libreoffice.org/50792 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl --- oox/source/export/drawingml.cxx | 6 ------ oox/source/export/shapes.cxx | 31 ++++++++++++++----------------- 2 files changed, 14 insertions(+), 23 deletions(-) (limited to 'oox') 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 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>(); xGraphic.set(xBitmap, uno::UNO_QUERY); } - else if ( aPropName == "GraphicURL" ) - { - aGraphicURL = *o3tl::doAccess(pPropValue[i].Value); - SAL_INFO("oox.shape", "graphic url: " << aGraphicURL); - } else if ( aPropName == "GraphicSize" ) { aGraphicSize = *o3tl::doAccess(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 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 rGraphic; + Reference 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 -- cgit