diff options
author | Michael Stahl <mstahl@redhat.com> | 2017-07-13 21:58:48 +0200 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2017-07-31 12:03:54 +0200 |
commit | a6b7bd710adb29b8738563d86e1b39caf4822b07 (patch) | |
tree | 56d9c93e17966bd987384c5a615928959205048e | |
parent | 8e11dd0fd9d1d994028e80270750415e187da49b (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
(cherry picked from commit b3992ddcd13082a934246b717ae22f57394e6533)
Reviewed-on: https://gerrit.libreoffice.org/39966
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
(cherry picked from commit 753eb4b54c5ce2a1ce0f392505b5e18a1a10d905)
Reviewed-on: https://gerrit.libreoffice.org/40177
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
(cherry picked from commit 953c801a678d8af180e27cf67b057136a55be60a)
-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 95013a03a27d..6d8f0185c249 100644 --- a/xmloff/source/draw/shapeexport.cxx +++ b/xmloff/source/draw/shapeexport.cxx @@ -2323,17 +2323,20 @@ void XMLShapeExport::ImpExportGraphicObjectShape( // apply possible changed stream URL to embedded image object if ( bIsEmbeddedImageWithExistingStreamInPackage ) { - aStreamURL = sPackageURL; + OUString newStreamURL = sPackageURL; if ( aStr[0] == '#' ) { - aStreamURL = aStreamURL.concat( aStr.copy( 1, aStr.getLength() - 1 ) ); + newStreamURL = newStreamURL.concat( aStr.copy( 1, aStr.getLength() - 1 ) ); } else { - aStreamURL = aStreamURL.concat( aStr ); + newStreamURL = newStreamURL.concat( 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 ); |