diff options
author | Michael Stahl <mstahl@redhat.com> | 2017-07-13 21:58:48 +0200 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2017-07-14 16:20:21 +0200 |
commit | b3992ddcd13082a934246b717ae22f57394e6533 (patch) | |
tree | d305b3e3085a0f964f4359b007687d3c5c01c973 /xmloff | |
parent | c356884319f254fdd944376fe2f841532dc36433 (diff) |
xmloff: ODF export: fix redundant setting of GraphicStreamURL swapping
XMLShapeExport::ImpExportGraphicObjectShape() unnecessarily swaps out
the GraphicObject by calling setPropertyValue("GraphicStreamURL")
even if the URL didn't actually change from what was retrieved
just a couple lines earlier, incidentally swapping it in too.
Well actually it isn't really swapped out, it's marked as auto-swapped,
but nevertheless on getting the "ReplacementGraphicURL" property
its Graphic will be replaced by swapping it in again.
So don't do that, then it's only swapped in once.
This speeds up round-tripping the ML bugdoc from 3:20 to 3:00.
Change-Id: I65a211a0c225444c06d5516df9c6716360be46c0
Diffstat (limited to 'xmloff')
-rw-r--r-- | xmloff/source/draw/shapeexport.cxx | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/xmloff/source/draw/shapeexport.cxx b/xmloff/source/draw/shapeexport.cxx index e49451f686e8..c288640a68fa 100644 --- a/xmloff/source/draw/shapeexport.cxx +++ b/xmloff/source/draw/shapeexport.cxx @@ -2311,17 +2311,20 @@ void XMLShapeExport::ImpExportGraphicObjectShape( // apply possible changed stream URL to embedded image object if ( bIsEmbeddedImageWithExistingStreamInPackage ) { - aStreamURL = sPackageURL; + OUString newStreamURL = sPackageURL; if ( aStr[0] == '#' ) { - aStreamURL += aStr.copy( 1, aStr.getLength() - 1 ); + newStreamURL += aStr.copy( 1, aStr.getLength() - 1 ); } else { - aStreamURL += aStr; + newStreamURL += aStr; } - xPropSet->setPropertyValue( "GraphicStreamURL", uno::Any(aStreamURL) ); + if (newStreamURL != aStreamURL) + { + xPropSet->setPropertyValue("GraphicStreamURL", uno::Any(newStreamURL)); + } } mrExport.AddAttribute(XML_NAMESPACE_XLINK, XML_TYPE, XML_SIMPLE ); |