xmloff/source/draw/shapeexport.cxx |   11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

New commits:
commit 953c801a678d8af180e27cf67b057136a55be60a
Author: Michael Stahl <[email protected]>
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 <[email protected]>
    Reviewed-by: Caolán McNamara <[email protected]>
    Tested-by: Caolán McNamara <[email protected]>
    (cherry picked from commit 753eb4b54c5ce2a1ce0f392505b5e18a1a10d905)
    Reviewed-on: https://gerrit.libreoffice.org/40177
    Reviewed-by: Miklos Vajna <[email protected]>

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 );
_______________________________________________
Libreoffice-commits mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to