summaryrefslogtreecommitdiff
path: root/xmloff
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2017-07-13 21:58:48 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2017-07-20 11:22:12 +0200
commit953c801a678d8af180e27cf67b057136a55be60a (patch)
tree2a6c5b625b9d2ed87717eaa0a31b3a3daf7b9a48 /xmloff
parent142ab1c3e452109d2e5143d26abc6f13e904d7a7 (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>
Diffstat (limited to 'xmloff')
-rw-r--r--xmloff/source/draw/shapeexport.cxx11
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 );