vcl/source/gdi/impgraph.cxx | 40 ++++++++++++++++++---------------------- 1 file changed, 18 insertions(+), 22 deletions(-)
New commits: commit bba0fa96e37f866bba871693bbc6363feb08ea3b Author: Tomaž Vajngerl <tomaz.vajng...@collabora.co.uk> AuthorDate: Sun Dec 6 21:01:40 2020 +0900 Commit: Tomaž Vajngerl <qui...@gmail.com> CommitDate: Sun Dec 6 23:34:13 2020 +0100 graphic: clean-up and simplify GetChecksum in ImpGraphic - rearrange the switch statement for GraphicTypes - remove the unneeded aRet variable Change-Id: I1be95db377548cf1a6db430fe66ce06bc7f93d97 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107286 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <qui...@gmail.com> diff --git a/vcl/source/gdi/impgraph.cxx b/vcl/source/gdi/impgraph.cxx index b1bab153deff..aed7f2e86772 100644 --- a/vcl/source/gdi/impgraph.cxx +++ b/vcl/source/gdi/impgraph.cxx @@ -1747,36 +1747,32 @@ BitmapChecksum ImpGraphic::ImplGetChecksum() const if (mnChecksum != 0) return mnChecksum; - BitmapChecksum nRet = 0; - ensureAvailable(); - if( ImplIsSupportedGraphic() && !isSwappedOut() ) + switch (meType) { - switch( meType ) - { - case GraphicType::Default: + case GraphicType::NONE: + case GraphicType::Default: break; - case GraphicType::Bitmap: - { - if(maVectorGraphicData) - nRet = maVectorGraphicData->GetChecksum(); - else if( mpAnimation ) - nRet = mpAnimation->GetChecksum(); - else - nRet = maBitmapEx.GetChecksum(); - } - break; + case GraphicType::Bitmap: + { + if (maVectorGraphicData) + mnChecksum = maVectorGraphicData->GetChecksum(); + else if (mpAnimation) + mnChecksum = mpAnimation->GetChecksum(); + else + mnChecksum = maBitmapEx.GetChecksum(); + } + break; - default: - nRet = maMetaFile.GetChecksum(); - break; + case GraphicType::GdiMetafile: + { + mnChecksum = maMetaFile.GetChecksum(); } + break; } - - mnChecksum = nRet; - return nRet; + return mnChecksum; } bool ImpGraphic::ImplExportNative( SvStream& rOStm ) const _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits