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

convert FRAME_HIGHLIGHT constants to scoped enum

Change-Id: I44bd2c54c8b1d6cafd7c15eaf0d77a336ac3fa65
üst 61eb53d3
......@@ -68,10 +68,11 @@ namespace o3tl
}
// Flags for DrawHighlightFrame()
#define FRAME_HIGHLIGHT_IN ((sal_uInt16)0x0001)
#define FRAME_HIGHLIGHT_OUT ((sal_uInt16)0x0002)
#define FRAME_HIGHLIGHT_TESTBACKGROUND ((sal_uInt16)0x4000)
#define FRAME_HIGHLIGHT_STYLE ((sal_uInt16)0x000F)
enum class DrawHighlightFrameStyle
{
In = 1,
Out = 2,
};
// Flags for DrawButton()
#define BUTTON_DRAW_DEFAULT ((sal_uInt16)0x0001)
......@@ -102,7 +103,7 @@ public:
const Color& rLeftTopColor,
const Color& rRightBottomColor );
void DrawHighlightFrame( const Rectangle& rRect,
sal_uInt16 nStyle = FRAME_HIGHLIGHT_OUT );
DrawHighlightFrameStyle nStyle = DrawHighlightFrameStyle::Out, bool bTestBackground = false );
Rectangle DrawFrame( const Rectangle& rRect, DrawFrameStyle nStyle = DrawFrameStyle::Out, DrawFrameFlags nFlags = DrawFrameFlags::NONE );
Rectangle DrawButton( const Rectangle& rRect, sal_uInt16 nStyle );
void DrawSeparator( const Point& rStart, const Point& rStop, bool bVertical = true );
......
......@@ -3574,12 +3574,12 @@ void SvxIconChoiceCtrl_Impl::DrawHighlightFrame(vcl::RenderContext& rRenderConte
else
{
DecorationView aDecoView(&rRenderContext);
sal_uInt16 nDecoFlags;
DrawHighlightFrameStyle nDecoFlags;
if (bHighlightFramePressed)
nDecoFlags = FRAME_HIGHLIGHT_TESTBACKGROUND | FRAME_HIGHLIGHT_IN;
nDecoFlags = DrawHighlightFrameStyle::In;
else
nDecoFlags = FRAME_HIGHLIGHT_TESTBACKGROUND | FRAME_HIGHLIGHT_OUT;
aDecoView.DrawHighlightFrame(aBmpRect, nDecoFlags);
nDecoFlags = DrawHighlightFrameStyle::Out;
aDecoView.DrawHighlightFrame(aBmpRect, nDecoFlags, true/*bTestBackground*/);
}
}
......
......@@ -889,7 +889,7 @@ void DecorationView::DrawFrame( const Rectangle& rRect,
}
void DecorationView::DrawHighlightFrame( const Rectangle& rRect,
sal_uInt16 nStyle )
DrawHighlightFrameStyle nStyle, bool bTestBackground )
{
const StyleSettings& rStyleSettings = mpOutDev->GetSettings().GetStyleSettings();
Color aLightColor = rStyleSettings.GetLightColor();
......@@ -901,7 +901,7 @@ void DecorationView::DrawHighlightFrame( const Rectangle& rRect,
aLightColor = Color( COL_BLACK );
aShadowColor = Color( COL_BLACK );
}
else if ( nStyle & FRAME_HIGHLIGHT_TESTBACKGROUND )
else if ( bTestBackground )
{
Wallpaper aBackground = mpOutDev->GetBackground();
if ( aBackground.IsBitmap() || aBackground.IsGradient() )
......@@ -926,7 +926,7 @@ void DecorationView::DrawHighlightFrame( const Rectangle& rRect,
}
}
if ( (nStyle & FRAME_HIGHLIGHT_STYLE) == FRAME_HIGHLIGHT_IN )
if ( nStyle == DrawHighlightFrameStyle::In )
{
Color aTempColor = aLightColor;
aLightColor = aShadowColor;
......
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