diff options
author | Philipp Lohmann [pl] <Philipp.Lohmann@Oracle.COM> | 2011-02-23 16:37:27 +0100 |
---|---|---|
committer | Philipp Lohmann [pl] <Philipp.Lohmann@Oracle.COM> | 2011-02-23 16:37:27 +0100 |
commit | 3bcb29437f1d91476e759f0a6d3b72d7da3ce37f (patch) | |
tree | 5f58d1540b1a94f05ed44e20108479917d5a0856 /vcl/source/gdi/bitmap.cxx | |
parent | c7908996ac968e0c10e6b60590d8d54748fe4e69 (diff) | |
parent | e2a3d487efb2bd5e582eb10e4150530c3f7377c5 (diff) |
vcl119: rebase to DEV300_m101
Diffstat (limited to 'vcl/source/gdi/bitmap.cxx')
-rw-r--r-- | vcl/source/gdi/bitmap.cxx | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/vcl/source/gdi/bitmap.cxx b/vcl/source/gdi/bitmap.cxx index 5f434f9ba48a..8d831961f8af 100644 --- a/vcl/source/gdi/bitmap.cxx +++ b/vcl/source/gdi/bitmap.cxx @@ -236,9 +236,13 @@ bool BitmapPalette::IsGreyPalette() const const int nEntryCount = GetEntryCount(); if( !nEntryCount ) // NOTE: an empty palette means 1:1 mapping return true; - const BitmapPalette& rGreyPalette = Bitmap::GetGreyPalette( nEntryCount ); - if( rGreyPalette == *this ) - return true; + // see above: only certain entry values will result in a valid call to GetGreyPalette + if( nEntryCount == 2 || nEntryCount == 4 || nEntryCount == 16 || nEntryCount == 256 ) + { + const BitmapPalette& rGreyPalette = Bitmap::GetGreyPalette( nEntryCount ); + if( rGreyPalette == *this ) + return true; + } // TODO: is it worth to compare the entries? return false; } |