summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-02-01 15:04:45 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-02-02 07:45:28 +0000
commit52360bf8dd567598593cb212ac85f0c919315618 (patch)
treea97967592055bbd07abf983db840a8b2ead77c77
parentba9b66eecf9ced0d890ff9d6b7a6efda35825382 (diff)
convert BmpCombine to scoped enum and drop unused
Change-Id: Ic67474683a25a25e5753777f4bbbeded6ceba414 Reviewed-on: https://gerrit.libreoffice.org/33793 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r--filter/source/msfilter/msdffimp.cxx2
-rw-r--r--include/vcl/bitmap.hxx11
-rw-r--r--svtools/source/graphic/transformer.cxx2
-rw-r--r--svx/source/dialog/_bmpmask.cxx2
-rw-r--r--svx/source/dialog/_contdlg.cxx2
-rw-r--r--vcl/source/filter/wmf/winmtf.cxx4
-rw-r--r--vcl/source/gdi/bitmap.cxx87
7 files changed, 10 insertions, 100 deletions
diff --git a/filter/source/msfilter/msdffimp.cxx b/filter/source/msfilter/msdffimp.cxx
index d2aeeebaed46..5e45f5bdafe4 100644
--- a/filter/source/msfilter/msdffimp.cxx
+++ b/filter/source/msfilter/msdffimp.cxx
@@ -3826,7 +3826,7 @@ SdrObject* SvxMSDffManager::ImportGraphic( SvStream& rSt, SfxItemSet& rSet, cons
Bitmap aBitmap( aBitmapEx.GetBitmap() );
Bitmap aMask( aBitmap.CreateMask( MSO_CLR_ToColor( nTransColor, DFF_Prop_pictureTransparent ), 9 ) );
if ( aBitmapEx.IsTransparent() )
- aMask.CombineSimple( aBitmapEx.GetMask(), BMP_COMBINE_OR );
+ aMask.CombineSimple( aBitmapEx.GetMask(), BmpCombine::Or );
aGraf = BitmapEx( aBitmap, aMask );
}
}
diff --git a/include/vcl/bitmap.hxx b/include/vcl/bitmap.hxx
index 9ff398482987..9f99467dbd5d 100644
--- a/include/vcl/bitmap.hxx
+++ b/include/vcl/bitmap.hxx
@@ -88,16 +88,9 @@ enum BmpConversion
BMP_CONVERSION_GHOSTED = 10
};
-enum BmpCombine
+enum class BmpCombine
{
- BMP_COMBINE_COPY = 0,
- BMP_COMBINE_INVERT = 1,
- BMP_COMBINE_AND = 2,
- BMP_COMBINE_NAND = 3,
- BMP_COMBINE_OR = 4,
- BMP_COMBINE_NOR = 5,
- BMP_COMBINE_XOR = 6,
- BMP_COMBINE_NXOR = 7
+ Or, And
};
enum BmpReduce
diff --git a/svtools/source/graphic/transformer.cxx b/svtools/source/graphic/transformer.cxx
index 4caf4692d712..8b934dace7a5 100644
--- a/svtools/source/graphic/transformer.cxx
+++ b/svtools/source/graphic/transformer.cxx
@@ -98,7 +98,7 @@ uno::Reference< graphic::XGraphic > SAL_CALL GraphicTransformer::colorChange(
{
Bitmap aMask( aBitmapEx.GetMask() );
Bitmap aMask2( aBitmap.CreateMask( aColorFrom, nTolerance ) );
- aMask.CombineSimple( aMask2, BMP_COMBINE_OR );
+ aMask.CombineSimple( aMask2, BmpCombine::Or );
aBitmap.Replace( aColorFrom, aColorTo, nTolerance );
aGraphic = ::Graphic( BitmapEx( aBitmap, aMask ) );
}
diff --git a/svx/source/dialog/_bmpmask.cxx b/svx/source/dialog/_bmpmask.cxx
index b7e194854c4f..eebc880f2540 100644
--- a/svx/source/dialog/_bmpmask.cxx
+++ b/svx/source/dialog/_bmpmask.cxx
@@ -631,7 +631,7 @@ BitmapEx SvxBmpMask::ImpMaskTransparent( const BitmapEx& rBitmapEx, const Color&
Bitmap aMask( rBitmapEx.GetBitmap().CreateMask( rColor, nTol ) );
if( rBitmapEx.IsTransparent() )
- aMask.CombineSimple( rBitmapEx.GetMask(), BMP_COMBINE_OR );
+ aMask.CombineSimple( rBitmapEx.GetMask(), BmpCombine::Or );
aBmpEx = BitmapEx( rBitmapEx.GetBitmap(), aMask );
LeaveWait();
diff --git a/svx/source/dialog/_contdlg.cxx b/svx/source/dialog/_contdlg.cxx
index 11d559f958e1..c8c20df1a58c 100644
--- a/svx/source/dialog/_contdlg.cxx
+++ b/svx/source/dialog/_contdlg.cxx
@@ -691,7 +691,7 @@ IMPL_LINK( SvxSuperContourDlg, PipetteClickHdl, ContourWindow&, rWnd, void )
aMask = aBmp.CreateMask( rColor, nTol );
if( aGraphic.IsTransparent() )
- aMask.CombineSimple( aGraphic.GetBitmapEx().GetMask(), BMP_COMBINE_OR );
+ aMask.CombineSimple( aGraphic.GetBitmapEx().GetMask(), BmpCombine::Or );
if( !!aMask )
{
diff --git a/vcl/source/filter/wmf/winmtf.cxx b/vcl/source/filter/wmf/winmtf.cxx
index b383439dc99d..b824a1a2edde 100644
--- a/vcl/source/filter/wmf/winmtf.cxx
+++ b/vcl/source/filter/wmf/winmtf.cxx
@@ -1637,11 +1637,11 @@ void WinMtfOutput::ImplDrawBitmap( const Point& rPos, const Size& rSize, const B
if ( rBitmap.GetTransparentColor() == Color( COL_WHITE ) )
{
- aMask.CombineSimple( rBitmap.GetMask(), BMP_COMBINE_OR );
+ aMask.CombineSimple( rBitmap.GetMask(), BmpCombine::Or );
}
else
{
- aMask.CombineSimple( rBitmap.GetMask(), BMP_COMBINE_AND );
+ aMask.CombineSimple( rBitmap.GetMask(), BmpCombine::And );
}
aBmpEx = BitmapEx( rBitmap.GetBitmap(), aMask );
diff --git a/vcl/source/gdi/bitmap.cxx b/vcl/source/gdi/bitmap.cxx
index ec382f267612..16aa9adf590d 100644
--- a/vcl/source/gdi/bitmap.cxx
+++ b/vcl/source/gdi/bitmap.cxx
@@ -1721,31 +1721,7 @@ bool Bitmap::CombineSimple( const Bitmap& rMask, BmpCombine eCombine )
switch( eCombine )
{
- case BMP_COMBINE_COPY:
- {
- for( long nY = 0L; nY < nHeight; nY++ ) for( long nX = 0L; nX < nWidth; nX++ )
- {
- if( pMaskAcc->GetPixel( nY, nX ) == aMaskBlack )
- pAcc->SetPixel( nY, nX, aBlack );
- else
- pAcc->SetPixel( nY, nX, aWhite );
- }
- }
- break;
-
- case BMP_COMBINE_INVERT:
- {
- for( long nY = 0L; nY < nHeight; nY++ ) for( long nX = 0L; nX < nWidth; nX++ )
- {
- if( pAcc->GetPixel( nY, nX ) == aBlack )
- pAcc->SetPixel( nY, nX, aWhite );
- else
- pAcc->SetPixel( nY, nX, aBlack );
- }
- }
- break;
-
- case BMP_COMBINE_AND:
+ case BmpCombine::And:
{
for( long nY = 0L; nY < nHeight; nY++ ) for( long nX = 0L; nX < nWidth; nX++ )
{
@@ -1757,19 +1733,7 @@ bool Bitmap::CombineSimple( const Bitmap& rMask, BmpCombine eCombine )
}
break;
- case BMP_COMBINE_NAND:
- {
- for( long nY = 0L; nY < nHeight; nY++ ) for( long nX = 0L; nX < nWidth; nX++ )
- {
- if( pMaskAcc->GetPixel( nY, nX ) != aMaskBlack && pAcc->GetPixel( nY, nX ) != aBlack )
- pAcc->SetPixel( nY, nX, aBlack );
- else
- pAcc->SetPixel( nY, nX, aWhite );
- }
- }
- break;
-
- case BMP_COMBINE_OR:
+ case BmpCombine::Or:
{
for( long nY = 0L; nY < nHeight; nY++ ) for( long nX = 0L; nX < nWidth; nX++ )
{
@@ -1781,53 +1745,6 @@ bool Bitmap::CombineSimple( const Bitmap& rMask, BmpCombine eCombine )
}
break;
- case BMP_COMBINE_NOR:
- {
- for( long nY = 0L; nY < nHeight; nY++ ) for( long nX = 0L; nX < nWidth; nX++ )
- {
- if( pMaskAcc->GetPixel( nY, nX ) != aMaskBlack || pAcc->GetPixel( nY, nX ) != aBlack )
- pAcc->SetPixel( nY, nX, aBlack );
- else
- pAcc->SetPixel( nY, nX, aWhite );
- }
- }
- break;
-
- case BMP_COMBINE_XOR:
- {
- for( long nY = 0L; nY < nHeight; nY++ ) for( long nX = 0L; nX < nWidth; nX++ )
- {
- aPixel = pAcc->GetPixel( nY, nX );
- aMaskPixel = pMaskAcc->GetPixel( nY, nX );
-
- if( ( aMaskPixel != aMaskBlack && aPixel == aBlack ) ||
- ( aMaskPixel == aMaskBlack && aPixel != aBlack ) )
- {
- pAcc->SetPixel( nY, nX, aWhite );
- }
- else
- pAcc->SetPixel( nY, nX, aBlack );
- }
- }
- break;
-
- case BMP_COMBINE_NXOR:
- {
- for( long nY = 0L; nY < nHeight; nY++ ) for( long nX = 0L; nX < nWidth; nX++ )
- {
- aPixel = pAcc->GetPixel( nY, nX );
- aMaskPixel = pMaskAcc->GetPixel( nY, nX );
-
- if( ( aMaskPixel != aMaskBlack && aPixel == aBlack ) ||
- ( aMaskPixel == aMaskBlack && aPixel != aBlack ) )
- {
- pAcc->SetPixel( nY, nX, aBlack );
- }
- else
- pAcc->SetPixel( nY, nX, aWhite );
- }
- }
- break;
}
bRet = true;