diff options
author | Michael Meeks <michael.meeks@collabora.com> | 2020-11-19 20:27:13 +0000 |
---|---|---|
committer | Michael Meeks <michael.meeks@collabora.com> | 2020-12-08 10:01:51 +0100 |
commit | 8932cc857f62be4073a7de69491b1fd8565c44aa (patch) | |
tree | 404d63a61427898747df53afbf1903202580b93d | |
parent | 9a8126262a8afba46efbfac5160b5f8cf13c9bd6 (diff) |
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@gmail.com>
Reviewed-by: Ashod Nakashian <ash@collabora.com>
(cherry picked from commit a52246d5a45548820dac55395e64dc1ff83ae11f)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107375
Tested-by: Jenkins
-rw-r--r-- | filter/source/svg/svgexport.cxx | 7 |
1 files changed, 4 insertions, 3 deletions
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)) ); |