From 93aa3cb5c6c6771e68683fc6c7468c7930492c65 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Toma=C5=BE=20Vajngerl?= <quikee@gmail.com>
Date: Wed, 6 Jun 2012 22:55:30 +0200
Subject: [PATCH] Fix new Bitmap creation in Lanczos resampling.

Bitmaps in Lanczos resampling were not created correctly. This
problem was visible in Impress when the background of a slide was
set to "tile".

Change-Id: Ic77ae1f20a872176eacb1f28175d53b4a0934008
---
 vcl/source/gdi/bitmap3.cxx |    5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/vcl/source/gdi/bitmap3.cxx b/vcl/source/gdi/bitmap3.cxx
index 094dcd3..ec458d9 100644
--- a/vcl/source/gdi/bitmap3.cxx
+++ b/vcl/source/gdi/bitmap3.cxx
@@ -2208,7 +2208,6 @@ sal_Bool Bitmap::Adjust( short nLuminancePercent, short nContrastPercent,
     return bRet;
 }
 
-//-----------------------------------------------------------------------------------
 bool Bitmap::ImplScaleLanczos( const double& rScaleX, const double& rScaleY )
 {
     const Size  aSizePix( GetSizePixel() );
@@ -2232,7 +2231,7 @@ bool Bitmap::ImplScaleLanczos( const double& rScaleX, const double& rScaleY )
     ImplCalculateContributions( nWidth, nNewWidth, aSupport, aNumberOfContributions, pWeights, pPixels, pCount );
 
     BitmapReadAccess* pReadAcc = AcquireReadAccess();
-    Bitmap aNewBitmap( Size( nNewWidth, nHeight ), GetBitCount(), &pReadAcc->GetPalette() );
+    Bitmap aNewBitmap( Size( nNewWidth, nHeight ), 24);
     bool bResult = ImplHorizontalConvolution( aNewBitmap, pReadAcc, aNumberOfContributions, pWeights, pPixels, pCount );
 
     // Cleanup
@@ -2260,7 +2259,7 @@ bool Bitmap::ImplScaleLanczos( const double& rScaleX, const double& rScaleY )
     ImplCalculateContributions(nHeight, nNewHeight, aSupport, aNumberOfContributions, pWeights, pPixels, pCount );
 
     pReadAcc = AcquireReadAccess();
-    aNewBitmap = Bitmap( Size( nNewWidth, nNewHeight ), GetBitCount(), &pReadAcc->GetPalette() );
+    aNewBitmap = Bitmap( Size( nNewWidth, nNewHeight ), 24);
     bResult = ImplVerticalConvolution( aNewBitmap, pReadAcc, aNumberOfContributions, pWeights, pPixels, pCount );
 
     // Cleanup
-- 
1.7.9.5

