incubator-ooo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From h..@apache.org
Subject svn commit: r1400149 [1/2] - in /incubator/ooo/trunk/main: binfilter/bf_svx/source/svdraw/ canvas/source/vcl/ filter/source/graphicfilter/egif/ filter/source/graphicfilter/epbm/ filter/source/graphicfilter/epgm/ filter/source/graphicfilter/epict/ filte...
Date Fri, 19 Oct 2012 16:12:42 GMT
Author: hdu
Date: Fri Oct 19 16:12:40 2012
New Revision: 1400149

URL: http://svn.apache.org/viewvc?rev=1400149&view=rev
Log:
make conversions between BitmapColor and sal_uInt8 explicit

Implicit conversions are a dangerous cause of confusion as seen
in http://markmail.org/thread/a4copx2di7cxeowg and require tricky
rewrites to work around them, this change cleans them up and
disables them for all code outside of the immutable binfilter.

Modified:
    incubator/ooo/trunk/main/binfilter/bf_svx/source/svdraw/svx_svdetc.cxx
    incubator/ooo/trunk/main/canvas/source/vcl/impltools.cxx
    incubator/ooo/trunk/main/filter/source/graphicfilter/egif/egif.cxx
    incubator/ooo/trunk/main/filter/source/graphicfilter/epbm/epbm.cxx
    incubator/ooo/trunk/main/filter/source/graphicfilter/epgm/epgm.cxx
    incubator/ooo/trunk/main/filter/source/graphicfilter/epict/epict.cxx
    incubator/ooo/trunk/main/filter/source/graphicfilter/eps/eps.cxx
    incubator/ooo/trunk/main/filter/source/graphicfilter/eras/eras.cxx
    incubator/ooo/trunk/main/filter/source/graphicfilter/etiff/etiff.cxx
    incubator/ooo/trunk/main/filter/source/graphicfilter/expm/expm.cxx
    incubator/ooo/trunk/main/filter/source/graphicfilter/icgm/bitmap.cxx
    incubator/ooo/trunk/main/filter/source/graphicfilter/ieps/ieps.cxx
    incubator/ooo/trunk/main/filter/source/graphicfilter/ipbm/ipbm.cxx
    incubator/ooo/trunk/main/filter/source/graphicfilter/ipcx/ipcx.cxx
    incubator/ooo/trunk/main/filter/source/graphicfilter/ipict/ipict.cxx
    incubator/ooo/trunk/main/filter/source/graphicfilter/ipsd/ipsd.cxx
    incubator/ooo/trunk/main/filter/source/graphicfilter/iras/iras.cxx
    incubator/ooo/trunk/main/filter/source/graphicfilter/itga/itga.cxx
    incubator/ooo/trunk/main/filter/source/graphicfilter/itiff/itiff.cxx
    incubator/ooo/trunk/main/filter/source/msfilter/svdfppt.cxx
    incubator/ooo/trunk/main/sd/source/ui/slidesorter/view/SlsButtonBar.cxx
    incubator/ooo/trunk/main/svtools/source/filter/igif/gifread.cxx
    incubator/ooo/trunk/main/svtools/source/filter/jpeg/jpeg.cxx
    incubator/ooo/trunk/main/svtools/source/filter/wmf/winwmf.cxx
    incubator/ooo/trunk/main/svtools/source/graphic/grfmgr2.cxx
    incubator/ooo/trunk/main/svtools/source/graphic/transformer.cxx
    incubator/ooo/trunk/main/svx/source/svdraw/svdetc.cxx
    incubator/ooo/trunk/main/svx/source/xoutdev/_xoutbmp.cxx
    incubator/ooo/trunk/main/svx/source/xoutdev/xattrbmp.cxx
    incubator/ooo/trunk/main/vcl/inc/vcl/bmpacc.hxx
    incubator/ooo/trunk/main/vcl/inc/vcl/salbtype.hxx
    incubator/ooo/trunk/main/vcl/source/gdi/bitmap.cxx
    incubator/ooo/trunk/main/vcl/source/gdi/bitmap2.cxx
    incubator/ooo/trunk/main/vcl/source/gdi/bitmap3.cxx
    incubator/ooo/trunk/main/vcl/source/gdi/bitmap4.cxx
    incubator/ooo/trunk/main/vcl/source/gdi/bmpacc2.cxx
    incubator/ooo/trunk/main/vcl/source/gdi/octree.cxx
    incubator/ooo/trunk/main/vcl/source/gdi/outdev2.cxx
    incubator/ooo/trunk/main/vcl/source/gdi/pngread.cxx
    incubator/ooo/trunk/main/vcl/source/gdi/pngwrite.cxx
    incubator/ooo/trunk/main/vcl/source/helper/canvasbitmap.cxx
    incubator/ooo/trunk/main/vcl/source/helper/canvastools.cxx

Modified: incubator/ooo/trunk/main/binfilter/bf_svx/source/svdraw/svx_svdetc.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/binfilter/bf_svx/source/svdraw/svx_svdetc.cxx?rev=1400149&r1=1400148&r2=1400149&view=diff
==============================================================================
--- incubator/ooo/trunk/main/binfilter/bf_svx/source/svdraw/svx_svdetc.cxx (original)
+++ incubator/ooo/trunk/main/binfilter/bf_svx/source/svdraw/svx_svdetc.cxx Fri Oct 19 16:12:40 2012
@@ -502,9 +502,7 @@ namespace binfilter {
 /*?*/ 				{
 /*?*/ 					for(sal_uInt32 nX(0L); nX < nWidth; nX += nXStep)
 /*?*/ 					{
-/*?*/ 						const BitmapColor& rCol = (pAccess->HasPalette())
-/*?*/ 							? pAccess->GetPaletteColor((BYTE)pAccess->GetPixel(nY, nX))
-/*?*/ 							: pAccess->GetPixel(nY, nX);
+/*?*/ 						const BitmapColor& rCol = pAccess->GetColor(nY, nX);
 /*?*/ 
 /*?*/ 						nRt += rCol.GetRed(); 
 /*?*/ 						nGn += rCol.GetGreen(); 

Modified: incubator/ooo/trunk/main/canvas/source/vcl/impltools.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/canvas/source/vcl/impltools.cxx?rev=1400149&r1=1400148&r2=1400149&view=diff
==============================================================================
--- incubator/ooo/trunk/main/canvas/source/vcl/impltools.cxx (original)
+++ incubator/ooo/trunk/main/canvas/source/vcl/impltools.cxx Fri Oct 19 16:12:40 2012
@@ -382,18 +382,10 @@ namespace vclcanvas
                                         // (invert 'alpha' pixel value, 
                                         // to get the standard alpha 
                                         // channel behaviour)
-                                        pAlphaWriteAccess->SetPixel( y, x, 
-                                                                     BitmapColor( 
-                                                                         255U - 
-                                                                         static_cast<sal_uInt8>(
-                                                                             nAlphaModulation*
-                                                                             (255U
-                                                                              - aAlphaMap[ pAlphaReadAccess->GetPixel( 
-                                                                                               nSrcY,
-                                                                                               nSrcX ).GetIndex() ] ) + .5 ) ) );
-
-                                        BitmapColor aColor( pReadAccess->GetPixel( nSrcY,
-                                                                                   nSrcX ) );
+                                        const sal_uInt8 cMappedAlphaIdx = aAlphaMap[ pAlphaReadAccess->GetPixelIndex( nSrcY, nSrcX ) ];
+                                        const sal_uInt8 cModulatedAlphaIdx = 255U - static_cast<sal_uInt8>( nAlphaModulation* (255U - cMappedAlphaIdx) + .5 );
+                                        pAlphaWriteAccess->SetPixelIndex( y, x, cModulatedAlphaIdx );
+                                        BitmapColor aColor( pReadAccess->GetPixel( nSrcY, nSrcX ) );
 
                                         aColor.SetRed( 
                                             static_cast<sal_uInt8>(
@@ -482,17 +474,13 @@ namespace vclcanvas
                                     if( nSrcX < 0 || nSrcX >= aBmpSize.Width() ||
                                         nSrcY < 0 || nSrcY >= aBmpSize.Height() )
                                     {
-                                        pAlphaWriteAccess->SetPixel( y, x, BitmapColor(255) );
+                                        pAlphaWriteAccess->SetPixelIndex( y, x, 255 );
                                     }
                                     else
                                     {
-                                        pAlphaWriteAccess->SetPixel( y, x, 
-                                                                     aAlphaMap[ 
-                                                                         pAlphaReadAccess->GetPixel( nSrcY,
-                                                                                                     nSrcX ) ] );
-
-                                        pWriteAccess->SetPixel( y, x, pReadAccess->GetPixel( nSrcY,
-                                                                                             nSrcX ) );
+                                        const sal_uInt8 cAlphaIdx = pAlphaReadAccess->GetPixelIndex( nSrcY, nSrcX );
+                                        pAlphaWriteAccess->SetPixelIndex( y, x, aAlphaMap[ cAlphaIdx ] );
+                                        pWriteAccess->SetPixel( y, x, pReadAccess->GetPixel( nSrcY, nSrcX ) );
                                     }
                                 }
                             }

Modified: incubator/ooo/trunk/main/filter/source/graphicfilter/egif/egif.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/filter/source/graphicfilter/egif/egif.cxx?rev=1400149&r1=1400148&r2=1400149&view=diff
==============================================================================
--- incubator/ooo/trunk/main/filter/source/graphicfilter/egif/egif.cxx (original)
+++ incubator/ooo/trunk/main/filter/source/graphicfilter/egif/egif.cxx Fri Oct 19 16:12:40 2012
@@ -522,7 +522,7 @@ void GIFWriter::WriteAccess()
 			else
 			{
 				for( long nX = 0L; nX < nWidth; nX++ )
-					pBuffer[ nX ] = (sal_uInt8) pAcc->GetPixel( nY, nX );
+					pBuffer[ nX ] = pAcc->GetPixelIndex( nY, nX );
 
 				aCompressor.Compress( pBuffer, nWidth );
 			}

Modified: incubator/ooo/trunk/main/filter/source/graphicfilter/epbm/epbm.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/filter/source/graphicfilter/epbm/epbm.cxx?rev=1400149&r1=1400148&r2=1400149&view=diff
==============================================================================
--- incubator/ooo/trunk/main/filter/source/graphicfilter/epbm/epbm.cxx (original)
+++ incubator/ooo/trunk/main/filter/source/graphicfilter/epbm/epbm.cxx Fri Oct 19 16:12:40 2012
@@ -153,7 +153,7 @@ void PBMWriter::ImplWriteBody()
 			for ( x = 0; x < mnWidth; x++ )
 			{
 				nBYTE <<= 1;
-				if (!(mpAcc->GetPixel( y, x ) & 1 ) )
+				if (!(mpAcc->GetPixelIndex( y, x ) & 1 ) )
 					nBYTE++;
 				if ( ( x & 7 ) == 7 )
 					*mpOStm << nBYTE;
@@ -175,7 +175,7 @@ void PBMWriter::ImplWriteBody()
 					nxCount = 69;
 					*mpOStm << (sal_uInt8)10;
 				}
-				*mpOStm << (sal_uInt8)( ( mpAcc->GetPixel( y, x ) ^ 1 ) + '0' ) ;
+				*mpOStm << (sal_uInt8)( ( mpAcc->GetPixelIndex( y, x ) ^ 1 ) + '0' ) ;
 			}
 			*mpOStm << (sal_uInt8)10;
 		}

Modified: incubator/ooo/trunk/main/filter/source/graphicfilter/epgm/epgm.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/filter/source/graphicfilter/epgm/epgm.cxx?rev=1400149&r1=1400148&r2=1400149&view=diff
==============================================================================
--- incubator/ooo/trunk/main/filter/source/graphicfilter/epgm/epgm.cxx (original)
+++ incubator/ooo/trunk/main/filter/source/graphicfilter/epgm/epgm.cxx Fri Oct 19 16:12:40 2012
@@ -155,7 +155,7 @@ void PGMWriter::ImplWriteBody()
 		{
 			for ( sal_uLong x = 0; x < mnWidth; x++ )
 			{
-				*mpOStm << (sal_uInt8)( mpAcc->GetPixel( y, x ) );
+				*mpOStm << mpAcc->GetPixelIndex( y, x );
 			}
 		}
 	}
@@ -172,7 +172,7 @@ void PGMWriter::ImplWriteBody()
 					nCount = 69;
 					*mpOStm << (sal_uInt8)10;
 				}
