summaryrefslogtreecommitdiff
path: root/vcl/source
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2014-10-20 09:10:45 +0200
committerNoel Grandin <noel@peralex.com>2014-10-21 09:06:40 +0200
commit182fc4f184b77330fdbb32096b64f5fbc5b5f874 (patch)
tree1ba73fb9188796ed43976fe32f291f9c64fb1d5b /vcl/source
parent43327878920f424f8bac1114bee51c54609796c5 (diff)
fdo#84938: replace WINDOW_BORDER constants with enum
Change-Id: I91ca8e09971aee26f16257a4fd01125cfb2ebcdb
Diffstat (limited to 'vcl/source')
-rw-r--r--vcl/source/control/combobox.cxx2
-rw-r--r--vcl/source/control/fixed.cxx2
-rw-r--r--vcl/source/control/imgctrl.cxx2
-rw-r--r--vcl/source/control/prgsbar.cxx2
-rw-r--r--vcl/source/window/brdwin.cxx24
-rw-r--r--vcl/source/window/menu.cxx4
-rw-r--r--vcl/source/window/resource.cxx2
-rw-r--r--vcl/source/window/window.cxx8
8 files changed, 23 insertions, 23 deletions
diff --git a/vcl/source/control/combobox.cxx b/vcl/source/control/combobox.cxx
index d03b32184b6f..b69e9fd5c8a9 100644
--- a/vcl/source/control/combobox.cxx
+++ b/vcl/source/control/combobox.cxx
@@ -1362,7 +1362,7 @@ Rectangle ComboBox::GetBoundingRectangle( sal_Int32 nItem ) const
return aRect;
}
-void ComboBox::SetBorderStyle( sal_uInt16 nBorderStyle )
+void ComboBox::SetBorderStyle( WindowBorderStyle nBorderStyle )
{
Window::SetBorderStyle( nBorderStyle );
if ( !IsDropDownBox() )
diff --git a/vcl/source/control/fixed.cxx b/vcl/source/control/fixed.cxx
index d7a0f8d82bc3..a0d3da11eccd 100644
--- a/vcl/source/control/fixed.cxx
+++ b/vcl/source/control/fixed.cxx
@@ -467,7 +467,7 @@ SelectableFixedText::SelectableFixedText(vcl::Window* pParent, WinBits nStyle)
: Edit(pParent, nStyle)
{
// no border
- SetBorderStyle( WINDOW_BORDER_NOBORDER );
+ SetBorderStyle( WindowBorderStyle::NOBORDER );
// read-only
SetReadOnly();
// make it transparent
diff --git a/vcl/source/control/imgctrl.cxx b/vcl/source/control/imgctrl.cxx
index 6a8082fb5de2..efd64c825d68 100644
--- a/vcl/source/control/imgctrl.cxx
+++ b/vcl/source/control/imgctrl.cxx
@@ -139,7 +139,7 @@ void ImageControl::Paint( const Rectangle& /*rRect*/ )
{
vcl::Window *pWin = GetWindow( WINDOW_BORDER );
- bool bFlat = (GetBorderStyle() == 2);
+ bool bFlat = (GetBorderStyle() == WindowBorderStyle::MONO);
Rectangle aRect( Point(0,0), pWin->GetOutputSizePixel() );
Color oldLineCol = pWin->GetLineColor();
Color oldFillCol = pWin->GetFillColor();
diff --git a/vcl/source/control/prgsbar.cxx b/vcl/source/control/prgsbar.cxx
index 1536f9336b09..4dc523c8aafb 100644
--- a/vcl/source/control/prgsbar.cxx
+++ b/vcl/source/control/prgsbar.cxx
@@ -82,7 +82,7 @@ void ProgressBar::ImplInitSettings( bool bFont,
IsNativeControlSupported( CTRL_PROGRESS, PART_ENTIRE_CONTROL ) )
{
if( (GetStyle() & WB_BORDER) )
- SetBorderStyle( WINDOW_BORDER_REMOVEBORDER );
+ SetBorderStyle( WindowBorderStyle::REMOVEBORDER );
EnableChildTransparentMode( true );
SetPaintTransparent( true );
SetBackground();
diff --git a/vcl/source/window/brdwin.cxx b/vcl/source/window/brdwin.cxx
index 579c2ee44045..182302dd6679 100644
--- a/vcl/source/window/brdwin.cxx
+++ b/vcl/source/window/brdwin.cxx
@@ -1023,8 +1023,8 @@ void ImplSmallBorderWindowView::Init( OutputDevice* pDev, long nWidth, long nHei
long nOrigRightBorder = mnRightBorder;
long nOrigBottomBorder = mnBottomBorder;
- sal_uInt16 nBorderStyle = mpBorderWindow->GetBorderStyle();
- if ( nBorderStyle & WINDOW_BORDER_NOBORDER )
+ WindowBorderStyle nBorderStyle = mpBorderWindow->GetBorderStyle();
+ if ( nBorderStyle & WindowBorderStyle::NOBORDER )
{
mnLeftBorder = 0;
mnTopBorder = 0;
@@ -1035,7 +1035,7 @@ void ImplSmallBorderWindowView::Init( OutputDevice* pDev, long nWidth, long nHei
{
// FIXME: this is currently only on OS X, check with other
// platforms
- if( ImplGetSVData()->maNWFData.mbNoFocusRects && !( nBorderStyle & WINDOW_BORDER_NWF ) )
+ if( ImplGetSVData()->maNWFData.mbNoFocusRects && !( nBorderStyle & WindowBorderStyle::NWF ) )
{
// for native widget drawing we must find out what
// control this border belongs to
@@ -1132,11 +1132,11 @@ void ImplSmallBorderWindowView::Init( OutputDevice* pDev, long nWidth, long nHei
// move border outside if border was converted or if the BorderWindow is a frame window,
if ( mpBorderWindow->mbSmallOutBorder )
nStyle |= FRAME_DRAW_DOUBLEOUT;
- else if ( nBorderStyle & WINDOW_BORDER_NWF )
+ else if ( nBorderStyle & WindowBorderStyle::NWF )
nStyle |= FRAME_DRAW_NWF;
else
nStyle |= FRAME_DRAW_DOUBLEIN;
- if ( nBorderStyle & WINDOW_BORDER_MONO )
+ if ( nBorderStyle & WindowBorderStyle::MONO )
nStyle |= FRAME_DRAW_MONO;
DecorationView aDecoView( mpOutDev );
@@ -1179,8 +1179,8 @@ long ImplSmallBorderWindowView::CalcTitleWidth() const
void ImplSmallBorderWindowView::DrawWindow( sal_uInt16 nDrawFlags, OutputDevice*, const Point* )
{
- sal_uInt16 nBorderStyle = mpBorderWindow->GetBorderStyle();
- if ( nBorderStyle & WINDOW_BORDER_NOBORDER )
+ WindowBorderStyle nBorderStyle = mpBorderWindow->GetBorderStyle();
+ if ( nBorderStyle & WindowBorderStyle::NOBORDER )
return;
bool bNativeOK = false;
@@ -1318,13 +1318,13 @@ void ImplSmallBorderWindowView::DrawWindow( sal_uInt16 nDrawFlags, OutputDevice*
// move border outside if border was converted or if the border window is a frame window,
if ( mpBorderWindow->mbSmallOutBorder )
nStyle |= FRAME_DRAW_DOUBLEOUT;
- else if ( nBorderStyle & WINDOW_BORDER_NWF )
+ else if ( nBorderStyle & WindowBorderStyle::NWF )
nStyle |= FRAME_DRAW_NWF;
else
nStyle |= FRAME_DRAW_DOUBLEIN;
- if ( nBorderStyle & WINDOW_BORDER_MONO )
+ if ( nBorderStyle & WindowBorderStyle::MONO )
nStyle |= FRAME_DRAW_MONO;
- if ( nBorderStyle & WINDOW_BORDER_MENU )
+ if ( nBorderStyle & WindowBorderStyle::MENU )
nStyle |= FRAME_DRAW_MENU;
// tell DrawFrame that we're drawing a window border of a frame window to avoid round corners
if( pWin && pWin == pWin->ImplGetFrameWindow() )
@@ -1825,7 +1825,7 @@ void ImplBorderWindow::ImplInit( vcl::Window* pParent,
mnTitleType = BORDERWINDOW_TITLE_SMALL;
else
mnTitleType = BORDERWINDOW_TITLE_NORMAL;
- mnBorderStyle = WINDOW_BORDER_NORMAL;
+ mnBorderStyle = WindowBorderStyle::NORMAL;
InitView();
}
@@ -2104,7 +2104,7 @@ void ImplBorderWindow::SetTitleType( sal_uInt16 nTitleType, const Size& rSize )
UpdateView( false, rSize );
}
-void ImplBorderWindow::SetBorderStyle( sal_uInt16 nStyle )
+void ImplBorderWindow::SetBorderStyle( WindowBorderStyle nStyle )
{
if ( !mbFrameBorder && (mnBorderStyle != nStyle) )
{
diff --git a/vcl/source/window/menu.cxx b/vcl/source/window/menu.cxx
index f9517694daa4..0f15f99e5e85 100644
--- a/vcl/source/window/menu.cxx
+++ b/vcl/source/window/menu.cxx
@@ -2880,9 +2880,9 @@ sal_uInt16 PopupMenu::ImplExecute( vcl::Window* pW, const Rectangle& rRect, sal_
MenuFloatingWindow* pWin = new MenuFloatingWindow( this, pW, nStyle | WB_SYSTEMWINDOW );
if( pSVData->maNWFData.mbFlatMenu )
- pWin->SetBorderStyle( WINDOW_BORDER_NOBORDER );
+ pWin->SetBorderStyle( WindowBorderStyle::NOBORDER );
else
- pWin->SetBorderStyle( pWin->GetBorderStyle() | WINDOW_BORDER_MENU );
+ pWin->SetBorderStyle( pWin->GetBorderStyle() | WindowBorderStyle::MENU );
pWindow = pWin;
Size aSz = ImplCalcSize( pWin );
diff --git a/vcl/source/window/resource.cxx b/vcl/source/window/resource.cxx
index 1bd7da5fc4cf..abcc150b7cb4 100644
--- a/vcl/source/window/resource.cxx
+++ b/vcl/source/window/resource.cxx
@@ -153,7 +153,7 @@ void Window::ImplLoadRes( const ResId& rResId )
if ( nObjMask & WINDOW_BORDER_STYLE )
{
sal_uInt16 nBorderStyle = (sal_uInt16)ReadLongRes();
- SetBorderStyle( nBorderStyle );
+ SetBorderStyle( static_cast<WindowBorderStyle>(nBorderStyle) );
}
}
diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx
index 57b7a4b51c07..f773bc2a5f05 100644
--- a/vcl/source/window/window.cxx
+++ b/vcl/source/window/window.cxx
@@ -2053,12 +2053,12 @@ void Window::SetExtendedStyle( WinBits nExtendedStyle )
}
}
-void Window::SetBorderStyle( sal_uInt16 nBorderStyle )
+void Window::SetBorderStyle( WindowBorderStyle nBorderStyle )
{
if ( mpWindowImpl->mpBorderWindow )
{
- if( nBorderStyle == WINDOW_BORDER_REMOVEBORDER &&
+ if( nBorderStyle == WindowBorderStyle::REMOVEBORDER &&
! mpWindowImpl->mpBorderWindow->mpWindowImpl->mbFrame &&
mpWindowImpl->mpBorderWindow->mpWindowImpl->mpParent
)
@@ -2093,7 +2093,7 @@ void Window::SetBorderStyle( sal_uInt16 nBorderStyle )
}
}
-sal_uInt16 Window::GetBorderStyle() const
+WindowBorderStyle Window::GetBorderStyle() const
{
if ( mpWindowImpl->mpBorderWindow )
@@ -2104,7 +2104,7 @@ sal_uInt16 Window::GetBorderStyle() const
return mpWindowImpl->mpBorderWindow->GetBorderStyle();
}
- return 0;
+ return WindowBorderStyle::NONE;
}
long Window::CalcTitleWidth() const