diff options
Diffstat (limited to 'vcl/unx/generic/gdi/salgdi2.cxx')
-rw-r--r-- | vcl/unx/generic/gdi/salgdi2.cxx | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/vcl/unx/generic/gdi/salgdi2.cxx b/vcl/unx/generic/gdi/salgdi2.cxx index 0288e0555771..3a54d53f3674 100644 --- a/vcl/unx/generic/gdi/salgdi2.cxx +++ b/vcl/unx/generic/gdi/salgdi2.cxx @@ -471,8 +471,10 @@ void X11SalGraphics::drawBitmap( const SalTwoRect* pPosAry, const SalBitmap& rSa const BitmapPalette& rPalette = pBitmapBuffer->maPalette; if (rPalette.GetEntryCount() == 2) { - aNewVal.foreground = rColMap.GetPixel(ImplColorToSal(rPalette[0])); - aNewVal.background = rColMap.GetPixel(ImplColorToSal(rPalette[1])); + const BitmapColor aBlack( rPalette[rPalette.GetBestIndex( Color( COL_BLACK ) )] ); + const BitmapColor aWhite( rPalette[rPalette.GetBestIndex( Color( COL_WHITE ) )] ); + aNewVal.foreground = rColMap.GetPixel(ImplColorToSal(aWhite)); + aNewVal.background = rColMap.GetPixel(ImplColorToSal(aBlack)); } } |