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>
diff --git a/vcl/source/gdi/impgraph.cxx b/vcl/source/gdi/impgraph.cxx
index b1bab15..aed7f2e 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::NONE:
case GraphicType::Default:
break;
case GraphicType::Bitmap:
{
case GraphicType::Default:
break;
case GraphicType::Bitmap:
{
if(maVectorGraphicData)
nRet = maVectorGraphicData->GetChecksum();
else if( mpAnimation )
nRet = mpAnimation->GetChecksum();
else
nRet = maBitmapEx.GetChecksum();
}
break;
default:
nRet = maMetaFile.GetChecksum();
break;
if (maVectorGraphicData)
mnChecksum = maVectorGraphicData->GetChecksum();
else if (mpAnimation)
mnChecksum = mpAnimation->GetChecksum();
else
mnChecksum = maBitmapEx.GetChecksum();
}
}
break;
mnChecksum = nRet;
return nRet;
case GraphicType::GdiMetafile:
{
mnChecksum = maMetaFile.GetChecksum();
}
break;
}
return mnChecksum;
}
bool ImpGraphic::ImplExportNative( SvStream& rOStm ) const