tdf#131532:Blurry thumbnails when small shapes added to gallery theme
When small shape is added to gallery theme using drag and drop method, their
thumbnail is rendered improperly and as a result they are blurry.
This change renders the thumbnails normally without getting blurred.
Change-Id: Ibba7e93ba09a42b0d1bf4a1a833f3fe17c8557f9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91319
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
diff --git a/svx/source/gallery2/galobj.cxx b/svx/source/gallery2/galobj.cxx
index b22b376..4adb4fe 100644
--- a/svx/source/gallery2/galobj.cxx
+++ b/svx/source/gallery2/galobj.cxx
@@ -452,31 +452,9 @@ bool SgaObjectSvDraw::CreateThumb( const FmFormModel& rModel )
aView.ShowSdrPage(const_cast< FmFormPage* >(pPage));
aView.MarkAllObj();
aThumbBmp = aView.GetMarkedObjBitmapEx();
const Size aDiscreteSize(aThumbBmp.GetSizePixel());
if(aDiscreteSize.Width() && aDiscreteSize.Height())
{
sal_uInt32 nTargetSizeX(S_THUMB);
sal_uInt32 nTargetSizeY(S_THUMB);
if(aDiscreteSize.Width() > aDiscreteSize.Height())
{
nTargetSizeY = (aDiscreteSize.Height() * nTargetSizeX) / aDiscreteSize.Width();
}
else
{
nTargetSizeX = (aDiscreteSize.Width() * nTargetSizeY) / aDiscreteSize.Height();
}
if(!!aThumbBmp)
{
aThumbBmp.Scale(Size(nTargetSizeX, nTargetSizeY), BmpScaleFlag::BestQuality);
aThumbBmp.Convert(BmpConversion::N8BitColors);
bRet = true;
}
}
aThumbBmp = aView.GetMarkedObjBitmapEx(true);
aGraphic = Graphic(aThumbBmp);
bRet = SgaObject::CreateThumb(aGraphic);
}
}
}