summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2019-07-08 11:45:11 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2019-07-08 14:30:22 +0200
commit207c368f4bfdbef8fde8efbf75f4fdcf7e0917ba (patch)
treed741c71f5e62f700cf71c8378cf075fdad5e4362 /svx
parent351b730e012fd4562f341967f740f8146aa0538e (diff)
use BitmapEx in ImpCreateShadowObjectClone
Change-Id: I7737c8b19dca787eab70b733d07a34a5e5f01c9c Reviewed-on: https://gerrit.libreoffice.org/75208 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'svx')
-rw-r--r--svx/source/svdraw/svdoashp.cxx32
1 files changed, 5 insertions, 27 deletions
diff --git a/svx/source/svdraw/svdoashp.cxx b/svx/source/svdraw/svdoashp.cxx
index 45d8db33a2b3..603bedcf9924 100644
--- a/svx/source/svdraw/svdoashp.cxx
+++ b/svx/source/svdraw/svdoashp.cxx
@@ -354,35 +354,13 @@ static SdrObject* ImpCreateShadowObjectClone(const SdrObject& rOriginal, const S
{
GraphicObject aGraphicObject(rOriginalSet.Get(XATTR_FILLBITMAP).GetGraphicObject());
const BitmapEx aBitmapEx(aGraphicObject.GetGraphic().GetBitmapEx());
- Bitmap aBitmap(aBitmapEx.GetBitmap());
- if(!aBitmap.IsEmpty())
+ if(!aBitmapEx.IsEmpty())
{
- Bitmap::ScopedReadAccess pReadAccess(aBitmap);
-
- if(pReadAccess)
- {
- ScopedVclPtr<VirtualDevice> pVirDev(VclPtr<VirtualDevice>::Create());
- pVirDev->SetOutputSizePixel(aBitmap.GetSizePixel());
-
- for(long y(0); y < pReadAccess->Height(); y++)
- {
- for(long x(0); x < pReadAccess->Width(); x++)
- {
- const BitmapColor aColor = pReadAccess->GetColor(y, x);
- sal_uInt16 nLuminance(static_cast<sal_uInt16>(aColor.GetLuminance()) + 1);
- const Color aDestColor(
- static_cast<sal_uInt8>((nLuminance * static_cast<sal_uInt16>(aShadowColor.GetRed())) >> 8),
- static_cast<sal_uInt8>((nLuminance * static_cast<sal_uInt16>(aShadowColor.GetGreen())) >> 8),
- static_cast<sal_uInt8>((nLuminance * static_cast<sal_uInt16>(aShadowColor.GetBlue())) >> 8));
- pVirDev->DrawPixel(Point(x,y), aDestColor);
- }
- }
-
- pReadAccess.reset();
-
- aGraphicObject.SetGraphic(Graphic(pVirDev->GetBitmapEx(Point(0,0), aBitmap.GetSizePixel())));
- }
+ ScopedVclPtr<VirtualDevice> pVirDev(VclPtr<VirtualDevice>::Create());
+ pVirDev->SetOutputSizePixel(aBitmapEx.GetSizePixel());
+ pVirDev->DrawShadowBitmapEx(aBitmapEx, aShadowColor);
+ aGraphicObject.SetGraphic(Graphic(pVirDev->GetBitmapEx(Point(0,0), aBitmapEx.GetSizePixel())));
}
aTempSet.Put(XFillBitmapItem(aGraphicObject));