[Libreoffice-commits] core.git: include/vcl vcl/headless vcl/quartz vcl/source vcl/unx vcl/win
Noel Grandin
noel at peralex.com
Tue May 10 12:06:04 UTC 2016
include/vcl/salgtype.hxx | 7 +++----
vcl/headless/svpgdi.cxx | 12 ++++++------
vcl/quartz/salgdicommon.cxx | 2 +-
vcl/source/outdev/outdevstate.cxx | 12 ++++++------
vcl/unx/generic/gdi/gdiimpl.cxx | 12 ++++++------
vcl/win/gdi/gdiimpl.cxx | 2 +-
6 files changed, 23 insertions(+), 24 deletions(-)
New commits:
commit 961b715d9d28e50608ab487624ded5231ca7bb78
Author: Noel Grandin <noel at peralex.com>
Date: Tue May 10 09:47:59 2016 +0200
convert SAL_ROP to scoped enum
Change-Id: I2c49ec843c0f95e8246cdf9d3185c11e81a3bde3
Reviewed-on: https://gerrit.libreoffice.org/24824
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin at gmail.com>
diff --git a/include/vcl/salgtype.hxx b/include/vcl/salgtype.hxx
index a43a19d..cae4727 100644
--- a/include/vcl/salgtype.hxx
+++ b/include/vcl/salgtype.hxx
@@ -66,10 +66,9 @@ struct SalTwoRect
}
};
-typedef sal_uInt16 SalROPColor;
-#define SAL_ROP_0 ((SalROPColor)0)
-#define SAL_ROP_1 ((SalROPColor)1)
-#define SAL_ROP_INVERT ((SalROPColor)2)
+enum class SalROPColor {
+ N0, N1, Invert
+};
typedef sal_uInt16 SalInvert;
#define SAL_INVERT_HIGHLIGHT ((SalInvert)0x0001)
diff --git a/vcl/headless/svpgdi.cxx b/vcl/headless/svpgdi.cxx
index b4dca52..7da5c50 100644
--- a/vcl/headless/svpgdi.cxx
+++ b/vcl/headless/svpgdi.cxx
@@ -450,13 +450,13 @@ void SvpSalGraphics::SetROPLineColor( SalROPColor nROPColor )
{
switch( nROPColor )
{
- case SAL_ROP_0:
+ case SalROPColor::N0:
m_aLineColor = MAKE_SALCOLOR(0, 0, 0);
break;
- case SAL_ROP_1:
+ case SalROPColor::N1:
m_aLineColor = MAKE_SALCOLOR(0xff, 0xff, 0xff);
break;
- case SAL_ROP_INVERT:
+ case SalROPColor::Invert:
m_aLineColor = MAKE_SALCOLOR(0xff, 0xff, 0xff);
break;
}
@@ -466,13 +466,13 @@ void SvpSalGraphics::SetROPFillColor( SalROPColor nROPColor )
{
switch( nROPColor )
{
- case SAL_ROP_0:
+ case SalROPColor::N0:
m_aFillColor = MAKE_SALCOLOR(0, 0, 0);
break;
- case SAL_ROP_1:
+ case SalROPColor::N1:
m_aFillColor = MAKE_SALCOLOR(0xff, 0xff, 0xff);
break;
- case SAL_ROP_INVERT:
+ case SalROPColor::Invert:
m_aFillColor = MAKE_SALCOLOR(0xff, 0xff, 0xff);
break;
}
diff --git a/vcl/quartz/salgdicommon.cxx b/vcl/quartz/salgdicommon.cxx
index e493be1..3efe620 100644
--- a/vcl/quartz/salgdicommon.cxx
+++ b/vcl/quartz/salgdicommon.cxx
@@ -498,7 +498,7 @@ static void getBoundRect( sal_uInt32 nPoints, const SalPoint *pPtAry,
static SalColor ImplGetROPSalColor( SalROPColor nROPColor )
{
SalColor nSalColor;
- if ( nROPColor == SAL_ROP_0 )
+ if ( nROPColor == SalROPColor::N0 )
{
nSalColor = MAKE_SALCOLOR( 0, 0, 0 );
}
diff --git a/vcl/source/outdev/outdevstate.cxx b/vcl/source/outdev/outdevstate.cxx
index 99ec55b..7a8a73c 100644
--- a/vcl/source/outdev/outdevstate.cxx
+++ b/vcl/source/outdev/outdevstate.cxx
@@ -577,11 +577,11 @@ void OutputDevice::InitLineColor()
if( mbLineColor )
{
if( ROP_0 == meRasterOp )
- mpGraphics->SetROPLineColor( SAL_ROP_0 );
+ mpGraphics->SetROPLineColor( SalROPColor::N0 );
else if( ROP_1 == meRasterOp )
- mpGraphics->SetROPLineColor( SAL_ROP_1 );
+ mpGraphics->SetROPLineColor( SalROPColor::N1 );
else if( ROP_INVERT == meRasterOp )
- mpGraphics->SetROPLineColor( SAL_ROP_INVERT );
+ mpGraphics->SetROPLineColor( SalROPColor::Invert );
else
mpGraphics->SetLineColor( ImplColorToSal( maLineColor ) );
}
@@ -599,11 +599,11 @@ void OutputDevice::InitFillColor()
if( mbFillColor )
{
if( ROP_0 == meRasterOp )
- mpGraphics->SetROPFillColor( SAL_ROP_0 );
+ mpGraphics->SetROPFillColor( SalROPColor::N0 );
else if( ROP_1 == meRasterOp )
- mpGraphics->SetROPFillColor( SAL_ROP_1 );
+ mpGraphics->SetROPFillColor( SalROPColor::N1 );
else if( ROP_INVERT == meRasterOp )
- mpGraphics->SetROPFillColor( SAL_ROP_INVERT );
+ mpGraphics->SetROPFillColor( SalROPColor::Invert );
else
mpGraphics->SetFillColor( ImplColorToSal( maFillColor ) );
}
diff --git a/vcl/unx/generic/gdi/gdiimpl.cxx b/vcl/unx/generic/gdi/gdiimpl.cxx
index 02f9325..1eda18a 100644
--- a/vcl/unx/generic/gdi/gdiimpl.cxx
+++ b/vcl/unx/generic/gdi/gdiimpl.cxx
@@ -1158,13 +1158,13 @@ void X11SalGraphicsImpl::SetROPLineColor( SalROPColor nROPColor )
{
switch( nROPColor )
{
- case SAL_ROP_0 : // 0
+ case SalROPColor::N0 : // 0
mnPenPixel = (Pixel)0;
break;
- case SAL_ROP_1 : // 1
+ case SalROPColor::N1 : // 1
mnPenPixel = (Pixel)(1 << mrParent.GetVisual().GetDepth()) - 1;
break;
- case SAL_ROP_INVERT : // 2
+ case SalROPColor::Invert : // 2
mnPenPixel = (Pixel)(1 << mrParent.GetVisual().GetDepth()) - 1;
break;
}
@@ -1176,13 +1176,13 @@ void X11SalGraphicsImpl::SetROPFillColor( SalROPColor nROPColor )
{
switch( nROPColor )
{
- case SAL_ROP_0 : // 0
+ case SalROPColor::N0 : // 0
mnBrushPixel = (Pixel)0;
break;
- case SAL_ROP_1 : // 1
+ case SalROPColor::N1 : // 1
mnBrushPixel = (Pixel)(1 << mrParent.GetVisual().GetDepth()) - 1;
break;
- case SAL_ROP_INVERT : // 2
+ case SalROPColor::Invert : // 2
mnBrushPixel = (Pixel)(1 << mrParent.GetVisual().GetDepth()) - 1;
break;
}
diff --git a/vcl/win/gdi/gdiimpl.cxx b/vcl/win/gdi/gdiimpl.cxx
index bd03594..6eebc7a9 100644
--- a/vcl/win/gdi/gdiimpl.cxx
+++ b/vcl/win/gdi/gdiimpl.cxx
@@ -225,7 +225,7 @@ static BYTE aOrdDither16Bit[8][8] =
SalColor ImplGetROPSalColor( SalROPColor nROPColor )
{
SalColor nSalColor;
- if ( nROPColor == SAL_ROP_0 )
+ if ( nROPColor == SalROPColor::N0 )
nSalColor = MAKE_SALCOLOR( 0, 0, 0 );
else
nSalColor = MAKE_SALCOLOR( 255, 255, 255 );
More information about the Libreoffice-commits
mailing list