diff options
author | Michael Meeks <michael.meeks@collabora.com> | 2020-11-19 20:27:13 +0000 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2021-03-31 10:28:13 +0200 |
commit | 7664f0d0b5237a94c2ecd32a0b51d33bbbe82523 (patch) | |
tree | ad238d42b7acc377c919def4b5f7a39b1e69748f /filter | |
parent | OSL_FAIL.*exception -> TOOLS_WARN_EXCEPTION (diff) | |
download | core-7664f0d0b5237a94c2ecd32a0b51d33bbbe82523.tar.gz core-7664f0d0b5237a94c2ecd32a0b51d33bbbe82523.zip |
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
Diffstat (limited to 'filter')
-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)) ); |