-				nDat = (sal_uInt8)mpAcc->GetPixel( y, x );
+				nDat = mpAcc->GetPixelIndex( y, x );
                 nNumb = nDat / 100;
 				if ( nNumb )
 				{

Modified: incubator/ooo/trunk/main/filter/source/graphicfilter/epict/epict.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/filter/source/graphicfilter/epict/epict.cxx?rev=1400149&r1=1400148&r2=1400149&view=diff
==============================================================================
--- incubator/ooo/trunk/main/filter/source/graphicfilter/epict/epict.cxx (original)
+++ incubator/ooo/trunk/main/filter/source/graphicfilter/epict/epict.cxx Fri Oct 19 16:12:40 2012
@@ -1183,17 +1183,17 @@ void PictWriter::WriteOpcode_BitsRect(co
 					for ( pTemp = pPix, i = 0; i < nSrcRowBytes; i++ )
 						*pTemp++ = (sal_uInt8)0;
 					for ( i = 0; i < nWidth; i++ )
-						pPix[ ( i >> 3 ) ] |= (sal_uInt8)( pAcc->GetPixel( ny, i ) & 1 ) << ( ( i & 7 ) ^ 7 );
+						pPix[ ( i >> 3 ) ] |= (pAcc->GetPixelIndex( ny, i ) & 1) << ((i & 7) ^ 7);
 					break;
 				case 4 :
 					for ( pTemp = pPix, i = 0; i < nSrcRowBytes; i++ )
 						*pTemp++ = (sal_uInt8)0;
 					for ( i = 0; i < nWidth; i++ )
-						pPix[ ( i >> 1 ) ] |= (sal_uInt8)( pAcc->GetPixel( ny, i ) & 15 ) << ( ( i & 1 ) << 2 ) ;
+						pPix[ ( i >> 1 ) ] |= (pAcc->GetPixelIndex( ny, i ) & 15) << ((i & 1) << 2);
 					break;
 				case 8 :
 					for ( i = 0; i < nWidth; i++ )
-						pPix[ i ] = (sal_uInt8)pAcc->GetPixel( ny, i );
+						pPix[ i ] = pAcc->GetPixelIndex( ny, i );
 					break;
 			}
 

Modified: incubator/ooo/trunk/main/filter/source/graphicfilter/eps/eps.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/filter/source/graphicfilter/eps/eps.cxx?rev=1400149&r1=1400148&r2=1400149&view=diff
==============================================================================
--- incubator/ooo/trunk/main/filter/source/graphicfilter/eps/eps.cxx (original)
+++ incubator/ooo/trunk/main/filter/source/graphicfilter/eps/eps.cxx Fri Oct 19 16:12:40 2012
@@ -1780,7 +1780,7 @@ void PSWriter::ImplBmp( Bitmap* pBitmap,
 			{
 				for ( long x = 0; x < nWidth; x++ )
 				{
-					ImplWriteHexByte( (sal_uInt8)pAcc->GetPixel( y, x ) );
+					ImplWriteHexByte( pAcc->GetPixelIndex( y, x ) );
 				}
 			}
 			*mpPS << (sal_uInt8)10;
@@ -1818,7 +1818,7 @@ void PSWriter::ImplBmp( Bitmap* pBitmap,
 					{
 						for ( long x = 0; x < nWidth; x++ )
 						{
-							Compress( (sal_uInt8)pAcc->GetPixel( y, x ) );
+							Compress( pAcc->GetPixelIndex( y, x ) );
 						}
 					}
 					EndCompression();
@@ -1829,7 +1829,7 @@ void PSWriter::ImplBmp( Bitmap* pBitmap,
 					{
 						for ( long x = 0; x < nWidth; x++ )
 						{
-							ImplWriteHexByte( (sal_uInt8)pAcc->GetPixel( y, x ) );
+							ImplWriteHexByte( pAcc->GetPixelIndex( y, x ) );
 						}
 					}
 				}
@@ -1881,7 +1881,7 @@ void PSWriter::ImplBmp( Bitmap* pBitmap,
 						{
 							for ( long x = 0; x < nWidth; x++ )
 							{
-								Compress( (sal_uInt8)pAcc->GetPixel( y, x ) );
+								Compress( pAcc->GetPixelIndex( y, x ) );
 							}
 						}
 						EndCompression();
@@ -1892,7 +1892,7 @@ void PSWriter::ImplBmp( Bitmap* pBitmap,
 						{
 							for ( long x = 0; x < nWidth; x++ )
 							{
-								ImplWriteHexByte( (sal_uInt8)pAcc->GetPixel( y, x ) );
+								ImplWriteHexByte( pAcc->GetPixelIndex( y, x ) );
 							}
 						}
 					}

Modified: incubator/ooo/trunk/main/filter/source/graphicfilter/eras/eras.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/filter/source/graphicfilter/eras/eras.cxx?rev=1400149&r1=1400148&r2=1400149&view=diff
==============================================================================
--- incubator/ooo/trunk/main/filter/source/graphicfilter/eras/eras.cxx (original)
+++ incubator/ooo/trunk/main/filter/source/graphicfilter/eras/eras.cxx Fri Oct 19 16:12:40 2012
@@ -210,7 +210,7 @@ void RASWriter::ImplWriteBody()
 			ImplCallback( y );								// processing output
 			for ( x = 0; x < mnWidth; x++ )
 			{
-				ImplPutByte ( mpAcc->GetPixel( y, x ) );
+				ImplPutByte ( mpAcc->GetPixelIndex( y, x ) );
 			}
 			if ( x & 1 ) ImplPutByte( 0 );		// WORD ALIGNMENT ???
 		}
@@ -224,7 +224,7 @@ void RASWriter::ImplWriteBody()
 			ImplCallback( y );								// processing output
 			for ( x = 0; x < mnWidth; x++ )
 			{
-				nDat = ( ( nDat << 1 ) | ( mpAcc->GetPixel ( y, x ) & 1 ) );
+				nDat = ( ( nDat << 1 ) | ( mpAcc->GetPixelIndex( y, x ) & 1 ) );
 				if ( ( x & 7 ) == 7 )
 					ImplPutByte( nDat );
 			}

Modified: incubator/ooo/trunk/main/filter/source/graphicfilter/etiff/etiff.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/filter/source/graphicfilter/etiff/etiff.cxx?rev=1400149&r1=1400148&r2=1400149&view=diff
==============================================================================
--- incubator/ooo/trunk/main/filter/source/graphicfilter/etiff/etiff.cxx (original)
+++ incubator/ooo/trunk/main/filter/source/graphicfilter/etiff/etiff.cxx Fri Oct 19 16:12:40 2012
@@ -397,7 +397,7 @@ sal_Bool TIFFWriter::ImplWriteBody()
 				ImplCallback( 100 * mnCurAllPictHeight / mnSumOfAllPictHeight );
 				for ( x = 0; x < mnWidth; x++ )
 				{
-					Compress( mpAcc->GetPixel( y, x ) );
+					Compress( mpAcc->GetPixelIndex( y, x ) );
 				}
 			}
 		}
@@ -411,9 +411,9 @@ sal_Bool TIFFWriter::ImplWriteBody()
 				for ( x = 0; x < mnWidth; x++, nShift++ )
 				{
 					if (!( nShift & 1 ))
-						nTemp = ( (sal_uInt8)mpAcc->GetPixel( y, x ) << 4 );
+						nTemp = ( mpAcc->GetPixelIndex( y, x ) << 4 );
 					else
-						Compress( (sal_uInt8)( nTemp | ( mpAcc->GetPixel( y, x ) & 0xf ) ) );
+						Compress( (sal_uInt8)( nTemp | ( mpAcc->GetPixelIndex( y, x ) & 0xf ) ) );
 				}
 				if ( nShift & 1 )
 					Compress( nTemp );
@@ -430,7 +430,7 @@ sal_Bool TIFFWriter::ImplWriteBody()
 				for ( x = 0; x < mnWidth; x++)
 				{
 					j <<= 1;
-					j |= ( ( ~mpAcc->GetPixel( y, x ) ) & 1 );
+					j |= ( ( ~mpAcc->GetPixelIndex( y, x ) ) & 1 );
 					if ( j & 0x100 )
 					{
 						Compress( (sal_uInt8)j );

Modified: incubator/ooo/trunk/main/filter/source/graphicfilter/expm/expm.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/filter/source/graphicfilter/expm/expm.cxx?rev=1400149&r1=1400148&r2=1400149&view=diff
==============================================================================
--- incubator/ooo/trunk/main/filter/source/graphicfilter/expm/expm.cxx (original)
+++ incubator/ooo/trunk/main/filter/source/graphicfilter/expm/expm.cxx Fri Oct 19 16:12:40 2012
@@ -176,7 +176,7 @@ void XPMWriter::ImplWritePalette()
 	sal_uInt16 nTransIndex = 0xffff;
 
 	if ( mbTrans )
-		nTransIndex = mpAcc->GetBestMatchingColor( BMP_COL_TRANS );
+		nTransIndex = mpAcc->GetBestPaletteIndex( BMP_COL_TRANS );
 	for ( sal_uInt16 i = 0; i < mnColors; i++ )
 	{
 		*mpOStm << "\x22";
@@ -202,7 +202,7 @@ void XPMWriter::ImplWriteBody()
 		*mpOStm << (sal_uInt8)0x22;
 		for ( sal_uLong x = 0; x < mnWidth; x++ )
 		{
-			ImplWritePixel( (sal_uInt8)(mpAcc->GetPixel( y, x ) ) );
+			ImplWritePixel( mpAcc->GetPixelIndex( y, x ) );
 		}
 		*mpOStm << "\x22,\x0a";
 	}

Modified: incubator/ooo/trunk/main/filter/source/graphicfilter/icgm/bitmap.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/filter/source/graphicfilter/icgm/bitmap.cxx?rev=1400149&r1=1400148&r2=1400149&view=diff
==============================================================================
--- incubator/ooo/trunk/main/filter/source/graphicfilter/icgm/bitmap.cxx (original)
+++ incubator/ooo/trunk/main/filter/source/graphicfilter/icgm/bitmap.cxx Fri Oct 19 16:12:40 2012
@@ -81,7 +81,7 @@ void CGMBitmap::ImplGetBitmap( CGMBitmap
 							nxC = nxCount;
 							for ( nx = 0; --nxC; nx++ )
 							{	// this is not fast, but a one bit/pixel format is rarely used
-								rDesc.mpAcc->SetPixel( ny, nx, (sal_Int8)( (*( rDesc.mpBuf + ( nx >> 3 ) ) >> ( ( nx & 7 ) ^ 7 ) ) ) & 1 );
+								rDesc.mpAcc->SetPixelIndex( ny, nx, static_cast<sal_uInt8>( (*( rDesc.mpBuf + (nx >> 3)) >> ((nx & 7)^7))) & 1 );
 							}
 						}
 					}
@@ -95,7 +95,7 @@ void CGMBitmap::ImplGetBitmap( CGMBitmap
 							nxC = nxCount;
 							for ( nx = 0; --nxC; nx++ )
 							{	// this is not fast, but a two bits/pixel format is rarely used
-								rDesc.mpAcc->SetPixel( ny, nx, (sal_Int8)( (*( rDesc.mpBuf + ( nx >> 2 ) ) >> ( ( ( nx & 3 ) ^ 3 ) << 1 ) ) ) & 3 );
+								rDesc.mpAcc->SetPixelIndex( ny, nx, static_cast<sal_uInt8>( (*(rDesc.mpBuf + (nx >> 2)) >> (((nx & 3)^3) << 1))) & 3 );
 							}
 						}
 					}
@@ -112,11 +112,11 @@ void CGMBitmap::ImplGetBitmap( CGMBitmap
 							for ( nx = 0; --nxC; nx++ )
 							{
 								nDat = *pTemp++;
-								rDesc.mpAcc->SetPixel( ny, nx, (sal_Int8)( nDat >> 4 ) );
+								rDesc.mpAcc->SetPixelIndex( ny, nx, static_cast<sal_uInt8>(nDat >> 4) );
 								if ( --nxC )
 								{
 									nx ++;
-									rDesc.mpAcc->SetPixel( ny, nx, (sal_Int8)( nDat & 15 ) );
+									rDesc.mpAcc->SetPixelIndex( ny, nx, static_cast<sal_uInt8>(nDat & 15) );
 								}
 								else
 									break;
@@ -134,7 +134,7 @@ void CGMBitmap::ImplGetBitmap( CGMBitmap
 							nxC = nxCount;
 							for ( nx = 0; --nxC; nx++ )
 							{
-								rDesc.mpAcc->SetPixel( ny, nx, (sal_Int8)( *pTemp++ ) );
+								rDesc.mpAcc->SetPixelIndex( ny, nx, *(pTemp++) );
 							}
 						}
 					}

Modified: incubator/ooo/trunk/main/filter/source/graphicfilter/ieps/ieps.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/filter/source/graphicfilter/ieps/ieps.cxx?rev=1400149&r1=1400148&r2=1400149&view=diff
==============================================================================
--- incubator/ooo/trunk/main/filter/source/graphicfilter/ieps/ieps.cxx (original)
+++ incubator/ooo/trunk/main/filter/source/graphicfilter/ieps/ieps.cxx Fri Oct 19 16:12:40 2012
@@ -648,10 +648,10 @@ extern "C" sal_Bool GraphicImport(SvStre
 											}
 										}
 										if ( nBitDepth == 1 )
-											pAcc->SetPixel( y, x, sal::static_int_cast< sal_uInt8 >(( nDat >> nBitsLeft ) & 1) );
+											pAcc->SetPixelIndex( y, x, static_cast<sal_uInt8>(nDat >> nBitsLeft) & 1 );
 										else
 										{
-											pAcc->SetPixel( y, x, ( nDat ) ? 1 : 0 );	// nBitDepth == 8
+											pAcc->SetPixelIndex( y, x, nDat ? 1 : 0 );	// nBitDepth == 8
 											nBitsLeft = 0;
 										}
 									}

Modified: incubator/ooo/trunk/main/filter/source/graphicfilter/ipbm/ipbm.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/filter/source/graphicfilter/ipbm/ipbm.cxx?rev=1400149&r1=1400148&r2=1400149&view=diff
==============================================================================
--- incubator/ooo/trunk/main/filter/source/graphicfilter/ipbm/ipbm.cxx (original)
+++ incubator/ooo/trunk/main/filter/source/graphicfilter/ipbm/ipbm.cxx Fri Oct 19 16:12:40 2012
@@ -276,7 +276,7 @@ sal_Bool PBMReader::ImplReadBody()
 						*mpPBM >> nDat;
 						nShift = 7;
 					}
