[Libreoffice-commits] core.git: filter/source

Michael Meeks (via logerrit) logerrit at kemper.freedesktop.org
Tue Dec 8 09:02:40 UTC 2020


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

New commits:
commit 8932cc857f62be4073a7de69491b1fd8565c44aa
Author:     Michael Meeks <michael.meeks at collabora.com>
AuthorDate: Thu Nov 19 20:27:13 2020 +0000
Commit:     Michael Meeks <michael.meeks at collabora.com>
CommitDate: Tue Dec 8 10:01:51 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>
    (cherry picked from commit a52246d5a45548820dac55395e64dc1ff83ae11f)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107375
    Tested-by: Jenkins

diff --git a/filter/source/svg/svgexport.cxx b/filter/source/svg/svgexport.cxx
index 26f17227552e..bcf97a8b0678 100644
--- a/filter/source/svg/svgexport.cxx
+++ b/filter/source/svg/svgexport.cxx
@@ -706,9 +706,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