diff options
author | Michael Meeks <michael.meeks@collabora.com> | 2020-11-19 20:27:13 +0000 |
---|---|---|
committer | Ashod Nakashian <ash@collabora.com> | 2020-12-08 00:52:47 +0100 |
commit | a52246d5a45548820dac55395e64dc1ff83ae11f (patch) | |
tree | fd9bb479e0fe90afbca2e056136f8575348c08a8 /filter/source/svg | |
parent | f177e666d3de0e8cf8c241f346127d02dc691f83 (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>
Diffstat (limited to 'filter/source/svg')
-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 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)) ); |