summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-12-12 09:33:14 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-12-13 11:00:40 +0100
commite75abe6e0a4ea250366bb29c0ece697e9b1b80a1 (patch)
tree9f6f945bdf57feab0e8f71bec331f220f49166b0 /vcl
parent6ca6d6ac912588a8f62d7e6b668ebec333752ebc (diff)
convert tolerance params to sal_uInt8
since their range is 0-255 Also drop pTols from ImplColReplaceParam, since it is always nullptr. Change-Id: I9e9ab7f7596e18cab1d67dd69922e5ac9867f45b Reviewed-on: https://gerrit.libreoffice.org/46274 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'vcl')
-rw-r--r--vcl/headless/svpbmp.cxx2
-rw-r--r--vcl/inc/headless/svpbmp.hxx2
-rw-r--r--vcl/inc/impbmp.hxx2
-rw-r--r--vcl/inc/opengl/salbmp.hxx2
-rw-r--r--vcl/inc/quartz/salbmp.h2
-rw-r--r--vcl/inc/salbmp.hxx3
-rw-r--r--vcl/inc/unx/salbmp.h2
-rw-r--r--vcl/inc/win/salbmp.h2
-rw-r--r--vcl/opengl/salbmp.cxx2
-rw-r--r--vcl/quartz/salbmp.cxx2
-rw-r--r--vcl/source/gdi/bitmap.cxx85
-rw-r--r--vcl/source/gdi/bitmapex.cxx4
-rw-r--r--vcl/source/gdi/gdimtf.cxx46
-rw-r--r--vcl/source/gdi/impbmp.cxx2
-rw-r--r--vcl/unx/generic/gdi/salbmp.cxx2
-rw-r--r--vcl/win/gdi/salbmp.cxx2
16 files changed, 80 insertions, 82 deletions
diff --git a/vcl/headless/svpbmp.cxx b/vcl/headless/svpbmp.cxx
index ef907ccb5aeb..cb7a8654798a 100644
--- a/vcl/headless/svpbmp.cxx
+++ b/vcl/headless/svpbmp.cxx
@@ -290,7 +290,7 @@ bool SvpSalBitmap::Scale( const double& /*rScaleX*/, const double& /*rScaleY*/,
return false;
}
-bool SvpSalBitmap::Replace( const ::Color& /*rSearchColor*/, const ::Color& /*rReplaceColor*/, sal_uLong /*nTol*/ )
+bool SvpSalBitmap::Replace( const ::Color& /*rSearchColor*/, const ::Color& /*rReplaceColor*/, sal_uInt8 /*nTol*/ )
{
return false;
}
diff --git a/vcl/inc/headless/svpbmp.hxx b/vcl/inc/headless/svpbmp.hxx
index 884d9d13aecc..efdd2c2bb2af 100644
--- a/vcl/inc/headless/svpbmp.hxx
+++ b/vcl/inc/headless/svpbmp.hxx
@@ -59,7 +59,7 @@ public:
virtual bool ScalingSupported() const override;
virtual bool Scale( const double& rScaleX, const double& rScaleY, BmpScaleFlag nScaleFlag ) override;
- virtual bool Replace( const Color& rSearchColor, const Color& rReplaceColor, sal_uLong nTol ) override;
+ virtual bool Replace( const Color& rSearchColor, const Color& rReplaceColor, sal_uInt8 nTol ) override;
};
#endif // INCLUDED_VCL_INC_HEADLESS_SVPBMP_HXX
diff --git a/vcl/inc/impbmp.hxx b/vcl/inc/impbmp.hxx
index a6212693498e..9465771332e8 100644
--- a/vcl/inc/impbmp.hxx
+++ b/vcl/inc/impbmp.hxx
@@ -69,7 +69,7 @@ public:
bool ImplScalingSupported() const;
bool ImplScale( const double& rScaleX, const double& rScaleY, BmpScaleFlag nScaleFlag );
- bool ImplReplace( const Color& rSearchColor, const Color& rReplaceColor, sal_uLong nTol );
+ bool ImplReplace( const Color& rSearchColor, const Color& rReplaceColor, sal_uInt8 nTol );
bool ImplConvert( BmpConversion eConversion );
};
diff --git a/vcl/inc/opengl/salbmp.hxx b/vcl/inc/opengl/salbmp.hxx
index 3f7f57aff1bd..a060f09bdcb4 100644
--- a/vcl/inc/opengl/salbmp.hxx
+++ b/vcl/inc/opengl/salbmp.hxx
@@ -76,7 +76,7 @@ public:
bool ScalingSupported() const override;
bool Scale( const double& rScaleX, const double& rScaleY, BmpScaleFlag nScaleFlag ) override;
- bool Replace( const Color& rSearchColor, const Color& rReplaceColor, sal_uLong nTol ) override;
+ bool Replace( const Color& rSearchColor, const Color& rReplaceColor, sal_uInt8 nTol ) override;
bool ConvertToGreyscale() override;
public:
diff --git a/vcl/inc/quartz/salbmp.h b/vcl/inc/quartz/salbmp.h
index a4dca65c0ee3..d7c2fb74db51 100644
--- a/vcl/inc/quartz/salbmp.h
+++ b/vcl/inc/quartz/salbmp.h
@@ -76,7 +76,7 @@ public:
bool ScalingSupported() const override;
bool Scale( const double& rScaleX, const double& rScaleY, BmpScaleFlag nScaleFlag ) override;
- bool Replace( const Color& rSearchColor, const Color& rReplaceColor, sal_uLong nTol ) override;
+ bool Replace( const Color& rSearchColor, const Color& rReplaceColor, sal_uInt8 nTol ) override;
private:
// quartz helper
diff --git a/vcl/inc/salbmp.hxx b/vcl/inc/salbmp.hxx
index 47d0c0280400..574e6272d700 100644
--- a/vcl/inc/salbmp.hxx
+++ b/vcl/inc/salbmp.hxx
@@ -23,6 +23,7 @@
#include <tools/gen.hxx>
#include <vcl/checksum.hxx>
#include <vcl/salbtype.hxx>
+#include <vcl/bitmap.hxx>
#include <com/sun/star/rendering/XBitmapCanvas.hpp>
@@ -68,7 +69,7 @@ public:
virtual bool ScalingSupported() const = 0;
virtual bool Scale( const double& rScaleX, const double& rScaleY, BmpScaleFlag nScaleFlag ) = 0;
- virtual bool Replace( const Color& rSearchColor, const Color& rReplaceColor, sal_uLong nTol ) = 0;
+ virtual bool Replace( const Color& rSearchColor, const Color& rReplaceColor, sal_uInt8 nTol ) = 0;
virtual bool ConvertToGreyscale()
{
diff --git a/vcl/inc/unx/salbmp.h b/vcl/inc/unx/salbmp.h
index a2dd587a4964..3f45cd5d853c 100644
--- a/vcl/inc/unx/salbmp.h
+++ b/vcl/inc/unx/salbmp.h
@@ -146,7 +146,7 @@ public:
virtual bool ScalingSupported() const override;
virtual bool Scale( const double& rScaleX, const double& rScaleY, BmpScaleFlag nScaleFlag ) override;
- virtual bool Replace( const Color& rSearchColor, const Color& rReplaceColor, sal_uLong nTol ) override;
+ virtual bool Replace( const Color& rSearchColor, const Color& rReplaceColor, sal_uInt8 nTol ) override;
};
diff --git a/vcl/inc/win/salbmp.h b/vcl/inc/win/salbmp.h
index 33d88bb92a30..f139a8608b30 100644
--- a/vcl/inc/win/salbmp.h
+++ b/vcl/inc/win/salbmp.h
@@ -97,7 +97,7 @@ public:
virtual bool ScalingSupported() const override;
virtual bool Scale( const double& rScaleX, const double& rScaleY, BmpScaleFlag nScaleFlag ) override;
- virtual bool Replace( const Color& rSearchColor, const Color& rReplaceColor, sal_uLong nTol ) override;
+ virtual bool Replace( const Color& rSearchColor, const Color& rReplaceColor, sal_uInt8 nTol ) override;
};
#endif // INCLUDED_VCL_INC_WIN_SALBMP_H
diff --git a/vcl/opengl/salbmp.cxx b/vcl/opengl/salbmp.cxx
index 6a032200670e..b3f8f54c960f 100644
--- a/vcl/opengl/salbmp.cxx
+++ b/vcl/opengl/salbmp.cxx
@@ -873,7 +873,7 @@ bool OpenGLSalBitmap::GetSystemData( BitmapSystemData& /*rData*/ )
#endif
}
-bool OpenGLSalBitmap::Replace( const Color& rSearchColor, const Color& rReplaceColor, sal_uLong nTol )
+bool OpenGLSalBitmap::Replace( const Color& rSearchColor, const Color& rReplaceColor, sal_uInt8 nTol )
{
VCL_GL_INFO("::Replace");
diff --git a/vcl/quartz/salbmp.cxx b/vcl/quartz/salbmp.cxx
index b96e25421686..8082621cc5f9 100644
--- a/vcl/quartz/salbmp.cxx
+++ b/vcl/quartz/salbmp.cxx
@@ -1058,7 +1058,7 @@ bool QuartzSalBitmap::Scale( const double& /*rScaleX*/, const double& /*rScaleY*
return false;
}
-bool QuartzSalBitmap::Replace( const Color& /*rSearchColor*/, const Color& /*rReplaceColor*/, sal_uLong /*nTol*/ )
+bool QuartzSalBitmap::Replace( const Color& /*rSearchColor*/, const Color& /*rReplaceColor*/, sal_uInt8 /*nTol*/ )
{
return false;
}
diff --git a/vcl/source/gdi/bitmap.cxx b/vcl/source/gdi/bitmap.cxx
index ad70291b08be..e977ceea9bed 100644
--- a/vcl/source/gdi/bitmap.cxx
+++ b/vcl/source/gdi/bitmap.cxx
@@ -1112,7 +1112,7 @@ bool Bitmap::Expand( sal_uLong nDX, sal_uLong nDY, const Color* pInitColor )
return bRet;
}
-Bitmap Bitmap::CreateMask( const Color& rTransColor, sal_uLong nTol ) const
+Bitmap Bitmap::CreateMask( const Color& rTransColor, sal_uInt8 nTol ) const
{
ScopedReadAccess pReadAcc(const_cast<Bitmap&>(*this));
@@ -1244,14 +1244,12 @@ Bitmap Bitmap::CreateMask( const Color& rTransColor, sal_uLong nTol ) const
}
else
{
- BitmapColor aCol;
- long nR, nG, nB;
- const long nMinR = MinMax<long>(rTransColor.GetRed() - nTol, 0, 255);
- const long nMaxR = MinMax<long>(rTransColor.GetRed() + nTol, 0, 255);
- const long nMinG = MinMax<long>(rTransColor.GetGreen() - nTol, 0, 255);
- const long nMaxG = MinMax<long>(rTransColor.GetGreen() + nTol, 0, 255);
- const long nMinB = MinMax<long>(rTransColor.GetBlue() - nTol, 0, 255);
- const long nMaxB = MinMax<long>(rTransColor.GetBlue() + nTol, 0, 255);
+ const sal_uInt8 nMinR = MinMax<sal_uInt8>(rTransColor.GetRed() - nTol, 0, 255);
+ const sal_uInt8 nMaxR = MinMax<sal_uInt8>(rTransColor.GetRed() + nTol, 0, 255);
+ const sal_uInt8 nMinG = MinMax<sal_uInt8>(rTransColor.GetGreen() - nTol, 0, 255);
+ const sal_uInt8 nMaxG = MinMax<sal_uInt8>(rTransColor.GetGreen() + nTol, 0, 255);
+ const sal_uInt8 nMinB = MinMax<sal_uInt8>(rTransColor.GetBlue() - nTol, 0, 255);
+ const sal_uInt8 nMaxB = MinMax<sal_uInt8>(rTransColor.GetBlue() + nTol, 0, 255);
if( pReadAcc->HasPalette() )
{
@@ -1259,10 +1257,10 @@ Bitmap Bitmap::CreateMask( const Color& rTransColor, sal_uLong nTol ) const
{
for( long nX = 0; nX < nWidth; nX++ )
{
- aCol = pReadAcc->GetPaletteColor( pReadAcc->GetPixelIndex( nY, nX ) );
- nR = aCol.GetRed();
- nG = aCol.GetGreen();
- nB = aCol.GetBlue();
+ BitmapColor aCol = pReadAcc->GetPaletteColor( pReadAcc->GetPixelIndex( nY, nX ) );
+ sal_uInt8 nR = aCol.GetRed();
+ sal_uInt8 nG = aCol.GetGreen();
+ sal_uInt8 nB = aCol.GetBlue();
if( nMinR <= nR && nMaxR >= nR &&
nMinG <= nG && nMaxG >= nG &&
@@ -1281,10 +1279,10 @@ Bitmap Bitmap::CreateMask( const Color& rTransColor, sal_uLong nTol ) const
{
for( long nX = 0; nX < nWidth; nX++ )
{
- aCol = pReadAcc->GetPixel( nY, nX );
- nR = aCol.GetRed();
- nG = aCol.GetGreen();
- nB = aCol.GetBlue();
+ BitmapColor aCol = pReadAcc->GetPixel( nY, nX );
+ sal_uInt8 nR = aCol.GetRed();
+ sal_uInt8 nG = aCol.GetGreen();
+ sal_uInt8 nB = aCol.GetBlue();
if( nMinR <= nR && nMaxR >= nR &&
nMinG <= nG && nMaxG >= nG &&
@@ -1534,7 +1532,7 @@ bool Bitmap::Replace( const AlphaMask& rAlpha, const Color& rMergeColor )
return bRet;
}
-bool Bitmap::Replace( const Color& rSearchColor, const Color& rReplaceColor, sal_uLong nTol )
+bool Bitmap::Replace( const Color& rSearchColor, const Color& rReplaceColor, sal_uInt8 nTol )
{
if( mxImpBmp )
{
@@ -1559,12 +1557,12 @@ bool Bitmap::Replace( const Color& rSearchColor, const Color& rReplaceColor, sal
if( pAcc )
{
- const long nMinR = MinMax<long>(rSearchColor.GetRed() - nTol, 0, 255);
- const long nMaxR = MinMax<long>(rSearchColor.GetRed() + nTol, 0, 255);
- const long nMinG = MinMax<long>(rSearchColor.GetGreen() - nTol, 0, 255);
- const long nMaxG = MinMax<long>(rSearchColor.GetGreen() + nTol, 0, 255);
- const long nMinB = MinMax<long>(rSearchColor.GetBlue() - nTol, 0, 255);
- const long nMaxB = MinMax<long>(rSearchColor.GetBlue() + nTol, 0, 255);
+ const sal_uInt8 nMinR = MinMax<sal_uInt8>(rSearchColor.GetRed() - nTol, 0, 255);
+ const sal_uInt8 nMaxR = MinMax<sal_uInt8>(rSearchColor.GetRed() + nTol, 0, 255);
+ const sal_uInt8 nMinG = MinMax<sal_uInt8>(rSearchColor.GetGreen() - nTol, 0, 255);
+ const sal_uInt8 nMaxG = MinMax<sal_uInt8>(rSearchColor.GetGreen() + nTol, 0, 255);
+ const sal_uInt8 nMinB = MinMax<sal_uInt8>(rSearchColor.GetBlue() - nTol, 0, 255);
+ const sal_uInt8 nMaxB = MinMax<sal_uInt8>(rSearchColor.GetBlue() + nTol, 0, 255);
if( pAcc->HasPalette() )
{
@@ -1609,7 +1607,7 @@ bool Bitmap::Replace( const Color& rSearchColor, const Color& rReplaceColor, sal
}
bool Bitmap::Replace( const Color* pSearchColors, const Color* pReplaceColors,
- sal_uLong nColorCount, sal_uLong* _pTols )
+ sal_uLong nColorCount, const sal_uInt8* _pTols )
{
// Bitmaps with 1 bit color depth can cause problems
// if they have other entries than black/white in their palette
@@ -1621,34 +1619,35 @@ bool Bitmap::Replace( const Color* pSearchColors, const Color* pReplaceColors,
if( pAcc )
{
- std::unique_ptr<long[]> pMinR(new long[ nColorCount ]);
- std::unique_ptr<long[]> pMaxR(new long[ nColorCount ]);
- std::unique_ptr<long[]> pMinG(new long[ nColorCount ]);
- std::unique_ptr<long[]> pMaxG(new long[ nColorCount ]);
- std::unique_ptr<long[]> pMinB(new long[ nColorCount ]);
- std::unique_ptr<long[]> pMaxB(new long[ nColorCount ]);
- long* pTols;
+ std::unique_ptr<sal_uInt8[]> pMinR(new sal_uInt8[ nColorCount ]);
+ std::unique_ptr<sal_uInt8[]> pMaxR(new sal_uInt8[ nColorCount ]);
+ std::unique_ptr<sal_uInt8[]> pMinG(new sal_uInt8[ nColorCount ]);
+ std::unique_ptr<sal_uInt8[]> pMaxG(new sal_uInt8[ nColorCount ]);
+ std::unique_ptr<sal_uInt8[]> pMinB(new sal_uInt8[ nColorCount ]);
+ std::unique_ptr<sal_uInt8[]> pMaxB(new sal_uInt8[ nColorCount ]);
+ sal_uInt8 const * pTols;
sal_uLong i;
if( !_pTols )
{
- pTols = new long[ nColorCount ];
- memset( pTols, 0, nColorCount * sizeof( long ) );
+ auto p = new sal_uInt8[ nColorCount ];
+ memset( p, 0, nColorCount * sizeof( sal_uInt8 ) );
+ pTols = p;
}
else
- pTols = reinterpret_cast<long*>(_pTols);
+ pTols = _pTols;
for( i = 0; i < nColorCount; i++ )
{
const Color& rCol = pSearchColors[ i ];
- const long nTol = pTols[ i ];
-
- pMinR[ i ] = MinMax<long>(rCol.GetRed() - nTol, 0, 255);
- pMaxR[ i ] = MinMax<long>(rCol.GetRed() + nTol, 0, 255);
- pMinG[ i ] = MinMax<long>(rCol.GetGreen() - nTol, 0, 255);
- pMaxG[ i ] = MinMax<long>(rCol.GetGreen() + nTol, 0, 255);
- pMinB[ i ] = MinMax<long>(rCol.GetBlue() - nTol, 0, 255);
- pMaxB[ i ] = MinMax<long>(rCol.GetBlue() + nTol, 0, 255);
+ const sal_uInt8 nTol = pTols[ i ];
+
+ pMinR[ i ] = MinMax<sal_uInt8>(rCol.GetRed() - nTol, 0, 255);
+ pMaxR[ i ] = MinMax<sal_uInt8>(rCol.GetRed() + nTol, 0, 255);
+ pMinG[ i ] = MinMax<sal_uInt8>(rCol.GetGreen() - nTol, 0, 255);
+ pMaxG[ i ] = MinMax<sal_uInt8>(rCol.GetGreen() + nTol, 0, 255);
+ pMinB[ i ] = MinMax<sal_uInt8>(rCol.GetBlue() - nTol, 0, 255);
+ pMaxB[ i ] = MinMax<sal_uInt8>(rCol.GetBlue() + nTol, 0, 255);
}
if( pAcc->HasPalette() )
diff --git a/vcl/source/gdi/bitmapex.cxx b/vcl/source/gdi/bitmapex.cxx
index 658a53a5e429..59e519a83b95 100644
--- a/vcl/source/gdi/bitmapex.cxx
+++ b/vcl/source/gdi/bitmapex.cxx
@@ -617,9 +617,9 @@ bool BitmapEx::Replace( const Color& rSearchColor, const Color& rReplaceColor )
return !!aBitmap && aBitmap.Replace( rSearchColor, rReplaceColor );
}
-bool BitmapEx::Replace( const Color* pSearchColors, const Color* pReplaceColors, sal_uLong nColorCount, const sal_uLong* pTols )
+bool BitmapEx::Replace( const Color* pSearchColors, const Color* pReplaceColors, sal_uLong nColorCount, const sal_uInt8* pTols )
{
- return !!aBitmap && aBitmap.Replace( pSearchColors, pReplaceColors, nColorCount, const_cast<sal_uLong*>(pTols) );
+ return !!aBitmap && aBitmap.Replace( pSearchColors, pReplaceColors, nColorCount, pTols );
}
bool BitmapEx::Adjust( short nLuminancePercent, short nContrastPercent,
diff --git a/vcl/source/gdi/gdimtf.cxx b/vcl/source/gdi/gdimtf.cxx
index 779bcbdcddc3..6bdea38bcb3e 100644
--- a/vcl/source/gdi/gdimtf.cxx
+++ b/vcl/source/gdi/gdimtf.cxx
@@ -95,12 +95,12 @@ struct ImplBmpMonoParam
struct ImplColReplaceParam
{
- sal_uLong* pMinR;
- sal_uLong* pMaxR;
- sal_uLong* pMinG;
- sal_uLong* pMaxG;
- sal_uLong* pMinB;
- sal_uLong* pMaxB;
+ sal_uInt8* pMinR;
+ sal_uInt8* pMaxR;
+ sal_uInt8* pMinG;
+ sal_uInt8* pMaxG;
+ sal_uInt8* pMinB;
+ sal_uInt8* pMaxB;
const Color* pDstCols;
sal_uLong nCount;
};
@@ -109,8 +109,7 @@ struct ImplBmpReplaceParam
{
const Color* pSrcCols;
const Color* pDstCols;
- sal_uLong nCount;
- const sal_uLong* pTols;
+ sal_uLong nCount;
};
GDIMetaFile::GDIMetaFile() :
@@ -1797,7 +1796,7 @@ BitmapEx GDIMetaFile::ImplBmpMonoFnc( const BitmapEx& rBmpEx, const void* pBmpPa
Color GDIMetaFile::ImplColReplaceFnc( const Color& rColor, const void* pColParam )
{
- const sal_uLong nR = rColor.GetRed(), nG = rColor.GetGreen(), nB = rColor.GetBlue();
+ const sal_uInt8 nR = rColor.GetRed(), nG = rColor.GetGreen(), nB = rColor.GetBlue();
for( sal_uLong i = 0; i < static_cast<const ImplColReplaceParam*>(pColParam)->nCount; i++ )
{
@@ -1820,7 +1819,7 @@ BitmapEx GDIMetaFile::ImplBmpReplaceFnc( const BitmapEx& rBmpEx, const void* pBm
const ImplBmpReplaceParam* p = static_cast<const ImplBmpReplaceParam*>(pBmpParam);
BitmapEx aRet( rBmpEx );
- aRet.Replace( p->pSrcCols, p->pDstCols, p->nCount, p->pTols );
+ aRet.Replace( p->pSrcCols, p->pDstCols, p->nCount, nullptr );
return aRet;
}
@@ -2191,28 +2190,28 @@ void GDIMetaFile::ReplaceColors( const Color* pSearchColors, const Color* pRepla
ImplColReplaceParam aColParam;
ImplBmpReplaceParam aBmpParam;
- aColParam.pMinR = new sal_uLong[ nColorCount ];
- aColParam.pMaxR = new sal_uLong[ nColorCount ];
- aColParam.pMinG = new sal_uLong[ nColorCount ];
- aColParam.pMaxG = new sal_uLong[ nColorCount ];
- aColParam.pMinB = new sal_uLong[ nColorCount ];
- aColParam.pMaxB = new sal_uLong[ nColorCount ];
+ aColParam.pMinR = new sal_uInt8[ nColorCount ];
+ aColParam.pMaxR = new sal_uInt8[ nColorCount ];
+ aColParam.pMinG = new sal_uInt8[ nColorCount ];
+ aColParam.pMaxG = new sal_uInt8[ nColorCount ];
+ aColParam.pMinB = new sal_uInt8[ nColorCount ];
+ aColParam.pMaxB = new sal_uInt8[ nColorCount ];
for( sal_uLong i = 0; i < nColorCount; i++ )
{
- long nVal;
+ sal_uInt8 nVal;
nVal = pSearchColors[ i ].GetRed();
- aColParam.pMinR[ i ] = (sal_uLong) std::max( nVal, 0L );
- aColParam.pMaxR[ i ] = (sal_uLong) std::min( nVal, 255L );
+ aColParam.pMinR[ i ] = std::max<sal_uInt8>( nVal, 0L );
+ aColParam.pMaxR[ i ] = std::min<sal_uInt8>( nVal, 255L );
nVal = pSearchColors[ i ].GetGreen();
- aColParam.pMinG[ i ] = (sal_uLong) std::max( nVal, 0L );
- aColParam.pMaxG[ i ] = (sal_uLong) std::min( nVal, 255L );
+ aColParam.pMinG[ i ] = std::max<sal_uInt8>( nVal, 0L );
+ aColParam.pMaxG[ i ] = std::min<sal_uInt8>( nVal, 255L );
nVal = pSearchColors[ i ].GetBlue();
- aColParam.pMinB[ i ] = (sal_uLong) std::max( nVal, 0L );
- aColParam.pMaxB[ i ] = (sal_uLong) std::min( nVal, 255L );
+ aColParam.pMinB[ i ] = std::max<sal_uInt8>( nVal, 0L );
+ aColParam.pMaxB[ i ] = std::min<sal_uInt8>( nVal, 255L );
}
aColParam.pDstCols = pReplaceColors;
@@ -2221,7 +2220,6 @@ void GDIMetaFile::ReplaceColors( const Color* pSearchColors, const Color* pRepla
aBmpParam.pSrcCols = pSearchColors;
aBmpParam.pDstCols = pReplaceColors;
aBmpParam.nCount = nColorCount;
- aBmpParam.pTols = nullptr;
ImplExchangeColors( ImplColReplaceFnc, &aColParam, ImplBmpReplaceFnc, &aBmpParam );
diff --git a/vcl/source/gdi/impbmp.cxx b/vcl/source/gdi/impbmp.cxx
index 4342bc8e6402..5950da46d7cc 100644
--- a/vcl/source/gdi/impbmp.cxx
+++ b/vcl/source/gdi/impbmp.cxx
@@ -112,7 +112,7 @@ bool ImpBitmap::ImplScale( const double& rScaleX, const double& rScaleY, BmpScal
return mpSalBitmap->Scale( rScaleX, rScaleY, nScaleFlag );
}
-bool ImpBitmap::ImplReplace( const Color& rSearchColor, const Color& rReplaceColor, sal_uLong nTol )
+bool ImpBitmap::ImplReplace( const Color& rSearchColor, const Color& rReplaceColor, sal_uInt8 nTol )
{
return mpSalBitmap->Replace( rSearchColor, rReplaceColor, nTol );
}
diff --git a/vcl/unx/generic/gdi/salbmp.cxx b/vcl/unx/generic/gdi/salbmp.cxx
index 69b9fd1ca3e9..d599a39aaf1d 100644
--- a/vcl/unx/generic/gdi/salbmp.cxx
+++ b/vcl/unx/generic/gdi/salbmp.cxx
@@ -916,7 +916,7 @@ bool X11SalBitmap::Scale( const double& /*rScaleX*/, const double& /*rScaleY*/,
return false;
}
-bool X11SalBitmap::Replace( const Color& /*rSearchColor*/, const Color& /*rReplaceColor*/, sal_uLong /*nTol*/ )
+bool X11SalBitmap::Replace( const Color& /*rSearchColor*/, const Color& /*rReplaceColor*/, sal_uInt8 /*nTol*/ )
{
return false;
}
diff --git a/vcl/win/gdi/salbmp.cxx b/vcl/win/gdi/salbmp.cxx
index 3cef654924f3..e8110226ce2b 100644
--- a/vcl/win/gdi/salbmp.cxx
+++ b/vcl/win/gdi/salbmp.cxx
@@ -1077,7 +1077,7 @@ bool WinSalBitmap::Scale( const double& /*rScaleX*/, const double& /*rScaleY*/,
return false;
}
-bool WinSalBitmap::Replace( const Color& /*rSearchColor*/, const Color& /*rReplaceColor*/, sal_uLong /*nTol*/ )
+bool WinSalBitmap::Replace( const Color& /*rSearchColor*/, const Color& /*rReplaceColor*/, sal_uInt8 /*nTol*/ )
{
return false;
}