summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2020-12-06 21:01:40 +0900
committerTomaž Vajngerl <quikee@gmail.com>2020-12-06 23:34:13 +0100
commitbba0fa96e37f866bba871693bbc6363feb08ea3b (patch)
treed4ada616c595cb41679ccac6f8e0271a619d84fb
parent2b46b310c0b5371bf929d298b602f405e276d7d2 (diff)
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 <quikee@gmail.com>
-rw-r--r--vcl/source/gdi/impgraph.cxx40
1 files changed, 18 insertions, 22 deletions
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