Kaydet (Commit) 8de89e1c authored tarafından Tomaž Vajngerl's avatar Tomaž Vajngerl Kaydeden (comit) Tomaž Vajngerl

Fix crash in widget drawing of a SVG as image

Change-Id: Iaa7e01b49b9c2dcdfa98e4e8bc431dba82fe6bb4
Reviewed-on: https://gerrit.libreoffice.org/68942
Tested-by: Jenkins
Reviewed-by: 's avatarTomaž Vajngerl <quikee@gmail.com>
üst ba0abd02
......@@ -329,8 +329,21 @@ void munchDrawCommands(std::vector<std::shared_ptr<DrawCommand>> const& rDrawCom
long nImageWidth = aBitmap.GetSizePixel().Width();
long nImageHeight = aBitmap.GetSizePixel().Height();
SalTwoRect aTR(0, 0, nImageWidth, nImageHeight, nX, nY, nImageWidth, nImageHeight);
rGraphics.DrawBitmap(aTR, *aBitmap.GetBitmap().ImplGetSalBitmap().get(),
*aBitmap.GetAlpha().ImplGetSalBitmap().get(), nullptr);
if (!!aBitmap)
{
const std::shared_ptr<SalBitmap> pSalBitmap
= aBitmap.GetBitmap().ImplGetSalBitmap();
if (aBitmap.IsAlpha())
{
const std::shared_ptr<SalBitmap> pSalBitmapAlpha
= aBitmap.GetAlpha().ImplGetSalBitmap();
rGraphics.DrawBitmap(aTR, *pSalBitmap, *pSalBitmapAlpha, nullptr);
}
else
{
rGraphics.DrawBitmap(aTR, *pSalBitmap, nullptr);
}
}
}
break;
case DrawCommandType::EXTERNAL:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment