Kaydet (Commit) 27ff4496 authored tarafından Noel Grandin's avatar Noel Grandin

convert BKMODE #defines to 'enum class'

mostly to get the TRANSPARENT #define out of the global namespace

Change-Id: Iec592d26d4d12b5f30f7f9a04dd377a1fb20d643
üst 4cdce63d
...@@ -775,7 +775,7 @@ bool EnhWMFReader::ReadEnhWMF() ...@@ -775,7 +775,7 @@ bool EnhWMFReader::ReadEnhWMF()
case EMR_SETBKMODE : case EMR_SETBKMODE :
{ {
pWMF->ReadUInt32( nDat32 ); pWMF->ReadUInt32( nDat32 );
pOut->SetBkMode( nDat32 ); pOut->SetBkMode( static_cast<BkMode>(nDat32) );
} }
break; break;
......
...@@ -611,7 +611,7 @@ void WinMtfOutput::SetTextLayoutMode( ComplexTextLayoutMode nTextLayoutMode ) ...@@ -611,7 +611,7 @@ void WinMtfOutput::SetTextLayoutMode( ComplexTextLayoutMode nTextLayoutMode )
mnTextLayoutMode = nTextLayoutMode; mnTextLayoutMode = nTextLayoutMode;
} }
void WinMtfOutput::SetBkMode( sal_uInt32 nMode ) void WinMtfOutput::SetBkMode( BkMode nMode )
{ {
mnBkMode = nMode; mnBkMode = nMode;
} }
...@@ -803,8 +803,8 @@ WinMtfOutput::WinMtfOutput( GDIMetaFile& rGDIMetaFile ) : ...@@ -803,8 +803,8 @@ WinMtfOutput::WinMtfOutput( GDIMetaFile& rGDIMetaFile ) :
maBkColor ( COL_WHITE ), maBkColor ( COL_WHITE ),
mnLatestTextLayoutMode( TEXT_LAYOUT_DEFAULT ), mnLatestTextLayoutMode( TEXT_LAYOUT_DEFAULT ),
mnTextLayoutMode ( TEXT_LAYOUT_DEFAULT ), mnTextLayoutMode ( TEXT_LAYOUT_DEFAULT ),
mnLatestBkMode ( 0 ), mnLatestBkMode ( BkMode::NONE ),
mnBkMode ( OPAQUE ), mnBkMode ( BkMode::OPAQUE ),
meLatestRasterOp ( ROP_INVERT ), meLatestRasterOp ( ROP_INVERT ),
meRasterOp ( ROP_OVERPAINT ), meRasterOp ( ROP_OVERPAINT ),
maActPos ( Point() ), maActPos ( Point() ),
...@@ -907,7 +907,7 @@ void WinMtfOutput::UpdateLineStyle() ...@@ -907,7 +907,7 @@ void WinMtfOutput::UpdateLineStyle()
void WinMtfOutput::UpdateFillStyle() void WinMtfOutput::UpdateFillStyle()
{ {
if ( !mbFillStyleSelected ) // SJ: #i57205# taking care of bkcolor if no brush is selected 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 ) ) if (!( maLatestFillStyle == maFillStyle ) )
{ {
maLatestFillStyle = maFillStyle; maLatestFillStyle = maFillStyle;
...@@ -1398,7 +1398,7 @@ void WinMtfOutput::DrawText( Point& rPosition, OUString& rText, long* pDXArry, b ...@@ -1398,7 +1398,7 @@ void WinMtfOutput::DrawText( Point& rPosition, OUString& rText, long* pDXArry, b
aTmp.SetColor( maTextColor ); aTmp.SetColor( maTextColor );
aTmp.SetFillColor( maBkColor ); aTmp.SetFillColor( maBkColor );
if( mnBkMode == TRANSPARENT ) if( mnBkMode == BkMode::TRANSPARENT )
aTmp.SetTransparent( true ); aTmp.SetTransparent( true );
else else
aTmp.SetTransparent( false ); aTmp.SetTransparent( false );
......
...@@ -40,9 +40,13 @@ ...@@ -40,9 +40,13 @@
#define RGN_DIFF 4 #define RGN_DIFF 4
#define RGN_COPY 5 #define RGN_COPY 5
#define TRANSPARENT 1 enum class BkMode
#define OPAQUE 2 {
#define BKMODE_LAST 2 NONE = 0,
TRANSPARENT = 1,
OPAQUE = 2,
LAST = 2
};
/* xform stuff */ /* xform stuff */
#define MWT_IDENTITY 1 #define MWT_IDENTITY 1
...@@ -471,7 +475,8 @@ struct XForm ...@@ -471,7 +475,8 @@ struct XForm
struct SaveStruct struct SaveStruct
{ {
sal_uInt32 nBkMode, nMapMode, nGfxMode; BkMode nBkMode;
sal_uInt32 nMapMode, nGfxMode;
ComplexTextLayoutMode nTextLayoutMode; ComplexTextLayoutMode nTextLayoutMode;
sal_Int32 nWinOrgX, nWinOrgY, nWinExtX, nWinExtY; sal_Int32 nWinOrgX, nWinOrgY, nWinExtX, nWinExtY;
sal_Int32 nDevOrgX, nDevOrgY, nDevWidth, nDevHeight; sal_Int32 nDevOrgX, nDevOrgY, nDevWidth, nDevHeight;
...@@ -596,8 +601,8 @@ class WinMtfOutput ...@@ -596,8 +601,8 @@ class WinMtfOutput
Color maBkColor; Color maBkColor;
ComplexTextLayoutMode mnLatestTextLayoutMode; ComplexTextLayoutMode mnLatestTextLayoutMode;
ComplexTextLayoutMode mnTextLayoutMode; ComplexTextLayoutMode mnTextLayoutMode;
sal_uInt32 mnLatestBkMode; BkMode mnLatestBkMode;
sal_uInt32 mnBkMode; BkMode mnBkMode;
RasterOp meLatestRasterOp; RasterOp meLatestRasterOp;
RasterOp meRasterOp; RasterOp meRasterOp;
...@@ -680,7 +685,7 @@ public: ...@@ -680,7 +685,7 @@ public:
void SetGfxMode( sal_Int32 nGfxMode ){ mnGfxMode = nGfxMode; }; void SetGfxMode( sal_Int32 nGfxMode ){ mnGfxMode = nGfxMode; };
sal_Int32 GetGfxMode() const { return mnGfxMode; }; sal_Int32 GetGfxMode() const { return mnGfxMode; };
void SetBkMode( sal_uInt32 nMode ); void SetBkMode( BkMode nMode );
void SetBkColor( const Color& rColor ); void SetBkColor( const Color& rColor );
void SetTextColor( const Color& rColor ); void SetTextColor( const Color& rColor );
void SetTextAlign( sal_uInt32 nAlign ); void SetTextAlign( sal_uInt32 nAlign );
......
...@@ -176,7 +176,7 @@ void WMFReader::ReadRecordParams( sal_uInt16 nFunc ) ...@@ -176,7 +176,7 @@ void WMFReader::ReadRecordParams( sal_uInt16 nFunc )
{ {
sal_uInt16 nDat = 0; sal_uInt16 nDat = 0;
pWMF->ReadUInt16( nDat ); pWMF->ReadUInt16( nDat );
pOut->SetBkMode( nDat ); pOut->SetBkMode( static_cast<BkMode>(nDat) );
} }
break; break;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment