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()
case EMR_SETBKMODE :
{
pWMF->ReadUInt32( nDat32 );
pOut->SetBkMode( nDat32 );
pOut->SetBkMode( static_cast<BkMode>(nDat32) );
}
break;
......
......@@ -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 );
......
......@@ -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 );
......
......@@ -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;
......
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