-					mpAcc->SetPixel( nHeight, nWidth, nDat >> nShift );
+					mpAcc->SetPixelIndex( nHeight, nWidth, nDat >> nShift );
 					if ( ++nWidth == mnWidth )
 					{
 						nShift = 0;
@@ -295,7 +295,7 @@ sal_Bool PBMReader::ImplReadBody()
 						return sal_False;
 
 					*mpPBM >> nDat;
-					mpAcc->SetPixel( nHeight, nWidth++, nDat);
+					mpAcc->SetPixelIndex( nHeight, nWidth++, nDat);
 
 					if ( nWidth == mnWidth )
 					{
@@ -356,7 +356,7 @@ sal_Bool PBMReader::ImplReadBody()
 
 				if ( nDat == '0' || nDat == '1' )
 				{
-					mpAcc->SetPixel( nHeight, nWidth, (sal_uInt8)nDat-'0' );
+					mpAcc->SetPixelIndex( nHeight, nWidth, static_cast<sal_uInt8>(nDat - '0') );
 					nWidth++;
 					if ( nWidth == mnWidth )
 					{
@@ -385,7 +385,7 @@ sal_Bool PBMReader::ImplReadBody()
 					nCount--;
 					if ( nGrey <= mnMaxVal )
 						nGrey = 255 * nGrey / mnMaxVal;
-						mpAcc->SetPixel( nHeight, nWidth++, (sal_uInt8)nGrey );
+						mpAcc->SetPixelIndex( nHeight, nWidth++, static_cast<sal_uInt8>(nGrey) );
 					nGrey = 0;
 					if ( nWidth == mnWidth )
 					{

Modified: incubator/ooo/trunk/main/filter/source/graphicfilter/ipcx/ipcx.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/filter/source/graphicfilter/ipcx/ipcx.cxx?rev=1400149&r1=1400148&r2=1400149&view=diff
==============================================================================
--- incubator/ooo/trunk/main/filter/source/graphicfilter/ipcx/ipcx.cxx (original)
+++ incubator/ooo/trunk/main/filter/source/graphicfilter/ipcx/ipcx.cxx Fri Oct 19 16:12:40 2012
@@ -308,12 +308,9 @@ void PCXReader::ImplReadBody()
 				{
 					sal_uLong nShift = ( i & 7 ) ^ 7;
 					if ( nShift == 0 )
-						pAcc->SetPixel( ny, i, ( *pSource1++ & 1 ) );
+						pAcc->SetPixelIndex( ny, i, *(pSource1++) & 1 );
 					else
-						pAcc->SetPixel(
-                            ny, i,
-                            sal::static_int_cast< sal_uInt8 >(
-                                ( *pSource1 >> nShift ) & 1) );
+						pAcc->SetPixelIndex( ny, i, (*pSource1 >> nShift ) & 1 );
 				}
 				break;
 			// 4 colors
@@ -335,14 +332,14 @@ void PCXReader::ImplReadBody()
 							nCol = ( *pSource1++ ) & 0x03;
 							break;
 					}
-					pAcc->SetPixel( ny, i, nCol );
+					pAcc->SetPixelIndex( ny, i, nCol );
 				}
 				break;
 			// 256 colors
 			case 0x108 :
 				for ( i = 0; i < nWidth; i++ )
 				{
-					pAcc->SetPixel( ny, i, *pSource1++ );
+					pAcc->SetPixelIndex( ny, i, *pSource1++ );
 				}
 				break;
 			// 8 colors
@@ -353,14 +350,14 @@ void PCXReader::ImplReadBody()
 					if ( nShift == 0 )
 					{
 						nCol = ( *pSource1++ & 1) + ( ( *pSource2++ << 1 ) & 2 ) + ( ( *pSource3++ << 2 ) & 4 );
-						pAcc->SetPixel( ny, i, nCol );
+						pAcc->SetPixelIndex( ny, i, nCol );
 					}
 					else
 					{
 						nCol = sal::static_int_cast< sal_uInt8 >(
                             ( ( *pSource1 >> nShift ) & 1)  + ( ( ( *pSource2 >> nShift ) << 1 ) & 2 ) +
 							( ( ( *pSource3 >> nShift ) << 2 ) & 4 ));
-						pAcc->SetPixel( ny, i, nCol );
+						pAcc->SetPixelIndex( ny, i, nCol );
 					}
 				}
 				break;
@@ -373,14 +370,14 @@ void PCXReader::ImplReadBody()
 					{
 						nCol = ( *pSource1++ & 1) + ( ( *pSource2++ << 1 ) & 2 ) + ( ( *pSource3++ << 2 ) & 4 ) +
 							( ( *pSource4++ << 3 ) & 8 );
-						pAcc->SetPixel( ny, i, nCol );
+						pAcc->SetPixelIndex( ny, i, nCol );
 					}
 					else
 					{
 						nCol = sal::static_int_cast< sal_uInt8 >(
                             ( ( *pSource1 >> nShift ) & 1)  + ( ( ( *pSource2 >> nShift ) << 1 ) & 2 ) +
 							( ( ( *pSource3 >> nShift ) << 2 ) & 4 ) + ( ( ( *pSource4 >> nShift ) << 3 ) & 8 ));
-						pAcc->SetPixel( ny, i, nCol );
+						pAcc->SetPixelIndex( ny, i, nCol );
 					}
 				}
 				break;

Modified: incubator/ooo/trunk/main/filter/source/graphicfilter/ipict/ipict.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/filter/source/graphicfilter/ipict/ipict.cxx?rev=1400149&r1=1400148&r2=1400149&view=diff
==============================================================================
--- incubator/ooo/trunk/main/filter/source/graphicfilter/ipict/ipict.cxx (original)
+++ incubator/ooo/trunk/main/filter/source/graphicfilter/ipict/ipict.cxx Fri Oct 19 16:12:40 2012
@@ -260,38 +260,38 @@ public:
 	switch ( nPixelSize )								\
 	{													\
 		case 1 :										\
-			pAcc->SetPixel( ny, nx++, nDat >> 7 );		\
+			pAcc->SetPixelIndex( ny, nx++, nDat >> 7 );	\
 			if ( nx == nWidth ) break;					\
-			pAcc->SetPixel( ny, nx++, nDat >> 6 );		\
+			pAcc->SetPixelIndex( ny, nx++, nDat >> 6 );	\
 			if ( nx == nWidth ) break;					\
-			pAcc->SetPixel( ny, nx++, nDat >> 5 );		\
+			pAcc->SetPixelIndex( ny, nx++, nDat >> 5 );	\
 			if ( nx == nWidth ) break;					\
-			pAcc->SetPixel( ny, nx++, nDat >> 4 );		\
+			pAcc->SetPixelIndex( ny, nx++, nDat >> 4 );	\
 			if ( nx == nWidth ) break;					\
-			pAcc->SetPixel( ny, nx++, nDat >> 3 );		\
+			pAcc->SetPixelIndex( ny, nx++, nDat >> 3 );	\
 			if ( nx == nWidth ) break;					\
-			pAcc->SetPixel( ny, nx++, nDat >> 2 );		\
+			pAcc->SetPixelIndex( ny, nx++, nDat >> 2 );	\
 			if ( nx == nWidth ) break;					\
-			pAcc->SetPixel( ny, nx++, nDat >> 1 );		\
+			pAcc->SetPixelIndex( ny, nx++, nDat >> 1 );	\
 			if ( nx == nWidth ) break;					\
-			pAcc->SetPixel( ny, nx++, nDat );			\
+			pAcc->SetPixelIndex( ny, nx++, nDat );		\
 			break;										\
 		case 2 :										\
-			pAcc->SetPixel( ny, nx++, nDat >> 6 );		\
+			pAcc->SetPixelIndex( ny, nx++, nDat >> 6 );	\
 			if ( nx == nWidth ) break;					\
-			pAcc->SetPixel( ny, nx++, nDat >> 4 & 3);	\
+			pAcc->SetPixelIndex( ny, nx++, (nDat>>4)&3);\
 			if ( nx == nWidth ) break;					\
-			pAcc->SetPixel( ny, nx++, nDat >> 2 & 3 );	\
+			pAcc->SetPixelIndex( ny, nx++, (nDat>>2)&3 );\
 			if ( nx == nWidth ) break;					\
-			pAcc->SetPixel( ny, nx++, nDat & 3);		\
+			pAcc->SetPixelIndex( ny, nx++, nDat & 3);		\
 			break;										\
 		case 4 :										\
-			pAcc->SetPixel( ny, nx++, nDat >> 4 );		\
+			pAcc->SetPixelIndex( ny, nx++, nDat >> 4 );	\
 			if ( nx == nWidth ) break;					\
-			pAcc->SetPixel( ny, nx++, nDat );			\
+			pAcc->SetPixelIndex( ny, nx++, nDat );		\
 			break;										\
 		case 8 :										\
-			pAcc->SetPixel( ny, nx++, nDat );			\
+			pAcc->SetPixelIndex( ny, nx++, nDat );		\
 			break;										\
 	}
 

Modified: incubator/ooo/trunk/main/filter/source/graphicfilter/ipsd/ipsd.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/filter/source/graphicfilter/ipsd/ipsd.cxx?rev=1400149&r1=1400148&r2=1400149&view=diff
==============================================================================
--- incubator/ooo/trunk/main/filter/source/graphicfilter/ipsd/ipsd.cxx (original)
+++ incubator/ooo/trunk/main/filter/source/graphicfilter/ipsd/ipsd.cxx Fri Oct 19 16:12:40 2012
@@ -368,7 +368,7 @@ sal_Bool PSDReader::ImplReadBody()
 					}
 					for ( sal_uInt16 i = 0; i < ( -nRunCount + 1 ); i++ )
 					{
-						mpWriteAcc->SetPixel( nY, nX, (sal_uInt8)nDat >> nBitCount-- );
+						mpWriteAcc->SetPixelIndex( nY, nX, nDat >> nBitCount-- );
 						if ( ++nX == mpFileHeader->nColumns )
 						{
 							nX = 0;
@@ -389,7 +389,7 @@ sal_Bool PSDReader::ImplReadBody()
 							nDat ^= 0xff;
 							nBitCount = 7;
 						}
-						mpWriteAcc->SetPixel( nY, nX, (sal_uInt8)nDat >> nBitCount-- );
+						mpWriteAcc->SetPixelIndex( nY, nX, nDat >> nBitCount-- );
 						if ( ++nX == mpFileHeader->nColumns )
 						{
 							nX = 0;
@@ -418,7 +418,7 @@ sal_Bool PSDReader::ImplReadBody()
 						*mpPSD >> nDummy;
 					for ( sal_uInt16 i = 0; i < ( -nRunCount + 1 ); i++ )
 					{
-						mpWriteAcc->SetPixel( nY, nX, (sal_uInt8)nDat );
+						mpWriteAcc->SetPixelIndex( nY, nX, nDat );
 						if ( ++nX == mpFileHeader->nColumns )
 						{
 							nX = 0;
@@ -435,7 +435,7 @@ sal_Bool PSDReader::ImplReadBody()
 						*mpPSD >> nDat;
 						if ( mpFileHeader->nDepth == 16 )	// 16 bit depth is to be skipped
 							*mpPSD >> nDummy;
-						mpWriteAcc->SetPixel( nY, nX, (sal_uInt8)nDat );
+						mpWriteAcc->SetPixelIndex( nY, nX, nDat );
 						if ( ++nX == mpFileHeader->nColumns )
 						{
 							nX = 0;
@@ -686,7 +686,7 @@ sal_Bool PSDReader::ImplReadBody()
 					*mpPSD >> nDummy;
 				for ( sal_uInt16 i = 0; i < ( -nRunCount + 1 ); i++ )
 				{
-					mpMaskWriteAcc->SetPixel( nY, nX, (sal_uInt8)nDat );
+					mpMaskWriteAcc->SetPixelIndex( nY, nX, nDat );
 					if ( ++nX == mpFileHeader->nColumns )
 					{
 						nX = 0;
@@ -707,7 +707,7 @@ sal_Bool PSDReader::ImplReadBody()
 						nDat = 1;
 					if ( mpFileHeader->nDepth == 16 )	// 16 bit depth is to be skipped
 						*mpPSD >> nDummy;
-					mpMaskWriteAcc->SetPixel( nY, nX, (sal_uInt8)nDat );
+					mpMaskWriteAcc->SetPixelIndex( nY, nX, nDat );
 					if ( ++nX == mpFileHeader->nColumns )
 					{
 						nX = 0;

Modified: incubator/ooo/trunk/main/filter/source/graphicfilter/iras/iras.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/filter/source/graphicfilter/iras/iras.cxx?rev=1400149&r1=1400148&r2=1400149&view=diff
==============================================================================
--- incubator/ooo/trunk/main/filter/source/graphicfilter/iras/iras.cxx (original)
+++ incubator/ooo/trunk/main/filter/source/graphicfilter/iras/iras.cxx Fri Oct 19 16:12:40 2012
@@ -229,8 +229,7 @@ sal_Bool RASReader::ImplReadBody()
 				{
 					if (!(x & 7))
 						nDat = ImplGetByte();
-					mpAcc->SetPixel (
-                        y, x,
+					mpAcc->SetPixelIndex( y, x,
                         sal::static_int_cast< sal_uInt8 >(
                             nDat >> ( ( x & 7 ) ^ 7 )) );
 				}
@@ -244,7 +243,7 @@ sal_Bool RASReader::ImplReadBody()
 				for ( x = 0; x < mnWidth; x++ )
 				{
 					nDat = ImplGetByte();
-					mpAcc->SetPixel ( y, x, nDat );
+					mpAcc->SetPixelIndex( y, x, nDat );
 				}
 				if ( x & 1 ) ImplGetByte();						// WORD ALIGNMENT ???
 			}

Modified: incubator/ooo/trunk/main/filter/source/graphicfilter/itga/itga.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/filter/source/graphicfilter/itga/itga.cxx?rev=1400149&r1=1400148&r2=1400149&view=diff
==============================================================================
--- incubator/ooo/trunk/main/filter/source/graphicfilter/itga/itga.cxx (original)
+++ incubator/ooo/trunk/main/filter/source/graphicfilter/itga/itga.cxx Fri Oct 19 16:12:40 2012
@@ -380,7 +380,7 @@ sal_Bool TGAReader::ImplReadBody()
 								return sal_False;
 							for ( sal_uInt16 i = 0; i < ( ( nRunCount & 0x7f ) + 1 ); i++ )
 							{
-								mpAcc->SetPixel( nY, nX, (sal_uInt8)nDummy );
+								mpAcc->SetPixelIndex( nY, nX, nDummy );
 								nX += nXAdd;
 								nXCount++;
 								if ( nXCount == mpFileHeader->nImageWidth )
@@ -403,7 +403,7 @@ sal_Bool TGAReader::ImplReadBody()
 								*mpTGA >> nDummy;
 								if ( nDummy >= mpFileHeader->nColorMapLength )
 									return sal_False;
-								mpAcc->SetPixel( nY, nX, (sal_uInt8)nDummy );
+								mpAcc->SetPixelIndex( nY, nX, nDummy );
 								nX += nXAdd;
 								nXCount++;
 								if ( nXCount == mpFileHeader->nImageWidth )
@@ -617,7 +617,7 @@ sal_Bool TGAReader::ImplReadBody()
 							*mpTGA >> nDummy;
 							if ( nDummy >= mpFileHeader->nColorMapLength )
 								return sal_False;
-							mpAcc->SetPixel( nY, nX, (sal_uInt8)nDummy );
+							mpAcc->SetPixelIndex( nY, nX, nDummy );
 						}
 						break;
 					default:

Modified: incubator/ooo/trunk/main/filter/source/graphicfilter/itiff/itiff.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/filter/source/graphicfilter/itiff/itiff.cxx?rev=1400149&r1=1400148&r2=1400149&view=diff
==============================================================================
--- incubator/ooo/trunk/main/filter/source/graphicfilter/itiff/itiff.cxx (original)
+++ incubator/ooo/trunk/main/filter/source/graphicfilter/itiff/itiff.cxx Fri Oct 19 16:12:40 2012
@@ -871,7 +871,7 @@ sal_Bool TIFFReader::ConvertScanline( sa
 							nLast = BYTESWAP( (sal_uInt8)*pt++ );
 							for ( nx = 0; nx < nImageWidth; nx++ )
 							{
-								pAcc->SetPixel( nY, nx, nLast );
+								pAcc->SetPixelIndex( nY, nx, nLast );
 								nLast = nLast + *pt++;
 							}
 						}
@@ -880,7 +880,7 @@ sal_Bool TIFFReader::ConvertScanline( sa
 							for ( nx = 0; nx < nImageWidth; nx++ )
 							{
 								nLast = *pt++;
-								pAcc->SetPixel( nY, nx, (sal_uInt8)( ( (BYTESWAP((sal_uLong)nLast ) - nMinSampleValue ) * nMinMax ) ) );
+								pAcc->SetPixelIndex( nY, nx, static_cast<sal_uInt8>( (BYTESWAP((sal_uLong)nLast) - nMinSampleValue) * nMinMax ) );
 							}
 						}
 					}
@@ -891,7 +891,7 @@ sal_Bool TIFFReader::ConvertScanline( sa
 							nLast = *pt++;
 							for ( nx = 0; nx < nImageWidth; nx++ )
 							{
-								pAcc->SetPixel( nY, nx, nLast );
+								pAcc->SetPixelIndex( nY, nx, nLast );
 								nLast = nLast + *pt++;
 							}
 						}
@@ -899,7 +899,7 @@ sal_Bool TIFFReader::ConvertScanline( sa
 						{
 							for ( nx = 0; nx < nImageWidth; nx++ )
 							{
-								pAcc->SetPixel( nY, nx, (sal_uInt8)( ( (sal_uLong)*pt++ - nMinSampleValue ) * nMinMax ) );
+								pAcc->SetPixelIndex( nY, nx, static_cast<sal_uInt8>( ((sal_uLong)*pt++ - nMinSampleValue) * nMinMax ) );
 
 							}
 						}
@@ -917,7 +917,7 @@ sal_Bool TIFFReader::ConvertScanline( sa
 					for ( nx = 0; nx < nImageWidth; nx++ )
 					{
 						nVal = ( GetBits( pt, nx * nBitsPerSample, nBitsPerSample ) - nMinSampleValue ) * nMinMax;
-						pAcc->SetPixel( nY, nx, (sal_uInt8)nVal );
+						pAcc->SetPixelIndex( nY, nx, static_cast<sal_uInt8>(nVal));
 					}
 				}
 				break;
@@ -931,28 +931,28 @@ sal_Bool TIFFReader::ConvertScanline( sa
 						while ( --nByteCount )
 						{
 							nByteVal = *pt++;
-							pAcc->SetPixel( nY, nx++, nByteVal & 1 );
+							pAcc->SetPixelIndex( nY, nx++, nByteVal & 1 );
 							nByteVal >>= 1;
-							pAcc->SetPixel( nY, nx++, nByteVal & 1 );
+							pAcc->SetPixelIndex( nY, nx++, nByteVal & 1 );
 							nByteVal >>= 1;
-							pAcc->SetPixel( nY, nx++, nByteVal & 1 );
+							pAcc->SetPixelIndex( nY, nx++, nByteVal & 1 );
 							nByteVal >>= 1;
-							pAcc->SetPixel( nY, nx++, nByteVal & 1 );
+							pAcc->SetPixelIndex( nY, nx++, nByteVal & 1 );
 							nByteVal >>= 1;
-							pAcc->SetPixel( nY, nx++, nByteVal & 1 );
+							pAcc->SetPixelIndex( nY, nx++, nByteVal & 1 );
 							nByteVal >>= 1;
-							pAcc->SetPixel( nY, nx++, nByteVal & 1 );
+							pAcc->SetPixelIndex( nY, nx++, nByteVal & 1 );
 							nByteVal >>= 1;
-							pAcc->SetPixel( nY, nx++, nByteVal & 1 );
+							pAcc->SetPixelIndex( nY, nx++, nByteVal & 1 );
 							nByteVal >>= 1;
-							pAcc->SetPixel( nY, nx++, nByteVal );
+							pAcc->SetPixelIndex( nY, nx++, nByteVal );
 						}
 						if ( nImageWidth & 7 )
 						{
 							nByteVal = *pt++;
 							while ( nx < nImageWidth )
 							{
-								pAcc->SetPixel( nY, nx++, nByteVal & 1 );
+								pAcc->SetPixelIndex( nY, nx++, nByteVal & 1 );
 								nByteVal >>= 1;
 							}
 						}
@@ -964,21 +964,21 @@ sal_Bool TIFFReader::ConvertScanline( sa
 						while ( --nByteCount )
 						{
 							nByteVal = *pt++;
-							pAcc->SetPixel( nY, nx, nByteVal & 1 );
+							pAcc->SetPixelIndex( nY, nx, nByteVal & 1 );
 							nByteVal >>= 1;
-							pAcc->SetPixel( nY, --nx, nByteVal & 1 );
+							pAcc->SetPixelIndex( nY, --nx, nByteVal & 1 );
 							nByteVal >>= 1;
-							pAcc->SetPixel( nY, --nx, nByteVal & 1 );
+							pAcc->SetPixelIndex( nY, --nx, nByteVal & 1 );
 							nByteVal >>= 1;
-							pAcc->SetPixel( nY, --nx, nByteVal & 1 );
+							pAcc->SetPixelIndex( nY, --nx, nByteVal & 1 );
 							nByteVal >>= 1;
-							pAcc->SetPixel( nY, --nx, nByteVal & 1 );
+							pAcc->SetPixelIndex( nY, --nx, nByteVal & 1 );
 							nByteVal >>= 1;
-							pAcc->SetPixel( nY, --nx, nByteVal & 1 );
+							pAcc->SetPixelIndex( nY, --nx, nByteVal & 1 );
 							nByteVal >>= 1;
-							pAcc->SetPixel( nY, --nx, nByteVal & 1 );
+							pAcc->SetPixelIndex( nY, --nx, nByteVal & 1 );
 							nByteVal >>= 1;
-							pAcc->SetPixel( nY, --nx, nByteVal );
+							pAcc->SetPixelIndex( nY, --nx, nByteVal );
 							nx += 15;
 						}
 						if ( nImageWidth & 7 )
@@ -988,7 +988,7 @@ sal_Bool TIFFReader::ConvertScanline( sa
 							nShift = 7;
 							while ( nx < nImageWidth )
 							{
-								pAcc->SetPixel( nY, nx++, ( nByteVal >> nShift ) & 1);
+								pAcc->SetPixelIndex( nY, nx++, ( nByteVal >> nShift ) & 1);
 							}
 						}
 					}
@@ -1011,7 +1011,7 @@ sal_Bool TIFFReader::ConvertScanline( sa
 				pt++;
 			for ( nx = 0; nx < nImageWidth; nx++, pt += 2 )
 			{
-				pAcc->SetPixel( nY, nx, (sal_uInt8)( ( (sal_uLong)*pt - nMinSampleValue ) * nMinMax ) );
+				pAcc->SetPixelIndex( nY, nx, static_cast<sal_uInt8>( ((sal_uLong)*pt - nMinSampleValue) * nMinMax) );
 			}
 		}
 	}

Modified: incubator/ooo/trunk/main/filter/source/msfilter/svdfppt.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/filter/source/msfilter/svdfppt.cxx?rev=1400149&r1=1400148&r2=1400149&view=diff
==============================================================================
--- incubator/ooo/trunk/main/filter/source/msfilter/svdfppt.cxx (original)
+++ incubator/ooo/trunk/main/filter/source/msfilter/svdfppt.cxx Fri Oct 19 16:12:40 2012
@@ -5912,7 +5912,7 @@ void PPTPortionObj::ApplyTo(  SfxItemSet
 								{
 									for( long nX = 0L; nX < nWidth; nX++ )
 									{
-										const BitmapColor& rCol = pAcc->GetPaletteColor( (sal_uInt8) pAcc->GetPixel( nY, nX ) );
+										const BitmapColor& rCol = pAcc->GetPaletteColor( pAcc->GetPixelIndex( nY, nX ) );
 										nRt+=rCol.GetRed(); nGn+=rCol.GetGreen(); nBl+=rCol.GetBlue();
 									}
 								}

Modified: incubator/ooo/trunk/main/sd/source/ui/slidesorter/view/SlsButtonBar.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/sd/source/ui/slidesorter/view/SlsButtonBar.cxx?rev=1400149&r1=1400148&r2=1400149&view=diff
==============================================================================
--- incubator/ooo/trunk/main/sd/source/ui/slidesorter/view/SlsButtonBar.cxx (original)
+++ incubator/ooo/trunk/main/sd/source/ui/slidesorter/view/SlsButtonBar.cxx Fri Oct 19 16:12:40 2012
@@ -158,7 +158,7 @@ namespace {
                             static_cast<sal_Int32>(nValue * (1-nAlpha)),
                             0,
                             255));
-                    pBitmap->SetPixel(nY, nX, 255-sal_uInt8(nNewValue));
+                    pBitmap->SetPixelIndex(nY, nX, static_cast<sal_uInt8>(255-nNewValue));
                 }
         }
     }

Modified: incubator/ooo/trunk/main/svtools/source/filter/igif/gifread.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/svtools/source/filter/igif/gifread.cxx?rev=1400149&r1=1400148&r2=1400149&view=diff
==============================================================================
--- incubator/ooo/trunk/main/svtools/source/filter/igif/gifread.cxx (original)
+++ incubator/ooo/trunk/main/svtools/source/filter/igif/gifread.cxx Fri Oct 19 16:12:40 2012
@@ -523,15 +523,15 @@ void GIFReader::FillImages( HPBYTE pByte
 			if( bGCTransparent )
 			{
 				if( cTmp == nGCTransparentIndex )
-					pAcc1->SetPixel( nYAcc, nImageX++, cTransIndex1 );
+					pAcc1->SetPixelIndex( nYAcc, nImageX++, cTransIndex1 );
 				else
 				{
-					pAcc8->SetPixel( nYAcc, nImageX, cTmp );
-					pAcc1->SetPixel( nYAcc, nImageX++, cNonTransIndex1 );
+					pAcc8->SetPixelIndex( nYAcc, nImageX, cTmp );
+					pAcc1->SetPixelIndex( nYAcc, nImageX++, cNonTransIndex1 );
 				}
 			}
 			else
-				pAcc8->SetPixel( nYAcc, nImageX++, cTmp );
+				pAcc8->SetPixelIndex( nYAcc, nImageX++, cTmp );
 		}
 		else
 		{

Modified: incubator/ooo/trunk/main/svtools/source/filter/jpeg/jpeg.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/svtools/source/filter/jpeg/jpeg.cxx?rev=1400149&r1=1400148&r2=1400149&view=diff
==============================================================================
--- incubator/ooo/trunk/main/svtools/source/filter/jpeg/jpeg.cxx (original)
+++ incubator/ooo/trunk/main/svtools/source/filter/jpeg/jpeg.cxx Fri Oct 19 16:12:40 2012
@@ -660,7 +660,7 @@ void* JPEGWriter::GetScanline( long nY )
 			{
 				for( long nX = 0L; nX < nWidth; nX++ )
 				{
-					aColor = pAcc->GetPaletteColor( (sal_uInt8) pAcc->GetPixel( nY, nX ) );
+					aColor = pAcc->GetPaletteColor( pAcc->GetPixelIndex( nY, nX ) );
 					*pTmp++ = aColor.GetRed();
 					if ( bGreys )
 						continue;
@@ -721,7 +721,7 @@ sal_Bool JPEGWriter::Write( const Graphi
 			BitmapColor aColor;
 			for( long nX = 0L; bIsGrey && ( nX < nWidth ); nX++ )
 			{
-				aColor = pAcc->HasPalette() ? pAcc->GetPaletteColor( (sal_uInt8) pAcc->GetPixel( nY, nX ) )
+				aColor = pAcc->HasPalette() ? pAcc->GetPaletteColor( pAcc->GetPixelIndex( nY, nX ) )
 											: pAcc->GetPixel( nY, nX );
 				bIsGrey = ( aColor.GetRed() == aColor.GetGreen() ) && ( aColor.GetRed() == aColor.GetBlue() );
 			}

Modified: incubator/ooo/trunk/main/svtools/source/filter/wmf/winwmf.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/svtools/source/filter/wmf/winwmf.cxx?rev=1400149&r1=1400148&r2=1400149&view=diff
==============================================================================
--- incubator/ooo/trunk/main/svtools/source/filter/wmf/winwmf.cxx (original)
+++ incubator/ooo/trunk/main/svtools/source/filter/wmf/winwmf.cxx Fri Oct 19 16:12:40 2012
@@ -562,7 +562,7 @@ void WMFReader::ReadRecordParams( sal_uI
 							{
 								if ( x < nWidth )
 								{
-									pAcc->SetPixel( y, x, (nEightPixels>>i)&1 );
+									pAcc->SetPixelIndex( y, x, (nEightPixels>>i)&1 );
 								}
 								x++;
 							}

Modified: incubator/ooo/trunk/main/svtools/source/graphic/grfmgr2.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/svtools/source/graphic/grfmgr2.cxx?rev=1400149&r1=1400148&r2=1400149&view=diff
==============================================================================
--- incubator/ooo/trunk/main/svtools/source/graphic/grfmgr2.cxx (original)
+++ incubator/ooo/trunk/main/svtools/source/graphic/grfmgr2.cxx Fri Oct 19 16:12:40 2012
@@ -993,14 +993,14 @@ sal_Bool GraphicManager::ImplCreateScale
 						{
 							nTmpX = pMapIX[ nX ]; nTmpFX = pMapFX[ nX ];
 
-							aCol0 = pAcc->GetPaletteColor( pAcc->GetPixel( nTmpY, nTmpX ) );
-							aCol1 = pAcc->GetPaletteColor( pAcc->GetPixel( nTmpY, ++nTmpX ) );
+							aCol0 = pAcc->GetPaletteColor( pAcc->GetPixelIndex( nTmpY, nTmpX ) );
+							aCol1 = pAcc->GetPaletteColor( pAcc->GetPixelIndex( nTmpY, ++nTmpX ) );
 							cR0 = MAP( aCol0.GetRed(), aCol1.GetRed(), nTmpFX );
 							cG0 = MAP( aCol0.GetGreen(), aCol1.GetGreen(), nTmpFX );
 							cB0 = MAP( aCol0.GetBlue(), aCol1.GetBlue(), nTmpFX );
 
-							aCol1 = pAcc->GetPaletteColor( pAcc->GetPixel( ++nTmpY, nTmpX ) );
-							aCol0 = pAcc->GetPaletteColor( pAcc->GetPixel( nTmpY--, --nTmpX ) );
+							aCol1 = pAcc->GetPaletteColor( pAcc->GetPixelIndex( ++nTmpY, nTmpX ) );
+							aCol0 = pAcc->GetPaletteColor( pAcc->GetPixelIndex( nTmpY--, --nTmpX ) );
 							cR1 = MAP( aCol0.GetRed(), aCol1.GetRed(), nTmpFX );
 							cG1 = MAP( aCol0.GetGreen(), aCol1.GetGreen(), nTmpFX );
 							cB1 = MAP( aCol0.GetBlue(), aCol1.GetBlue(), nTmpFX );
@@ -1273,7 +1273,7 @@ sal_Bool GraphicManager::ImplCreateScale
 							{
 								for( nX = 0L; nX < nDstW; nX++ )
 								{
-									if( pAcc->GetPaletteColor( (sal_uInt8) pAcc->GetPixel( pMapLY[ nY ], pMapLX[ nX ] ) ) == aB )
+									if( pAcc->GetPaletteColor( pAcc->GetPixelIndex( pMapLY[ nY ], pMapLX[ nX ] ) ) == aB )
 										pWAcc->SetPixel( nY, nX, aWB );
 									else
 										pWAcc->SetPixel( nY, nX, aWW );
@@ -1387,14 +1387,14 @@ sal_Bool GraphicManager::ImplCreateRotat
 							nTmpX = pMapIX[ nUnRotX ]; nTmpFX = pMapFX[ nUnRotX ];
 							nTmpY = pMapIY[ nUnRotY ], nTmpFY = pMapFY[ nUnRotY ];
 
-							const BitmapColor& rCol0 = pAcc->GetPaletteColor( pAcc->GetPixel( nTmpY, nTmpX ) );
-							const BitmapColor& rCol1 = pAcc->GetPaletteColor( pAcc->GetPixel( nTmpY, ++nTmpX ) );
+							const BitmapColor& rCol0 = pAcc->GetPaletteColor( pAcc->GetPixelIndex( nTmpY, nTmpX ) );
+							const BitmapColor& rCol1 = pAcc->GetPaletteColor( pAcc->GetPixelIndex( nTmpY, ++nTmpX ) );
 							cR0 = MAP( rCol0.GetRed(), rCol1.GetRed(), nTmpFX );
 							cG0 = MAP( rCol0.GetGreen(), rCol1.GetGreen(), nTmpFX );
 							cB0 = MAP( rCol0.GetBlue(), rCol1.GetBlue(), nTmpFX );
 
-							const BitmapColor& rCol3 = pAcc->GetPaletteColor( pAcc->GetPixel( ++nTmpY, nTmpX ) );
-							const BitmapColor& rCol2 = pAcc->GetPaletteColor( pAcc->GetPixel( nTmpY, --nTmpX ) );
+							const BitmapColor& rCol3 = pAcc->GetPaletteColor( pAcc->GetPixelIndex( ++nTmpY, nTmpX ) );
+							const BitmapColor& rCol2 = pAcc->GetPaletteColor( pAcc->GetPixelIndex( nTmpY, --nTmpX ) );
 							cR1 = MAP( rCol2.GetRed(), rCol3.GetRed(), nTmpFX );
 							cG1 = MAP( rCol2.GetGreen(), rCol3.GetGreen(), nTmpFX );
 							cB1 = MAP( rCol2.GetBlue(), rCol3.GetBlue(), nTmpFX );

Modified: incubator/ooo/trunk/main/svtools/source/graphic/transformer.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/svtools/source/graphic/transformer.cxx?rev=1400149&r1=1400148&r2=1400149&view=diff
==============================================================================
--- incubator/ooo/trunk/main/svtools/source/graphic/transformer.cxx (original)
+++ incubator/ooo/trunk/main/svtools/source/graphic/transformer.cxx Fri Oct 19 16:12:40 2012
@@ -62,22 +62,19 @@ GraphicTransformer::~GraphicTransformer(
 
 // ------------------------------------------------------------------------------
 
-void setAlpha( Bitmap& rBitmap, AlphaMask& rAlpha, sal_Int32 nColorFrom, sal_Int8 nAlphaTo )
+void setAlpha( Bitmap& rBitmap, AlphaMask& rAlpha, sal_uInt8 cIndexFrom, sal_Int8 nAlphaTo )
 {
 	BitmapWriteAccess* pWriteAccess = rAlpha.AcquireWriteAccess();
 	BitmapReadAccess* pReadAccess = rBitmap.AcquireReadAccess();
-	BitmapColor aColorFrom( static_cast< sal_uInt8 >( nColorFrom >> 16 ),
-		static_cast< sal_uInt8 >( nColorFrom >> 8 ),
-		static_cast< sal_uInt8 >( nColorFrom ) );
 	if ( pReadAccess && pWriteAccess )
 	{
 		for ( sal_Int32 nY = 0; nY < pReadAccess->Height(); nY++ )
 		{
 			for ( sal_Int32 nX = 0; nX < pReadAccess->Width(); nX++ )
 			{
-				BitmapColor aColor( pReadAccess->GetPixel( nY, nX ) );
-				if ( aColor == aColorFrom )
-					pWriteAccess->SetPixel( nY, nX, nAlphaTo );
+				const sal_uInt8 cIndex = pReadAccess->GetPixelIndex( nY, nX );
+				if ( cIndex == cIndexFrom )
+					pWriteAccess->SetPixelIndex( nY, nX, nAlphaTo );
 			}
 		}
 	}
@@ -95,6 +92,7 @@ uno::Reference< graphic::XGraphic > SAL_
 
 	BitmapColor aColorFrom( static_cast< sal_uInt8 >( nColorFrom ), static_cast< sal_uInt8 >( nColorFrom >> 8 ), static_cast< sal_uInt8 >( nColorFrom >> 16 ) );
 	BitmapColor aColorTo( static_cast< sal_uInt8 >( nColorTo ), static_cast< sal_uInt8 >( nColorTo >> 8 ), static_cast< sal_uInt8 >( nColorTo  >> 16 ) );
+	const sal_uInt8 cIndexFrom = aColorFrom.GetBlueOrIndex();
 
 	if ( aGraphic.GetType() == GRAPHIC_BITMAP )
 	{
@@ -104,7 +102,7 @@ uno::Reference< graphic::XGraphic > SAL_
 		if ( aBitmapEx.IsAlpha() )
 		{
 			AlphaMask aAlphaMask( aBitmapEx.GetAlpha() );
-			setAlpha( aBitmap, aAlphaMask, aColorFrom, nAlphaTo );
+			setAlpha( aBitmap, aAlphaMask, cIndexFrom, nAlphaTo );
 			aBitmap.Replace( aColorFrom, aColorTo, nTolerance );
 			aGraphic = ::Graphic( BitmapEx( aBitmap, aAlphaMask ) );
 		}
@@ -121,7 +119,7 @@ uno::Reference< graphic::XGraphic > SAL_
 			else
 			{
 				AlphaMask aAlphaMask( aBitmapEx.GetMask() );
-				setAlpha( aBitmap, aAlphaMask, aColorFrom, nAlphaTo );
+				setAlpha( aBitmap, aAlphaMask, cIndexFrom, nAlphaTo );
 				aBitmap.Replace( aColorFrom, aColorTo, nTolerance );
 				aGraphic = ::Graphic( BitmapEx( aBitmap, aAlphaMask ) );
 			}
@@ -137,7 +135,7 @@ uno::Reference< graphic::XGraphic > SAL_
 			else
 			{
 				AlphaMask aAlphaMask( aBitmapEx.GetSizePixel() );
-				setAlpha( aBitmap, aAlphaMask, aColorFrom, nAlphaTo );
+				setAlpha( aBitmap, aAlphaMask, cIndexFrom, nAlphaTo );
 				aBitmap.Replace( aColorFrom, aColorTo, nTolerance );
 				aGraphic = ::Graphic( BitmapEx( aBitmap, aAlphaMask ) );
 			}

Modified: incubator/ooo/trunk/main/svx/source/svdraw/svdetc.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/svx/source/svdraw/svdetc.cxx?rev=1400149&r1=1400148&r2=1400149&view=diff
==============================================================================
--- incubator/ooo/trunk/main/svx/source/svdraw/svdetc.cxx (original)
+++ incubator/ooo/trunk/main/svx/source/svdraw/svdetc.cxx Fri Oct 19 16:12:40 2012
@@ -558,9 +558,7 @@ FASTBOOL GetDraftFillColor(const SfxItem
 				{
 					for(sal_uInt32 nX(0L); nX < nWidth; nX += nXStep)
 					{
-						const BitmapColor& rCol2 = (pAccess->HasPalette())
-							? pAccess->GetPaletteColor((sal_uInt8)pAccess->GetPixel(nY, nX))
-							: pAccess->GetPixel(nY, nX);
+						const BitmapColor& rCol2 = pAccess->GetColor(nY, nX);
 
 						nRt += rCol2.GetRed();
 						nGn += rCol2.GetGreen();

Modified: incubator/ooo/trunk/main/svx/source/xoutdev/_xoutbmp.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/svx/source/xoutdev/_xoutbmp.cxx?rev=1400149&r1=1400148&r2=1400149&view=diff
==============================================================================
--- incubator/ooo/trunk/main/svx/source/xoutdev/_xoutbmp.cxx (original)
+++ incubator/ooo/trunk/main/svx/source/xoutdev/_xoutbmp.cxx Fri Oct 19 16:12:40 2012
@@ -577,13 +577,13 @@ Bitmap XOutBitmap::DetectEdges( const Bi
 				const long			nHeight = aSize.Height();
 				const long			nHeight2 = nHeight - 2L;
 				const long			lThres2 = (long) cThreshold * cThreshold;
-				const BitmapColor	aWhite = (sal_uInt8) pWriteAcc->GetBestMatchingColor( Color( COL_WHITE ) );
-				const BitmapColor	aBlack = (sal_uInt8) pWriteAcc->GetBestMatchingColor( Color( COL_BLACK ) );
+				const sal_uInt8 nWhitePalIdx = pWriteAcc->GetBestPaletteIndex( Color( COL_WHITE ) );
+				const sal_uInt8 nBlackPalIdx = pWriteAcc->GetBestPaletteIndex( Color( COL_BLACK ) );
 				long				nSum1;
 				long				nSum2;
 				long				lGray;
 
-				// Rand mit Weiss init.
+				// initialize border with white pixels
 				pWriteAcc->SetLineColor( Color( COL_WHITE) );
 				pWriteAcc->DrawLine( Point(), Point( nWidth - 1L, 0L ) );
 				pWriteAcc->DrawLine( Point( nWidth - 1L, 0L ), Point( nWidth - 1L, nHeight - 1L ) );
@@ -596,24 +596,24 @@ Bitmap XOutBitmap::DetectEdges( const Bi
 					{
 						nXTmp = nX;
 
-						nSum1 = -( nSum2 = lGray = (sal_uInt8) pReadAcc->GetPixel( nY, nXTmp++ ) );
-						nSum2 += ( (long) (sal_uInt8) pReadAcc->GetPixel( nY, nXTmp++ ) ) << 1;
-						nSum1 += ( lGray = pReadAcc->GetPixel( nY, nXTmp ) );
+						nSum1 = -( nSum2 = lGray = pReadAcc->GetPixelIndex( nY, nXTmp++ ) );
+						nSum2 += ( (long) pReadAcc->GetPixelIndex( nY, nXTmp++ ) ) << 1;
+						nSum1 += ( lGray = pReadAcc->GetPixelIndex( nY, nXTmp ) );
 						nSum2 += lGray;
 
-						nSum1 += ( (long) (sal_uInt8) pReadAcc->GetPixel( nY1, nXTmp ) ) << 1;
-						nSum1 -= ( (long) (sal_uInt8) pReadAcc->GetPixel( nY1, nXTmp -= 2 ) ) << 1;
+						nSum1 += ( (long) pReadAcc->GetPixelIndex( nY1, nXTmp ) ) << 1;
+						nSum1 -= ( (long) pReadAcc->GetPixelIndex( nY1, nXTmp -= 2 ) ) << 1;
 
-						nSum1 += ( lGray = -(long) (sal_uInt8) pReadAcc->GetPixel( nY2, nXTmp++ ) );
+						nSum1 += ( lGray = -(long) pReadAcc->GetPixelIndex( nY2, nXTmp++ ) );
 						nSum2 += lGray;
-						nSum2 -= ( (long) (sal_uInt8) pReadAcc->GetPixel( nY2, nXTmp++ ) ) << 1;
-						nSum1 += ( lGray = (long) (sal_uInt8) pReadAcc->GetPixel( nY2, nXTmp ) );
+						nSum2 -= ( (long) pReadAcc->GetPixelIndex( nY2, nXTmp++ ) ) << 1;
+						nSum1 += ( lGray = (long) pReadAcc->GetPixelIndex( nY2, nXTmp ) );
 						nSum2 -= lGray;
 
 						if( ( nSum1 * nSum1 + nSum2 * nSum2 ) < lThres2 )
-							pWriteAcc->SetPixel( nY1, nXDst, aWhite );
+							pWriteAcc->SetPixelIndex( nY1, nXDst, nWhiteIdx );
 						else
-							pWriteAcc->SetPixel( nY1, nXDst, aBlack );
+							pWriteAcc->SetPixelIndex( nY1, nXDst, nBlackIdx );
 					}
 				}
 

Modified: incubator/ooo/trunk/main/svx/source/xoutdev/xattrbmp.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/svx/source/xoutdev/xattrbmp.cxx?rev=1400149&r1=1400148&r2=1400149&view=diff
==============================================================================
--- incubator/ooo/trunk/main/svx/source/xoutdev/xattrbmp.cxx (original)
+++ incubator/ooo/trunk/main/svx/source/xoutdev/xattrbmp.cxx Fri Oct 19 16:12:40 2012
@@ -94,11 +94,11 @@ Bitmap createHistorical8x8FromArray(cons
             {
                 if(pArray[(a * 8) + b])
                 {
-                    pContent->SetPixel(b, a, sal_uInt8(1));
+                    pContent->SetPixelIndex(b, a, 1);
                 }
                 else
                 {
-                    pContent->SetPixel(b, a, sal_uInt8(0));
+                    pContent->SetPixelIndex(b, a, 0);
                 }
             }
         }

Modified: incubator/ooo/trunk/main/vcl/inc/vcl/bmpacc.hxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/vcl/inc/vcl/bmpacc.hxx?rev=1400149&r1=1400148&r2=1400149&view=diff
==============================================================================
--- incubator/ooo/trunk/main/vcl/inc/vcl/bmpacc.hxx (original)
+++ incubator/ooo/trunk/main/vcl/inc/vcl/bmpacc.hxx Fri Oct 19 16:12:40 2012
@@ -168,8 +168,9 @@ public:
     inline BitmapColor          GetPixelFromData( const sal_uInt8* pData, long nX ) const;
     inline void                 SetPixelOnData( sal_uInt8* pData, long nX, const BitmapColor& rBitmapColor );
     inline BitmapColor          GetPixel( long nY, long nX ) const;
-	inline BitmapColor			GetColor( long nY, long nX ) const;
-	inline sal_uInt8					GetLuminance( long nY, long nX ) const;
+    inline BitmapColor          GetColor( long nY, long nX ) const;
+    inline sal_uInt8            GetPixelIndex( long nY, long nX ) const;
+    inline sal_uInt8            GetLuminance( long nY, long nX ) const;
 };
 
 // ---------------------
@@ -194,6 +195,7 @@ public:
     inline void                 SetPaletteColor( sal_uInt16 nColor, const BitmapColor& rBitmapColor );
 
     inline void                 SetPixel( long nY, long nX, const BitmapColor& rBitmapColor );
+    inline void                 SetPixelIndex( long nY, long nX, sal_uInt8 cIndex );
 
     void                 		SetLineColor();
     void                 		SetLineColor( const Color& rColor );
@@ -467,6 +469,11 @@ inline BitmapColor BitmapReadAccess::Get
     return mFncGetPixel( mpScanBuf[ nY ], nX, maColorMask );
 }
 
+inline sal_uInt8 BitmapReadAccess::GetPixelIndex( long nY, long nX ) const
+{
+    return GetPixel( nY, nX ).GetBlueOrIndex();
+}
+
 // ------------------------------------------------------------------
 
 inline BitmapColor BitmapReadAccess::GetPixelFromData( const sal_uInt8* pData, long nX ) const
@@ -487,11 +494,8 @@ inline void BitmapReadAccess::SetPixelOn
 
 inline BitmapColor BitmapReadAccess::GetColor( long nY, long nX ) const
 {
-	if( !!mpBuffer->maPalette )
-	{
-	    DBG_ASSERT( mpBuffer, "Access is not valid!" );
-		return mpBuffer->maPalette[ GetPixel( nY, nX ).GetIndex() ];
-	}
+	if( HasPalette() )
+		return mpBuffer->maPalette[ GetPixelIndex( nY, nX ) ];
 	else
 		return GetPixel( nY, nX );
 }
@@ -538,4 +542,11 @@ inline void BitmapWriteAccess::SetPixel(
     mFncSetPixel( mpScanBuf[ nY ], nX, rBitmapColor, maColorMask );
 }
 
+inline void BitmapWriteAccess::SetPixelIndex( long nY, long nX, sal_uInt8 cIndex )
+{
+    SetPixel( nY, nX, BitmapColor( cIndex ));
+}
+
+// ------------------------------------------------------------------
+
 #endif // _SV_BMPACC_HXX

Modified: incubator/ooo/trunk/main/vcl/inc/vcl/salbtype.hxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/vcl/inc/vcl/salbtype.hxx?rev=1400149&r1=1400148&r2=1400149&view=diff
==============================================================================
--- incubator/ooo/trunk/main/vcl/inc/vcl/salbtype.hxx (original)
+++ incubator/ooo/trunk/main/vcl/inc/vcl/salbtype.hxx Fri Oct 19 16:12:40 2012
@@ -123,7 +123,11 @@ public:
 	inline				BitmapColor( const BitmapColor& rBitmapColor );
 	inline				BitmapColor( sal_uInt8 cRed, sal_uInt8 cGreen, sal_uInt8 cBlue );
 	inline				BitmapColor( const Color& rColor );
+#ifndef BINFILTER_COMPAT
+	explicit
+#endif // BINFILTER_COMPAT
 	inline				BitmapColor( sal_uInt8 cIndex );
+
 	inline				~BitmapColor() {};
 
 	inline sal_Bool 		operator==( const BitmapColor& rBitmapColor ) const;
@@ -144,8 +148,10 @@ public:
 	inline sal_uInt8 		GetIndex() const;
 	inline void 		SetIndex( sal_uInt8 cIndex );
 
+#ifdef BINFILTER_COMPAT
+	operator sal_uInt8() const { return mcBlueOrIndex; }
+#endif // BINFILTER_COMPAT
 	operator			Color() const;
-	inline operator 	sal_uInt8() const;
 
     inline sal_uInt8         GetBlueOrIndex() const;
 
@@ -437,14 +443,6 @@ inline BitmapColor::operator Color() con
 
 // ------------------------------------------------------------------
 
-inline BitmapColor::operator sal_uInt8() const
-{
-	DBG_ASSERT( mbIndex, "Pixel represents color values!" );
-	return mcBlueOrIndex;
-}
-
-// ------------------------------------------------------------------
-
 inline sal_uInt8 BitmapColor::GetBlueOrIndex() const
 {
     // #i47518# Yield a value regardless of mbIndex

Modified: incubator/ooo/trunk/main/vcl/source/gdi/bitmap.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/vcl/source/gdi/bitmap.cxx?rev=1400149&r1=1400148&r2=1400149&view=diff
==============================================================================
--- incubator/ooo/trunk/main/vcl/source/gdi/bitmap.cxx (original)
+++ incubator/ooo/trunk/main/vcl/source/gdi/bitmap.cxx Fri Oct 19 16:12:40 2012
@@ -1039,7 +1039,7 @@ sal_Bool Bitmap::CopyPixel( const Rectan
 
 							for( long nSrcY = aRectSrc.Top(); nSrcY < nSrcEndY; nSrcY++, nDstY++ )
 								for( long nSrcX = aRectSrc.Left(), nDstX = aRectDst.Left(); nSrcX < nSrcEndX; nSrcX++, nDstX++ )
-									pWriteAcc->SetPixel( nDstY, nDstX, pMap[ pReadAcc->GetPixel( nSrcY, nSrcX ).GetIndex() ] );
+									pWriteAcc->SetPixelIndex( nDstY, nDstX, pMap[ pReadAcc->GetPixelIndex( nSrcY, nSrcX ) ] );
 
 							delete[] pMap;
 						}
@@ -1047,7 +1047,7 @@ sal_Bool Bitmap::CopyPixel( const Rectan
 						{
 							for( long nSrcY = aRectSrc.Top(); nSrcY < nSrcEndY; nSrcY++, nDstY++ )
 								for( long nSrcX = aRectSrc.Left(), nDstX = aRectDst.Left(); nSrcX < nSrcEndX; nSrcX++, nDstX++ )
-									pWriteAcc->SetPixel( nDstY, nDstX, pReadAcc->GetPaletteColor( pReadAcc->GetPixel( nSrcY, nSrcX ) ) );
+									pWriteAcc->SetPixel( nDstY, nDstX, pReadAcc->GetPaletteColor( pReadAcc->GetPixelIndex( nSrcY, nSrcX ) ) );
 						}
 						else
 							for( long nSrcY = aRectSrc.Top(); nSrcY < nSrcEndY; nSrcY++, nDstY++ )
@@ -1313,7 +1313,7 @@ Bitmap Bitmap::CreateMask( const Color& 
 					{
 						for( long nX = 0L; nX < nWidth; nX++ )
 						{
-							aCol = pReadAcc->GetPaletteColor( pReadAcc->GetPixel( nY, nX ) );
+							aCol = pReadAcc->GetPaletteColor( pReadAcc->GetPixelIndex( nY, nX ) );
 							nR = aCol.GetRed();
 							nG = aCol.GetGreen();
 							nB = aCol.GetBlue();
@@ -1444,16 +1444,14 @@ sal_Bool Bitmap::Replace( const Bitmap& 
 			const sal_uInt16 nActColors = pAcc->GetPaletteEntryCount();
 			const sal_uInt16 nMaxColors = 1 << pAcc->GetBitCount();
 
-			// erst einmal naechste Farbe nehmen
+			// default to the nearest color
 			aReplace = pAcc->GetBestMatchingColor( rReplaceColor );
 
-			// falls Palettenbild, und die zu setzende Farbe ist nicht
-			// in der Palette, suchen wir nach freien Eintraegen (teuer)
-			if( pAcc->GetPaletteColor( (sal_uInt8) aReplace ) != BitmapColor( rReplaceColor ) )
-			{
-				// erst einmal nachsehen, ob wir unsere ReplaceColor
-				// nicht auf einen freien Platz am Ende der Palette
-				// setzen koennen
+			// for paletted images without a matching palette entry 
+			// look for an unused palette entry (NOTE: expensive!)
+			if( pAcc->GetPaletteColor( aReplace.GetIndex() ) != BitmapColor( rReplaceColor ) )
+			{
+				// if the palette has empty entries use the last one
 				if( nActColors < nMaxColors )
 				{
 					pAcc->SetPaletteEntryCount( nActColors + 1 );
@@ -1469,7 +1467,7 @@ sal_Bool Bitmap::Replace( const Bitmap& 
 
 					for( long nY = 0L; nY < nHeight; nY++ )
 						for( long nX = 0L; nX < nWidth; nX++ )
-							pFlags[ (sal_uInt8) pAcc->GetPixel( nY, nX ) ] = sal_True;
+							pFlags[ pAcc->GetPixelIndex( nY, nX ) ] = sal_True;
 
 					for( sal_uInt16 i = 0UL; i < nMaxColors; i++ )
 					{
@@ -1523,7 +1521,7 @@ sal_Bool Bitmap::Replace( const AlphaMas
 			for( long nX = 0L; nX < nWidth; nX++ )
 			{
 				aCol = pAcc->GetColor( nY, nX );
-				pNewAcc->SetPixel( nY, nX, aCol.Merge( rMergeColor, 255 - (sal_uInt8) pAlphaAcc->GetPixel( nY, nX ) ) );
+				pNewAcc->SetPixel( nY, nX, aCol.Merge( rMergeColor, 255 - pAlphaAcc->GetPixelIndex( nY, nX ) ) );
 			}
 		}
 
@@ -1935,7 +1933,7 @@ sal_Bool Bitmap::Blend( const AlphaMask&
 			for( long nX = 0L; nX < nWidth; ++nX )
                 pAcc->SetPixel( nY, nX, 
                                 pAcc->GetPixel( nY, nX ).Merge( rBackgroundColor, 
-                                                                255 - pAlphaAcc->GetPixel( nY, nX ) ) );
+                                                                255 - pAlphaAcc->GetPixelIndex( nY, nX ) ) );
 
         bRet = sal_True;
 	}

Modified: incubator/ooo/trunk/main/vcl/source/gdi/bitmap2.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/vcl/source/gdi/bitmap2.cxx?rev=1400149&r1=1400148&r2=1400149&view=diff
==============================================================================
--- incubator/ooo/trunk/main/vcl/source/gdi/bitmap2.cxx (original)
+++ incubator/ooo/trunk/main/vcl/source/gdi/bitmap2.cxx Fri Oct 19 16:12:40 2012
@@ -531,7 +531,7 @@ sal_Bool Bitmap::ImplReadDIBBits( SvStre
 								cTmp = *pTmp++;
 							}
 
-							rAcc.SetPixel( nY, nX, sal::static_int_cast<sal_uInt8>(( cTmp >> --nShift ) & 1) );
+							rAcc.SetPixelIndex( nY, nX, (cTmp >> --nShift) & 1);
 						}
 					}
 				}
@@ -555,7 +555,7 @@ sal_Bool Bitmap::ImplReadDIBBits( SvStre
 								cTmp = *pTmp++;
 							}
 
-							rAcc.SetPixel( nY, nX, sal::static_int_cast<sal_uInt8>(( cTmp >> ( --nShift << 2UL ) ) & 0x0f) );
+							rAcc.SetPixelIndex( nY, nX, (cTmp >> ( --nShift << 2UL ) ) & 0x0f);
 						}
 					}
 				}
@@ -570,7 +570,7 @@ sal_Bool Bitmap::ImplReadDIBBits( SvStre
 						rIStm.Read( pTmp = pBuf, nAlignedWidth );
 
 						for( long nX = 0L; nX < nWidth; nX++ )
-							rAcc.SetPixel( nY, nX, *pTmp++ );
+							rAcc.SetPixelIndex( nY, nX, *pTmp++ );
 					}
 				}
 				break;
@@ -970,7 +970,7 @@ sal_Bool Bitmap::ImplWriteDIBBits( SvStr
 								cTmp = 0;
 							}
 
-							cTmp |= ( (sal_uInt8) rAcc.GetPixel( nY, nX ) << --nShift );
+							cTmp |= rAcc.GetPixelIndex( nY, nX ) << --nShift;
 						}
 
 						*pTmp = cTmp;
@@ -995,7 +995,7 @@ sal_Bool Bitmap::ImplWriteDIBBits( SvStr
 								cTmp = 0;
 							}
 
-							cTmp |= ( (sal_uInt8) rAcc.GetPixel( nY, nX ) << ( --nShift << 2L ) );
+							cTmp |= rAcc.GetPixelIndex( nY, nX ) << ( --nShift << 2L );
 						}
 						*pTmp = cTmp;
 						rOStm.Write( pBuf, nAlignedWidth );
@@ -1010,7 +1010,7 @@ sal_Bool Bitmap::ImplWriteDIBBits( SvStr
 						pTmp = pBuf;
 
 						for( long nX = 0L; nX < nWidth; nX++ )
-							*pTmp++ = rAcc.GetPixel( nY, nX );
+							*pTmp++ = rAcc.GetPixelIndex( nY, nX );
 
 						rOStm.Write( pBuf, nAlignedWidth );
 					}
@@ -1082,16 +1082,16 @@ void Bitmap::ImplDecodeRLE( sal_uInt8* p
 						cTmp = *pRLE++;
 						
 						if( nX < nWidth )
-							rAcc.SetPixel( nY, nX++, cTmp >> 4 );
+							rAcc.SetPixelIndex( nY, nX++, cTmp >> 4 );
 
 						if( nX < nWidth )
-							rAcc.SetPixel( nY, nX++, cTmp & 0x0f );
+							rAcc.SetPixelIndex( nY, nX++, cTmp & 0x0f );
 					}
 
 					if( nRunByte & 1 )
 					{
 						if( nX < nWidth )
-							rAcc.SetPixel( nY, nX++, *pRLE >> 4 );
+							rAcc.SetPixelIndex( nY, nX++, *pRLE >> 4 );
 
 						pRLE++;
 					}
@@ -1104,7 +1104,7 @@ void Bitmap::ImplDecodeRLE( sal_uInt8* p
 					for( sal_uLong i = 0UL; i < nRunByte; i++ )
 					{
 						if( nX < nWidth )
-							rAcc.SetPixel( nY, nX++, *pRLE );
+							rAcc.SetPixelIndex( nY, nX++, *pRLE );
 
 						pRLE++;
 					}
@@ -1137,19 +1137,19 @@ void Bitmap::ImplDecodeRLE( sal_uInt8* p
 				for( sal_uLong i = 0UL; i < nRunByte; i++ )
 				{
 					if( nX < nWidth )
-						rAcc.SetPixel( nY, nX++, cTmp >> 4 );
+						rAcc.SetPixelIndex( nY, nX++, cTmp >> 4 );
 
 					if( nX < nWidth )
-						rAcc.SetPixel( nY, nX++, cTmp & 0x0f );
+						rAcc.SetPixelIndex( nY, nX++, cTmp & 0x0f );
 				}
 
 				if( ( nCountByte & 1 ) && ( nX < nWidth ) )
-					rAcc.SetPixel( nY, nX++, cTmp >> 4 );
+					rAcc.SetPixelIndex( nY, nX++, cTmp >> 4 );
 			}
 			else
 			{
 				for( sal_uLong i = 0UL; ( i < nCountByte ) && ( nX < nWidth ); i++ )
-					rAcc.SetPixel( nY, nX++, cTmp );
+					rAcc.SetPixelIndex( nY, nX++, cTmp );
 			}
 		}
 	}
@@ -1180,9 +1180,10 @@ sal_Bool Bitmap::ImplWriteRLE( SvStream&
 		while( nX < nWidth )
 		{
 			nCount = 1L;
-			cPix = rAcc.GetPixel( nY, nX++ );
+			cPix = rAcc.GetPixelIndex( nY, nX++ );
 
-			while( ( nX < nWidth ) && ( nCount < 255L ) && ( cPix == rAcc.GetPixel( nY, nX ) ) )
+			while( ( nX < nWidth ) && ( nCount < 255L )
+				&& ( cPix == rAcc.GetPixelIndex( nY, nX ) ) )
 			{
 				nX++;
 				nCount++;
@@ -1200,7 +1201,8 @@ sal_Bool Bitmap::ImplWriteRLE( SvStream&
 				nSaveIndex = nX - 1UL;
 				bFound = sal_False;
 
-				while( ( nX < nWidth ) && ( nCount < 256L ) && ( cPix = rAcc.GetPixel( nY, nX ) ) != cLast )
+				while( ( nX < nWidth ) && ( nCount < 256L )
+					&& ( cPix = rAcc.GetPixelIndex( nY, nX ) ) != cLast )
 				{
 					nX++; nCount++;
 					cLast = cPix;
@@ -1219,10 +1221,10 @@ sal_Bool Bitmap::ImplWriteRLE( SvStream&
 					{
 						for ( sal_uLong i = 0; i < nCount; i++, pTmp++ )
 						{
-							*pTmp = (sal_uInt8) rAcc.GetPixel( nY, nSaveIndex++ ) << 4;
+							*pTmp = rAcc.GetPixelIndex( nY, nSaveIndex++ ) << 4;
 
 							if ( ++i < nCount )
-								*pTmp |= rAcc.GetPixel( nY, nSaveIndex++ );
+								*pTmp |= rAcc.GetPixelIndex( nY, nSaveIndex++ );
 						}
 
 						nCount = ( nCount + 1 ) >> 1;
@@ -1230,7 +1232,7 @@ sal_Bool Bitmap::ImplWriteRLE( SvStream&
 					else
 					{
 						for( sal_uLong i = 0UL; i < nCount; i++ )
-							*pTmp++ = rAcc.GetPixel( nY, nSaveIndex++ );
+							*pTmp++ = rAcc.GetPixelIndex( nY, nSaveIndex++ );
 					}
 
 					if ( nCount & 1 )
@@ -1244,12 +1246,12 @@ sal_Bool Bitmap::ImplWriteRLE( SvStream&
 				else
 				{
 					*pTmp++ = 1;
-					*pTmp++ = (sal_uInt8) rAcc.GetPixel( nY, nSaveIndex ) << ( bRLE4 ? 4 : 0 );
+					*pTmp++ = rAcc.GetPixelIndex( nY, nSaveIndex ) << (bRLE4 ? 4 : 0);
 
 					if ( nCount == 3 )
 					{
 						*pTmp++ = 1;
-						*pTmp++ = (sal_uInt8) rAcc.GetPixel( nY, ++nSaveIndex ) << ( bRLE4 ? 4 : 0 );
+						*pTmp++ = rAcc.GetPixelIndex( nY, ++nSaveIndex ) << ( bRLE4 ? 4 : 0 );
 						nBufCount += 4;
 					}
 					else

Modified: incubator/ooo/trunk/main/vcl/source/gdi/bitmap3.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/vcl/source/gdi/bitmap3.cxx?rev=1400149&r1=1400148&r2=1400149&view=diff
==============================================================================
--- incubator/ooo/trunk/main/vcl/source/gdi/bitmap3.cxx (original)
+++ incubator/ooo/trunk/main/vcl/source/gdi/bitmap3.cxx Fri Oct 19 16:12:40 2012
@@ -383,7 +383,8 @@ sal_Bool Bitmap::ImplMakeMono( sal_uInt8
 				{
 					for( long nX = 0L; nX < nWidth; nX++ )
 					{
-						if( pReadAcc->GetPaletteColor( pReadAcc->GetPixel( nY, nX ) ).GetLuminance() >=
+						const sal_uInt8 cIndex = pReadAcc->GetPixelIndex( nY, nX );
+						if( pReadAcc->GetPaletteColor( cIndex ).GetLuminance() >=
 							cThreshold )
 						{
 							pWriteAcc->SetPixel( nY, nX, aWhite );
@@ -459,7 +460,8 @@ sal_Bool Bitmap::ImplMakeMonoDither()
 				{
 					for( long nX = 0L, nModY = nY % 16; nX < nWidth; nX++ )
 					{
-						if( pReadAcc->GetPaletteColor( pReadAcc->GetPixel( nY, nX ) ).GetLuminance() >
+						const sal_uInt8 cIndex = pReadAcc->GetPixelIndex( nY, nX );
+						if( pReadAcc->GetPaletteColor( cIndex ).GetLuminance() >
 							pDitherMatrix[ nModY ][ nX % 16 ] )
 						{
 							pWriteAcc->SetPixel( nY, nX, aWhite );
@@ -541,9 +543,9 @@ sal_Bool Bitmap::ImplMakeGreyscales( sal
 					{
 						for( long nX = 0L; nX < nWidth; nX++ )
 						{
-							pWriteAcc->SetPixel( nY, nX,
-								(sal_uInt8) ( pReadAcc->GetPaletteColor(
-									pReadAcc->GetPixel( nY, nX ) ).GetLuminance() >> nShift ) );
+							const sal_uInt8 cIndex = pReadAcc->GetPixelIndex( nY, nX );
+							pWriteAcc->SetPixelIndex( nY, nX,
+								(pReadAcc->GetPaletteColor( cIndex ).GetLuminance() >> nShift) );
 						}
 					}
 				}
@@ -591,7 +593,7 @@ sal_Bool Bitmap::ImplMakeGreyscales( sal
 				{
 					for( long nY = 0L; nY < nHeight; nY++ )
 						for( long nX = 0L; nX < nWidth; nX++ )
-							pWriteAcc->SetPixel( nY, nX, sal::static_int_cast<sal_uInt8>(( pReadAcc->GetPixel( nY, nX ) ).GetLuminance() >> nShift) );
+							pWriteAcc->SetPixelIndex( nY, nX, (pReadAcc->GetPixel( nY, nX ) ).GetLuminance() >> nShift );
 				}
 
 				aNewBmp.ReleaseAccess( pWriteAcc );
@@ -666,7 +668,7 @@ sal_Bool Bitmap::ImplConvertUp( sal_uInt
 				{
 					for( long nY = 0L; nY < nHeight; nY++ )
 						for( long nX = 0L; nX < nWidth; nX++ )
-							pWriteAcc->SetPixel( nY, nX, pReadAcc->GetPaletteColor( pReadAcc->GetPixel( nY, nX ) ) );
+							pWriteAcc->SetPixel( nY, nX, pReadAcc->GetPaletteColor( pReadAcc->GetPixelIndex( nY, nX ) ) );
 				}
 				else
 				{
@@ -752,7 +754,7 @@ sal_Bool Bitmap::ImplConvertDown( sal_uI
 				for( nX = 0L, pQLine2 = !nY ? pErrQuad1 : pErrQuad2; nX < nWidth; nX++ )
 				{
 					if( pReadAcc->HasPalette() )
-						pQLine2[ nX ] = pReadAcc->GetPaletteColor( pReadAcc->GetPixel( nYTmp, nX ) );
+						pQLine2[ nX ] = pReadAcc->GetPaletteColor( pReadAcc->GetPixelIndex( nYTmp, nX ) );
 					else
 						pQLine2[ nX ] = pReadAcc->GetPixel( nYTmp, nX );
 				}
@@ -760,9 +762,9 @@ sal_Bool Bitmap::ImplConvertDown( sal_uI
 
 			for( nY = 0L; nY < nHeight; nY++, nYTmp++ )
 			{
-				// erstes ZeilenPixel
+				// first pixel in the line
 				cIndex = (sal_uInt8) aColorMap.GetBestPaletteIndex( pQLine1[ 0 ].ImplGetColor() );
-				pWriteAcc->SetPixel( nY, 0, cIndex );
+				pWriteAcc->SetPixelIndex( nY, 0, cIndex );
 
 				for( nX = 1L; nX < nWidth1; nX++ )
 				{
@@ -772,14 +774,14 @@ sal_Bool Bitmap::ImplConvertDown( sal_uI
 					pQLine2[ nX-- ].ImplAddColorError1( aErrQuad );
 					pQLine2[ nX-- ].ImplAddColorError5( aErrQuad );
 					pQLine2[ nX++ ].ImplAddColorError3( aErrQuad );
-					pWriteAcc->SetPixel( nY, nX, cIndex );
+					pWriteAcc->SetPixelIndex( nY, nX, cIndex );
 				}
 
 				// letztes ZeilenPixel
                 if( nX < nWidth )
                 {
 				    cIndex = (sal_uInt8) aColorMap.GetBestPaletteIndex( pQLine1[ nWidth1 ].ImplGetColor() );
-				    pWriteAcc->SetPixel( nY, nX, cIndex );
+				    pWriteAcc->SetPixelIndex( nY, nX, cIndex );
                 }
 
 				// Zeilenpuffer neu fuellen/kopieren
@@ -791,7 +793,7 @@ sal_Bool Bitmap::ImplConvertDown( sal_uI
 					for( nX = 0L; nX < nWidth; nX++ )
 					{
 						if( pReadAcc->HasPalette() )
-								pQLine2[ nX ] = pReadAcc->GetPaletteColor( pReadAcc->GetPixel( nYTmp, nX ) );
+							pQLine2[ nX ] = pReadAcc->GetPaletteColor( pReadAcc->GetPixelIndex( nYTmp, nX ) );
 						else
 							pQLine2[ nX ] = pReadAcc->GetPixel( nYTmp, nX );
 					}
@@ -1058,7 +1060,7 @@ sal_Bool Bitmap::ImplScaleInterpolate( c
 				{
 					if( 1 == nWidth )
 					{
-						aCol0 = pReadAcc->GetPaletteColor( pReadAcc->GetPixel( nY, 0 ) );
+						aCol0 = pReadAcc->GetPaletteColor( pReadAcc->GetPixelIndex( nY, 0 ) );
 
 						for( nX = 0L; nX < nNewWidth; nX++ )
 							pWriteAcc->SetPixel( nY, nX, aCol0 );
@@ -1069,8 +1071,8 @@ sal_Bool Bitmap::ImplScaleInterpolate( c
 						{
 							nTemp = pLutInt[ nX ];
 
-							aCol0 = pReadAcc->GetPaletteColor( pReadAcc->GetPixel( nY, nTemp++ ) );
-							aCol1 = pReadAcc->GetPaletteColor( pReadAcc->GetPixel( nY, nTemp ) );
+							aCol0 = pReadAcc->GetPaletteColor( pReadAcc->GetPixelIndex( nY, nTemp++ ) );
+							aCol1 = pReadAcc->GetPaletteColor( pReadAcc->GetPixelIndex( nY, nTemp ) );
 
 							nTemp = pLutFrac[ nX ];
 
@@ -1162,7 +1164,7 @@ sal_Bool Bitmap::ImplScaleInterpolate( c
 					{
 						if( 1 == nHeight )
 						{
-							aCol0 = pReadAcc->GetPaletteColor( pReadAcc->GetPixel( 0, nX ) );
+							aCol0 = pReadAcc->GetPaletteColor( pReadAcc->GetPixelIndex( 0, nX ) );
 
 							for( nY = 0L; nY < nNewHeight; nY++ )
 								pWriteAcc->SetPixel( nY, nX, aCol0 );
@@ -1173,8 +1175,8 @@ sal_Bool Bitmap::ImplScaleInterpolate( c
 							{
 								nTemp = pLutInt[ nY ];
 
-								aCol0 = pReadAcc->GetPaletteColor( pReadAcc->GetPixel( nTemp++, nX ) );
-								aCol1 = pReadAcc->GetPaletteColor( pReadAcc->GetPixel( nTemp, nX ) );
+								aCol0 = pReadAcc->GetPaletteColor( pReadAcc->GetPixelIndex( nTemp++, nX ) );
+								aCol1 = pReadAcc->GetPaletteColor( pReadAcc->GetPixelIndex( nTemp, nX ) );
 
 								nTemp = pLutFrac[ nY ];
 
@@ -1287,7 +1289,7 @@ sal_Bool Bitmap::ImplDitherMatrix()
 			{
 				for( sal_uLong nX = 0UL, nModY = ( nY & 0x0FUL ) << 4UL; nX < nWidth; nX++ )
 				{
-					const BitmapColor	aCol( pReadAcc->GetPaletteColor( pReadAcc->GetPixel( nY, nX ) ) );
+					const BitmapColor	aCol( pReadAcc->GetPaletteColor( pReadAcc->GetPixelIndex( nY, nX ) ) );
 					const sal_uLong			nD = nVCLDitherLut[ nModY + ( nX & 0x0FUL ) ];
 					const sal_uLong			nR = ( nVCLLut[ aCol.GetRed() ] + nD ) >> 16UL;
 					const sal_uLong			nG = ( nVCLLut[ aCol.GetGreen() ] + nD ) >> 16UL;
@@ -1375,7 +1377,7 @@ sal_Bool Bitmap::ImplDitherFloyd()
 			{
 				for( nZ = 0; nZ < nWidth; nZ++ )
 				{
-					aColor = pReadAcc->GetPaletteColor( pReadAcc->GetPixel( 0, nZ ) );
+					aColor = pReadAcc->GetPaletteColor( pReadAcc->GetPixelIndex( 0, nZ ) );
 
 					*pTmp++ = (long) aColor.GetBlue() << 12;
 					*pTmp++ = (long) aColor.GetGreen() << 12;
@@ -1406,7 +1408,7 @@ sal_Bool Bitmap::ImplDitherFloyd()
 					{
 						for( nZ = 0; nZ < nWidth; nZ++ )
 						{
-							aColor = pReadAcc->GetPaletteColor( pReadAcc->GetPixel( nY, nZ ) );
+							aColor = pReadAcc->GetPaletteColor( pReadAcc->GetPixelIndex( nY, nZ ) );
 
 							*pTmp++ = (long) aColor.GetBlue() << 12;
 							*pTmp++ = (long) aColor.GetGreen() << 12;
@@ -1432,7 +1434,7 @@ sal_Bool Bitmap::ImplDitherFloyd()
 				CALC_TABLES7;
 				nX -= 5;
 				CALC_TABLES5;
-				pWriteAcc->SetPixel( nYAcc, 0, BitmapColor( (sal_uInt8) ( nVCLBLut[ nBC ] + nVCLGLut[nGC ] + nVCLRLut[nRC ] ) ) );
+				pWriteAcc->SetPixelIndex( nYAcc, 0, static_cast<sal_uInt8>(nVCLBLut[ nBC ] + nVCLGLut[nGC ] + nVCLRLut[nRC ]) );
 
 				// mittlere Pixel ueber Schleife
 				long nXAcc;
@@ -1443,7 +1445,7 @@ sal_Bool Bitmap::ImplDitherFloyd()
 					nX -= 8;
 					CALC_TABLES3;
 					CALC_TABLES5;
-					pWriteAcc->SetPixel( nYAcc, nXAcc, BitmapColor( (sal_uInt8) ( nVCLBLut[ nBC ] + nVCLGLut[nGC ] + nVCLRLut[nRC ] ) ) );
+					pWriteAcc->SetPixelIndex( nYAcc, nXAcc, static_cast<sal_uInt8>(nVCLBLut[ nBC ] + nVCLGLut[nGC ] + nVCLRLut[nRC ]) );
 				}
 
 				// letztes Pixel gesondert betrachten
@@ -1451,7 +1453,7 @@ sal_Bool Bitmap::ImplDitherFloyd()
 				nX -= 5;
 				CALC_TABLES3;
 				CALC_TABLES5;
-				pWriteAcc->SetPixel( nYAcc, nWidth1, BitmapColor( (sal_uInt8) ( nVCLBLut[ nBC ] + nVCLGLut[nGC ] + nVCLRLut[nRC ] ) ) );
+				pWriteAcc->SetPixelIndex( nYAcc, nWidth1, static_cast<sal_uInt8>(nVCLBLut[ nBC ] + nVCLGLut[nGC ] + nVCLRLut[nRC ]) );
 			}
 
 			delete[] p1;
@@ -1626,13 +1628,13 @@ sal_Bool Bitmap::ImplReduceSimple( sal_u
 			{
 				for( long nY = 0L; nY < nHeight; nY++ )
 					for( long nX =0L; nX < nWidth; nX++ )
-						pWAcc->SetPixel( nY, nX, (sal_uInt8) aOct.GetBestPaletteIndex( pRAcc->GetPaletteColor( pRAcc->GetPixel( nY, nX ) ) ) );
+						pWAcc->SetPixelIndex( nY, nX, static_cast<sal_uInt8>(aOct.GetBestPaletteIndex( pRAcc->GetPaletteColor( pRAcc->GetPixelIndex( nY, nX ) ))) );
 			}
 			else
 			{
 				for( long nY = 0L; nY < nHeight; nY++ )
 					for( long nX =0L; nX < nWidth; nX++ )
-						pWAcc->SetPixel( nY, nX, (sal_uInt8) aOct.GetBestPaletteIndex( pRAcc->GetPixel( nY, nX ) ) );
+						pWAcc->SetPixelIndex( nY, nX, static_cast<sal_uInt8>(aOct.GetBestPaletteIndex( pRAcc->GetPixel( nY, nX ) )) );
 			}
 
 			aNewBmp.ReleaseAccess( pWAcc );
@@ -1729,7 +1731,7 @@ sal_Bool Bitmap::ImplReducePopular( sal_
 			{
 				for( nX = 0L; nX < nWidth; nX++ )
 				{
-					const BitmapColor& rCol = pRAcc->GetPaletteColor( pRAcc->GetPixel( nY, nX ) );
+					const BitmapColor& rCol = pRAcc->GetPaletteColor( pRAcc->GetPixelIndex( nY, nX ) );
 					pCountTable[ ( ( ( (sal_uInt32) rCol.GetRed() ) >> nRightShiftBits ) << nLeftShiftBits2 ) |
 								 ( ( ( (sal_uInt32) rCol.GetGreen() ) >> nRightShiftBits ) << nLeftShiftBits1 ) | 
 								 ( ( (sal_uInt32) rCol.GetBlue() ) >> nRightShiftBits ) ].mnCount++;
@@ -1781,7 +1783,7 @@ sal_Bool Bitmap::ImplReducePopular( sal_
 				{
 					for( nX = 0L; nX < nWidth; nX++ )
 					{
-						const BitmapColor& rCol = pRAcc->GetPaletteColor( pRAcc->GetPixel( nY, nX ) );
+						const BitmapColor& rCol = pRAcc->GetPaletteColor( pRAcc->GetPixelIndex( nY, nX ) );
 						aDstCol.SetIndex( pIndexMap[ ( ( ( (sal_uInt32) rCol.GetRed() ) >> nRightShiftBits ) << nLeftShiftBits2 ) |
 													 ( ( ( (sal_uInt32) rCol.GetGreen() ) >> nRightShiftBits ) << nLeftShiftBits1 ) | 
 													 ( ( (sal_uInt32) rCol.GetBlue() ) >> nRightShiftBits ) ] );
@@ -1867,7 +1869,7 @@ sal_Bool Bitmap::ImplReduceMedian( sal_u
 				{
 					for( long nX = 0L; nX < nWidth; nX++ )
 					{
-						const BitmapColor& rCol = pRAcc->GetPaletteColor( pRAcc->GetPixel( nY, nX ) );
+						const BitmapColor& rCol = pRAcc->GetPaletteColor( pRAcc->GetPixelIndex( nY, nX ) );
 						pColBuf[ RGB15( rCol.GetRed() >> 3, rCol.GetGreen() >> 3, rCol.GetBlue() >> 3 ) ]++;
 					}
 				}
@@ -1894,7 +1896,7 @@ sal_Bool Bitmap::ImplReduceMedian( sal_u
 			pWAcc->SetPalette( aPal );
 			for( long nY = 0L; nY < nHeight; nY++ )
 				for( long nX = 0L; nX < nWidth; nX++ )
-					pWAcc->SetPixel( nY, nX, (sal_uInt8) aMap.GetBestPaletteIndex( pRAcc->GetColor( nY, nX ) ) );
+					pWAcc->SetPixelIndex( nY, nX, static_cast<sal_uInt8>( aMap.GetBestPaletteIndex( pRAcc->GetColor( nY, nX ) )) );
 
 			rtl_freeMemory( pColBuf );
 			aNewBmp.ReleaseAccess( pWAcc );

Modified: incubator/ooo/trunk/main/vcl/source/gdi/bitmap4.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/vcl/source/gdi/bitmap4.cxx?rev=1400149&r1=1400148&r2=1400149&view=diff
==============================================================================
--- incubator/ooo/trunk/main/vcl/source/gdi/bitmap4.cxx (original)
+++ incubator/ooo/trunk/main/vcl/source/gdi/bitmap4.cxx Fri Oct 19 16:12:40 2012
@@ -856,7 +856,7 @@ sal_Bool Bitmap::ImplMosaic( const BmpFi
 						{
 							for( nX = nX1; nX <= nX2; nX++ )
 							{
-								const BitmapColor& rCol = pReadAcc->GetPaletteColor( (sal_uInt8) pReadAcc->GetPixel( nY, nX ) );
+								const BitmapColor& rCol = pReadAcc->GetPaletteColor( pReadAcc->GetPixelIndex( nY, nX ) );
 								nSumR += rCol.GetRed();
 								nSumG += rCol.GetGreen();
 								nSumB += rCol.GetBlue();

Modified: incubator/ooo/trunk/main/vcl/source/gdi/bmpacc2.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/vcl/source/gdi/bmpacc2.cxx?rev=1400149&r1=1400148&r2=1400149&view=diff
==============================================================================
--- incubator/ooo/trunk/main/vcl/source/gdi/bmpacc2.cxx (original)
+++ incubator/ooo/trunk/main/vcl/source/gdi/bmpacc2.cxx Fri Oct 19 16:12:40 2012
@@ -32,7 +32,7 @@
 
 IMPL_FORMAT_GETPIXEL_NOMASK( _1BIT_MSB_PAL )
 {
-	return( pScanline[ nX >> 3 ] & ( 1 << ( 7 - ( nX & 7 ) ) ) ? 1 : 0 );
+	return BitmapColor( pScanline[ nX >> 3 ] & ( 1 << ( 7 - ( nX & 7 ) ) ) ? 1 : 0 );
 }
 
 // ------------------------------------------------------------------
@@ -49,7 +49,7 @@ IMPL_FORMAT_SETPIXEL_NOMASK( _1BIT_MSB_P
 
 IMPL_FORMAT_GETPIXEL_NOMASK( _1BIT_LSB_PAL )
 {
-	return( pScanline[ nX >> 3 ] & ( 1 << ( nX & 7 ) ) ? 1 : 0 );
+	return BitmapColor( pScanline[ nX >> 3 ] & ( 1 << ( nX & 7 ) ) ? 1 : 0 );
 }
 
 // ------------------------------------------------------------------
@@ -66,7 +66,7 @@ IMPL_FORMAT_SETPIXEL_NOMASK( _1BIT_LSB_P
 
 IMPL_FORMAT_GETPIXEL_NOMASK( _4BIT_MSN_PAL )
 {
-	return( ( pScanline[ nX >> 1 ] >> ( nX & 1 ? 0 : 4 ) ) & 0x0f );
+	return BitmapColor( ( pScanline[ nX >> 1 ] >> ( nX & 1 ? 0 : 4 ) ) & 0x0f );
 }
 
 // ------------------------------------------------------------------
@@ -83,7 +83,7 @@ IMPL_FORMAT_SETPIXEL_NOMASK( _4BIT_MSN_P
 
 IMPL_FORMAT_GETPIXEL_NOMASK( _4BIT_LSN_PAL )
 {
-	return( ( pScanline[ nX >> 1 ] >> ( nX & 1 ? 4 : 0 ) ) & 0x0f );
+	return BitmapColor( ( pScanline[ nX >> 1 ] >> ( nX & 1 ? 4 : 0 ) ) & 0x0f );
 }
 
 // ------------------------------------------------------------------
@@ -100,7 +100,7 @@ IMPL_FORMAT_SETPIXEL_NOMASK( _4BIT_LSN_P
 
 IMPL_FORMAT_GETPIXEL_NOMASK( _8BIT_PAL )
 {
-	return pScanline[ nX ];
+	return BitmapColor( pScanline[ nX ] );
 }
 
 // ------------------------------------------------------------------

Modified: incubator/ooo/trunk/main/vcl/source/gdi/octree.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/vcl/source/gdi/octree.cxx?rev=1400149&r1=1400148&r2=1400149&view=diff
==============================================================================
--- incubator/ooo/trunk/main/vcl/source/gdi/octree.cxx (original)
+++ incubator/ooo/trunk/main/vcl/source/gdi/octree.cxx Fri Oct 19 16:12:40 2012
@@ -130,7 +130,7 @@ void Octree::ImplCreateOctree()
             {
                 for( long nX = 0; nX < nWidth; nX++ )
                 {
-                    pColor = &(BitmapColor&) pAcc->GetPaletteColor( pAcc->GetPixel( nY, nX ) );
+                    pColor = &(BitmapColor&) pAcc->GetPaletteColor( pAcc->GetPixelIndex( nY, nX ) );
                     nLevel = 0L;
                     ImplAdd( &pTree );
 

Modified: incubator/ooo/trunk/main/vcl/source/gdi/outdev2.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/vcl/source/gdi/outdev2.cxx?rev=1400149&r1=1400148&r2=1400149&view=diff
==============================================================================
--- incubator/ooo/trunk/main/vcl/source/gdi/outdev2.cxx (original)
+++ incubator/ooo/trunk/main/vcl/source/gdi/outdev2.cxx Fri Oct 19 16:12:40 2012
@@ -1666,8 +1666,8 @@ Bitmap OutputDevice::ImplBlendWithAlpha(
 
                     aSrcCol = pP->GetColor( nMapY, nMapX );
                     aDstCol = pB->GetColor( nY, nX );
-                    const sal_uInt8 nSrcOpaq = 255 - pA->GetPixel( nMapY, nMapX ).GetBlueOrIndex();
-                    const sal_uInt8 nDstOpaq  = 255 - pAlphaW->GetPixel( nY, nX ).GetBlueOrIndex();
+                    const sal_uInt8 nSrcOpaq = 255 - pA->GetPixelIndex( nMapY, nMapX );
+                    const sal_uInt8 nDstOpaq  = 255 - pAlphaW->GetPixelIndex( nY, nX );
 
                     aDstCol.SetRed( lcl_calcColor( aSrcCol.GetRed(), nSrcOpaq, aDstCol.GetRed() ) );
                     aDstCol.SetBlue( lcl_calcColor( aSrcCol.GetBlue(), nSrcOpaq, aDstCol.GetBlue() ) );
@@ -1711,8 +1711,8 @@ Bitmap OutputDevice::ImplBlendWithAlpha(
 
                     aSrcCol = pP->GetColor( nMapY, nMapX );
                     aDstCol = pB->GetColor( nY, nX );
-                    const sal_uInt8 nSrcOpaq  = 255 - pA->GetPixel( nMapY, nMapX ).GetBlueOrIndex();
-                    const sal_uInt8 nDstOpaq  = 255 - pAlphaW->GetPixel( nY, nX ).GetBlueOrIndex();
+                    const sal_uInt8 nSrcOpaq  = 255 - pA->GetPixelIndex( nMapY, nMapX );
+                    const sal_uInt8 nDstOpaq  = 255 - pAlphaW->GetPixelIndex( nY, nX );
 
                     aDstCol.SetRed( lcl_calcColor( aSrcCol.GetRed(), nSrcOpaq, aDstCol.GetRed() ) );
                     aDstCol.SetBlue( lcl_calcColor( aSrcCol.GetBlue(), nSrcOpaq, aDstCol.GetBlue() ) );
@@ -1782,7 +1782,7 @@ Bitmap OutputDevice::ImplBlend( Bitmap  
                     const sal_uLong nD = nVCLDitherLut[ nModY | ( nOutX & 0x0FL ) ];
 
                     aDstCol = pB->GetColor( nY, nX );
-                    aDstCol.Merge( pP->GetColor( nMapY, nMapX ), (sal_uInt8) pA->GetPixel( nMapY, nMapX ) );
+                    aDstCol.Merge( pP->GetColor( nMapY, nMapX ), pA->GetPixelIndex( nMapY, nMapX ) );
                     aIndex.SetIndex( (sal_uInt8) ( nVCLRLut[ ( nVCLLut[ aDstCol.GetRed() ] + nD ) >> 16UL ] +
                                               nVCLGLut[ ( nVCLLut[ aDstCol.GetGreen() ] + nD ) >> 16UL ] +
                                               nVCLBLut[ ( nVCLLut[ aDstCol.GetBlue() ] + nD ) >> 16UL ] ) );

Modified: incubator/ooo/trunk/main/vcl/source/gdi/pngread.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/vcl/source/gdi/pngread.cxx?rev=1400149&r1=1400148&r2=1400149&view=diff
==============================================================================
--- incubator/ooo/trunk/main/vcl/source/gdi/pngread.cxx (original)
+++ incubator/ooo/trunk/main/vcl/source/gdi/pngread.cxx Fri Oct 19 16:12:40 2012
@@ -1485,7 +1485,7 @@ void PNGReaderImpl::ImplSetPixel( sal_uI
         return;
     nX >>= mnPreviewShift;
 
-    mpAcc->SetPixel( nY, nX, nPalIndex );
+    mpAcc->SetPixelIndex( nY, nX, nPalIndex );
 }
 
 // ------------------------------------------------------------------------
@@ -1515,8 +1515,8 @@ void PNGReaderImpl::ImplSetAlphaPixel( s
         return;
     nX >>= mnPreviewShift;
 
-    mpAcc->SetPixel( nY, nX, nPalIndex );
-    mpMaskAcc->SetPixel( nY, nX, ~nAlpha );
+    mpAcc->SetPixelIndex( nY, nX, nPalIndex );
+    mpMaskAcc->SetPixelIndex( nY, nX, ~nAlpha );
 }
 
 // ------------------------------------------------------------------------
@@ -1530,7 +1530,7 @@ void PNGReaderImpl::ImplSetAlphaPixel( s
     nX >>= mnPreviewShift;
 
     mpAcc->SetPixel( nY, nX, rBitmapColor );
-    mpMaskAcc->SetPixel( nY, nX, ~nAlpha );
+    mpMaskAcc->SetPixelIndex( nY, nX, ~nAlpha );
 }
 
 // ------------------------------------------------------------------------



Mime
View raw message