[Libreoffice-commits] core.git: Branch 'libreoffice-5-4' - xmloff/source
Michael Stahl
mstahl at redhat.com
Sun Jul 16 15:30:31 UTC 2017
xmloff/source/draw/shapeexport.cxx | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
New commits:
commit 753eb4b54c5ce2a1ce0f392505b5e18a1a10d905
Author: Michael Stahl <mstahl at redhat.com>
Date: Thu Jul 13 21:58:48 2017 +0200
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 at libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
Tested-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/xmloff/source/draw/shapeexport.cxx b/xmloff/source/draw/shapeexport.cxx
index 0116c610a5c6..399544cae531 100644
--- a/xmloff/source/draw/shapeexport.cxx
+++ b/xmloff/source/draw/shapeexport.cxx
@@ -2313,17 +2313,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 );
More information about the Libreoffice-commits
mailing list