[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.4' - filter/source

Michael Meeks (via logerrit) logerrit at kemper.freedesktop.org
Mon Dec 7 23:53:19 UTC 2020


 filter/source/svg/svgexport.cxx |    7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

New commits:
commit a52246d5a45548820dac55395e64dc1ff83ae11f
Author:     Michael Meeks <michael.meeks at collabora.com>
AuthorDate: Thu Nov 19 20:27:13 2020 +0000
Commit:     Ashod Nakashian <ash at collabora.com>
CommitDate: Tue Dec 8 00:52:47 2020 +0100

    Avoid calculating checksums if we can.
    
    We can compare the underlying mxImpGraphic pointers via the
    Graphic's uno tunnelling magic easily enough anyway.
    
    Change-Id: I09bd0fd97b662f07378197fce2956ed0776ba458
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106186
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Ashod Nakashian <ash at collabora.com>

diff --git a/filter/source/svg/svgexport.cxx b/filter/source/svg/svgexport.cxx
index 50083f7b1f8d..d30415380207 100644
--- a/filter/source/svg/svgexport.cxx
+++ b/filter/source/svg/svgexport.cxx
@@ -701,9 +701,10 @@ bool SVGFilter::implExportWriterTextGraphic( const Reference< view::XSelectionSu
         if (!xTransformedGraphic.is())
             return false;
         const Graphic aTransformedGraphic(xTransformedGraphic);
-        bool bChecksumMatches = aOriginalGraphic.GetChecksum() == aTransformedGraphic.GetChecksum();
-        const Graphic aGraphic = bChecksumMatches ? aOriginalGraphic : aTransformedGraphic;
-        uno::Reference<graphic::XGraphic> xGraphic = bChecksumMatches ? xOriginalGraphic : xTransformedGraphic;
+        bool bSameGraphic = aTransformedGraphic == aOriginalGraphic ||
+            aOriginalGraphic.GetChecksum() == aTransformedGraphic.GetChecksum();
+        const Graphic aGraphic = bSameGraphic ? aOriginalGraphic : aTransformedGraphic;
+        uno::Reference<graphic::XGraphic> xGraphic = bSameGraphic ? xOriginalGraphic : xTransformedGraphic;
 
         // Calculate size from Graphic
         Point aPos( OutputDevice::LogicToLogic(aGraphic.GetPrefMapMode().GetOrigin(), aGraphic.GetPrefMapMode(), MapMode(MapUnit::Map100thMM)) );


More information about the Libreoffice-commits mailing list