Kaydet (Commit) 3749bea8 authored tarafından Caolán McNamara's avatar Caolán McNamara

making a disabled image from a 1 bit depth icon gives index asserts

cause the disabled color cannot be mapped to the 2 entries in the
palette, so use 8bit dests if the src is 1bit

regression from

commit 507d0ded
Author: Caolán McNamara <caolanm@redhat.com>
Date:   Tue Dec 1 12:18:57 2015 +0000

    keep disable image at same depth as original

seen when clicking on the image loaded from tdf#100632

Change-Id: Ic69bccfa0fc86707b4fd9e757d8374d80e4b0071
üst 272e761a
...@@ -59,7 +59,14 @@ BitmapEx BitmapProcessor::createDisabledImage(const BitmapEx& rBitmapEx) ...@@ -59,7 +59,14 @@ BitmapEx BitmapProcessor::createDisabledImage(const BitmapEx& rBitmapEx)
{ {
const Size aSize(rBitmapEx.GetSizePixel()); const Size aSize(rBitmapEx.GetSizePixel());
Bitmap aGrey(aSize, rBitmapEx.GetBitCount()); //keep disable image at same depth as original where possible, otherwise
//use 8 bit
sal_uInt16 nBitCount = rBitmapEx.GetBitCount();
if (nBitCount < 8)
nBitCount = 8;
const BitmapPalette* pPal = nBitCount == 8 ? &Bitmap::GetGreyPalette(256) : nullptr;
Bitmap aGrey(aSize, nBitCount, pPal);
AlphaMask aGreyAlpha(aSize); AlphaMask aGreyAlpha(aSize);
Bitmap aBitmap(rBitmapEx.GetBitmap()); Bitmap aBitmap(rBitmapEx.GetBitmap());
......
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