summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2014-10-09 14:48:01 +0300
committerNoel Grandin <noel@peralex.com>2014-10-09 14:49:53 +0300
commit27ff44965e60a56071d325bde62287a862a53ab7 (patch)
treed1a92ab09d3058ac7886d86c2fb3262e23e2d39c /vcl
parent4cdce63daf162709c3eff0f9c6c90ecc32109c21 (diff)
convert BKMODE #defines to 'enum class'
mostly to get the TRANSPARENT #define out of the global namespace Change-Id: Iec592d26d4d12b5f30f7f9a04dd377a1fb20d643
Diffstat (limited to 'vcl')
-rw-r--r--vcl/source/filter/wmf/enhwmf.cxx2
-rw-r--r--vcl/source/filter/wmf/winmtf.cxx10
-rw-r--r--vcl/source/filter/wmf/winmtf.hxx19
-rw-r--r--vcl/source/filter/wmf/winwmf.cxx2
4 files changed, 19 insertions, 14 deletions
diff --git a/vcl/source/filter/wmf/enhwmf.cxx b/vcl/source/filter/wmf/enhwmf.cxx
index 5b33913dc1ee..290437c8f9f4 100644
--- a/vcl/source/filter/wmf/enhwmf.cxx
+++ b/vcl/source/filter/wmf/enhwmf.cxx
@@ -775,7 +775,7 @@ bool EnhWMFReader::ReadEnhWMF()
case EMR_SETBKMODE :
{
pWMF->ReadUInt32( nDat32 );
- pOut->SetBkMode( nDat32 );
+ pOut->SetBkMode( static_cast<BkMode>(nDat32) );
}
break;
diff --git a/vcl/source/filter/wmf/winmtf.cxx b/vcl/source/filter/wmf/winmtf.cxx
index a6cddf1d9bf6..51535749746f 100644
--- a/vcl/source/filter/wmf/winmtf.cxx
+++ b/vcl/source/filter/wmf/winmtf.cxx
@@ -611,7 +611,7 @@ void WinMtfOutput::SetTextLayoutMode( ComplexTextLayoutMode nTextLayoutMode )
mnTextLayoutMode = nTextLayoutMode;
}
-void WinMtfOutput::SetBkMode( sal_uInt32 nMode )
+void WinMtfOutput::SetBkMode( BkMode nMode )
{
mnBkMode = nMode;
}
@@ -803,8 +803,8 @@ WinMtfOutput::WinMtfOutput( GDIMetaFile& rGDIMetaFile ) :
maBkColor ( COL_WHITE ),
mnLatestTextLayoutMode( TEXT_LAYOUT_DEFAULT ),
mnTextLayoutMode ( TEXT_LAYOUT_DEFAULT ),
- mnLatestBkMode ( 0 ),
- mnBkMode ( OPAQUE ),
+ mnLatestBkMode ( BkMode::NONE ),
+ mnBkMode ( BkMode::OPAQUE ),
meLatestRasterOp ( ROP_INVERT ),
meRasterOp ( ROP_OVERPAINT ),
maActPos ( Point() ),
@@ -907,7 +907,7 @@ void WinMtfOutput::UpdateLineStyle()
void WinMtfOutput::UpdateFillStyle()
{
if ( !mbFillStyleSelected ) // SJ: #i57205# taking care of bkcolor if no brush is selected
- maFillStyle = WinMtfFillStyle( maBkColor, mnBkMode == TRANSPARENT );
+ maFillStyle = WinMtfFillStyle( maBkColor, mnBkMode == BkMode::TRANSPARENT );
if (!( maLatestFillStyle == maFillStyle ) )
{
maLatestFillStyle = maFillStyle;
@@ -1398,7 +1398,7 @@ void WinMtfOutput::DrawText( Point& rPosition, OUString& rText, long* pDXArry, b
aTmp.SetColor( maTextColor );
aTmp.SetFillColor( maBkColor );
- if( mnBkMode == TRANSPARENT )
+ if( mnBkMode == BkMode::TRANSPARENT )
aTmp.SetTransparent( true );
else
aTmp.SetTransparent( false );
diff --git a/vcl/source/filter/wmf/winmtf.hxx b/vcl/source/filter/wmf/winmtf.hxx
index 2989556b41a1..8eae6155977c 100644
--- a/vcl/source/filter/wmf/winmtf.hxx
+++ b/vcl/source/filter/wmf/winmtf.hxx
@@ -40,9 +40,13 @@
#define RGN_DIFF 4
#define RGN_COPY 5
-#define TRANSPARENT 1
-#define OPAQUE 2
-#define BKMODE_LAST 2
+enum class BkMode
+{
+ NONE = 0,
+ TRANSPARENT = 1,
+ OPAQUE = 2,
+ LAST = 2
+};
/* xform stuff */
#define MWT_IDENTITY 1
@@ -471,7 +475,8 @@ struct XForm
struct SaveStruct
{
- sal_uInt32 nBkMode, nMapMode, nGfxMode;
+ BkMode nBkMode;
+ sal_uInt32 nMapMode, nGfxMode;
ComplexTextLayoutMode nTextLayoutMode;
sal_Int32 nWinOrgX, nWinOrgY, nWinExtX, nWinExtY;
sal_Int32 nDevOrgX, nDevOrgY, nDevWidth, nDevHeight;
@@ -596,8 +601,8 @@ class WinMtfOutput
Color maBkColor;
ComplexTextLayoutMode mnLatestTextLayoutMode;
ComplexTextLayoutMode mnTextLayoutMode;
- sal_uInt32 mnLatestBkMode;
- sal_uInt32 mnBkMode;
+ BkMode mnLatestBkMode;
+ BkMode mnBkMode;
RasterOp meLatestRasterOp;
RasterOp meRasterOp;
@@ -680,7 +685,7 @@ public:
void SetGfxMode( sal_Int32 nGfxMode ){ mnGfxMode = nGfxMode; };
sal_Int32 GetGfxMode() const { return mnGfxMode; };
- void SetBkMode( sal_uInt32 nMode );
+ void SetBkMode( BkMode nMode );
void SetBkColor( const Color& rColor );
void SetTextColor( const Color& rColor );
void SetTextAlign( sal_uInt32 nAlign );
diff --git a/vcl/source/filter/wmf/winwmf.cxx b/vcl/source/filter/wmf/winwmf.cxx
index 919e9f1caeb5..fa2dc1b43a53 100644
--- a/vcl/source/filter/wmf/winwmf.cxx
+++ b/vcl/source/filter/wmf/winwmf.cxx
@@ -176,7 +176,7 @@ void WMFReader::ReadRecordParams( sal_uInt16 nFunc )
{
sal_uInt16 nDat = 0;
pWMF->ReadUInt16( nDat );
- pOut->SetBkMode( nDat );
+ pOut->SetBkMode( static_cast<BkMode>(nDat) );
}
break;