summaryrefslogtreecommitdiff
path: root/oox
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2018-03-06 16:48:24 +0900
committerTomaž Vajngerl <quikee@gmail.com>2018-03-07 03:22:46 +0100
commitd55a7fca9c1bb1989d5a70d2d9098a9156c82ac4 (patch)
tree235b36432b570714325d813d4cf6c8af98bc3c56 /oox
parentf7d3fc13333774f3ada2af1c752bc8a63055a2ff (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')
-rw-r--r--oox/source/export/drawingml.cxx6
-rw-r--r--oox/source/export/shapes.cxx31
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