diff options
author | Noel Grandin <noel@peralex.com> | 2014-12-30 16:26:11 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2015-01-06 10:59:43 +0200 |
commit | abe670157b69aa7fe4b478f1fd13757d7b7fcc4b (patch) | |
tree | aa3fbd80e0fbc9ac3d1674d37c0fcb01ffa595f5 /svtools | |
parent | a48d8465c3f9f36a02fb3c6a79f5dbb5851174f7 (diff) |
fdo#84938: convert CTRL_STATE_ #defines to 'enum class'
Change-Id: I1451180d258315a310a048b27510b4b58fa9145c
Diffstat (limited to 'svtools')
-rw-r--r-- | svtools/source/contnr/svimpbox.cxx | 2 | ||||
-rw-r--r-- | svtools/source/contnr/svlbitm.cxx | 10 | ||||
-rw-r--r-- | svtools/source/contnr/treelistbox.cxx | 4 | ||||
-rw-r--r-- | svtools/source/control/headbar.cxx | 10 | ||||
-rw-r--r-- | svtools/source/control/tabbar.cxx | 2 | ||||
-rw-r--r-- | svtools/source/control/toolbarmenu.cxx | 18 | ||||
-rw-r--r-- | svtools/source/toolpanel/paneltabbar.cxx | 10 |
7 files changed, 28 insertions, 28 deletions
diff --git a/svtools/source/contnr/svimpbox.cxx b/svtools/source/contnr/svimpbox.cxx index 0162b97c739a..f014b6fb1c29 100644 --- a/svtools/source/contnr/svimpbox.cxx +++ b/svtools/source/contnr/svimpbox.cxx @@ -1055,7 +1055,7 @@ void SvImpLBox::DrawNet() ImplControlValue aControlValue; Point aTemp(0,0); // temporary needed for g++ 3.3.5 Rectangle aCtrlRegion( aTemp, Size( 0, 0 ) ); - ControlState nState = CTRL_STATE_ENABLED; + ControlState nState = ControlState::ENABLED; if( pView->DrawNativeControl( CTRL_LISTNET, PART_ENTIRE_CONTROL, aCtrlRegion, nState, aControlValue, OUString() ) ) { diff --git a/svtools/source/contnr/svlbitm.cxx b/svtools/source/contnr/svlbitm.cxx index 014a36a448ef..2e88f578d4de 100644 --- a/svtools/source/contnr/svlbitm.cxx +++ b/svtools/source/contnr/svlbitm.cxx @@ -362,11 +362,11 @@ void SvLBoxButton::Paint( ImplAdjustBoxSize( aSize, eCtrlType, &rDev ); ImplControlValue aControlValue; Rectangle aCtrlRegion( rPos, aSize ); - ControlState nState = 0; + ControlState nState = ControlState::NONE; - //states CTRL_STATE_DEFAULT, CTRL_STATE_PRESSED and CTRL_STATE_ROLLOVER are not implemented - if ( IsStateHilighted() ) nState |= CTRL_STATE_FOCUSED; - if ( nStyle != IMAGE_DRAW_DISABLE ) nState |= CTRL_STATE_ENABLED; + //states ControlState::DEFAULT, ControlState::PRESSED and ControlState::ROLLOVER are not implemented + if ( IsStateHilighted() ) nState |= ControlState::FOCUSED; + if ( nStyle != IMAGE_DRAW_DISABLE ) nState |= ControlState::ENABLED; if ( IsStateChecked() ) aControlValue.setTristateVal( BUTTONVALUE_ON ); @@ -400,7 +400,7 @@ void SvLBoxButton::ImplAdjustBoxSize( Size& io_rSize, ControlType i_eType, vcl:: { ImplControlValue aControlValue; Rectangle aCtrlRegion( Point( 0, 0 ), io_rSize ); - ControlState nState = CTRL_STATE_ENABLED; + ControlState nState = ControlState::ENABLED; aControlValue.setTristateVal( BUTTONVALUE_ON ); diff --git a/svtools/source/contnr/treelistbox.cxx b/svtools/source/contnr/treelistbox.cxx index 5591635bda0c..e9c00302fb32 100644 --- a/svtools/source/contnr/treelistbox.cxx +++ b/svtools/source/contnr/treelistbox.cxx @@ -3156,9 +3156,9 @@ long SvTreeListBox::PaintEntry1(SvTreeListEntry* pEntry,long nLine,sal_uInt16 nT { ImplControlValue aControlValue; Rectangle aCtrlRegion( aPos, pImg->GetSizePixel() ); - ControlState nState = 0; + ControlState nState = ControlState::NONE; - if ( IsEnabled() ) nState |= CTRL_STATE_ENABLED; + if ( IsEnabled() ) nState |= ControlState::ENABLED; if ( IsExpanded(pEntry) ) aControlValue.setTristateVal( BUTTONVALUE_ON );//expanded node diff --git a/svtools/source/control/headbar.cxx b/svtools/source/control/headbar.cxx index 8f3c2626287b..e3d455413e55 100644 --- a/svtools/source/control/headbar.cxx +++ b/svtools/source/control/headbar.cxx @@ -306,7 +306,7 @@ void HeaderBar::ImplDrawItem( OutputDevice* pDev, vcl::Window *const pWin = (pDev->GetOutDevType()==OUTDEV_WINDOW) ? static_cast<vcl::Window*>(pDev) : NULL; ImplControlValue aControlValue(0); Rectangle aCtrlRegion; - ControlState nState(0); + ControlState nState(ControlState::NONE); Rectangle aRect = rItemRect; @@ -368,9 +368,9 @@ void HeaderBar::ImplDrawItem( OutputDevice* pDev, { aCtrlRegion=aRect; aControlValue.setTristateVal(BUTTONVALUE_ON); - nState|=CTRL_STATE_ENABLED; + nState|=ControlState::ENABLED; if(bHigh) - nState|=CTRL_STATE_PRESSED; + nState|=ControlState::PRESSED; pWin->DrawNativeControl( CTRL_LISTHEADER, PART_BUTTON, aCtrlRegion, nState, aControlValue, OUString() ); @@ -593,9 +593,9 @@ void HeaderBar::ImplDrawItem( OutputDevice* pDev, aCtrlRegion=Rectangle(Point(nArrowX,aRect.Top()),Size(nArrowWidth,aRect.GetHeight())); // control value passes 1 if arrow points down, 0 otherwise aControlValue.setNumericVal((nBits&HIB_DOWNARROW)?1:0); - nState|=CTRL_STATE_ENABLED; + nState|=ControlState::ENABLED; if(bHigh) - nState|=CTRL_STATE_PRESSED; + nState|=ControlState::PRESSED; pWin->DrawNativeControl( CTRL_LISTHEADER, PART_ARROW, aCtrlRegion, nState, aControlValue, OUString() ); diff --git a/svtools/source/control/tabbar.cxx b/svtools/source/control/tabbar.cxx index d55a3cbbee66..27614954a535 100644 --- a/svtools/source/control/tabbar.cxx +++ b/svtools/source/control/tabbar.cxx @@ -1282,7 +1282,7 @@ void TabBar::Paint( const Rectangle& rect ) { if(IsNativeControlSupported(CTRL_WINDOW_BACKGROUND,PART_ENTIRE_CONTROL)) DrawNativeControl(CTRL_WINDOW_BACKGROUND,PART_ENTIRE_CONTROL,rect, - CTRL_STATE_ENABLED,ImplControlValue(0),OUString()); + ControlState::ENABLED,ImplControlValue(0),OUString()); // calculate items and emit sal_uInt16 nItemCount = (sal_uInt16)mpItemList->size(); diff --git a/svtools/source/control/toolbarmenu.cxx b/svtools/source/control/toolbarmenu.cxx index 85e73bbbc381..825221de53be 100644 --- a/svtools/source/control/toolbarmenu.cxx +++ b/svtools/source/control/toolbarmenu.cxx @@ -586,7 +586,7 @@ static long ImplGetNativeCheckAndRadioSize( vcl::Window* pWin, long& rCheckHeigh if( pWin->GetNativeControlRegion( ControlType(CTRL_MENU_POPUP), ControlPart(PART_MENU_ITEM_CHECK_MARK), aCtrlRegion, - ControlState(CTRL_STATE_ENABLED), + ControlState(ControlState::ENABLED), aVal, OUString(), aNativeBounds, @@ -602,7 +602,7 @@ static long ImplGetNativeCheckAndRadioSize( vcl::Window* pWin, long& rCheckHeigh if( pWin->GetNativeControlRegion( ControlType(CTRL_MENU_POPUP), ControlPart(PART_MENU_ITEM_RADIO_MARK), aCtrlRegion, - ControlState(CTRL_STATE_ENABLED), + ControlState(ControlState::ENABLED), aVal, OUString(), aNativeBounds, @@ -896,7 +896,7 @@ void ToolbarMenu::implHighlightEntry( int nHighlightEntry, bool bHighlight ) Rectangle aCtrlRect( Point( nX, 0 ), Size( aPxSize.Width()-nX, aPxSize.Height() ) ); DrawNativeControl( CTRL_MENU_POPUP, PART_ENTIRE_CONTROL, aCtrlRect, - CTRL_STATE_ENABLED, + ControlState::ENABLED, ImplControlValue(), OUString() ); if( bHighlight && IsNativeControlSupported( CTRL_MENU_POPUP, PART_MENU_ITEM ) ) @@ -904,7 +904,7 @@ void ToolbarMenu::implHighlightEntry( int nHighlightEntry, bool bHighlight ) bDrawItemRect = false; if( !DrawNativeControl( CTRL_MENU_POPUP, PART_MENU_ITEM, aItemRect, - CTRL_STATE_SELECTED | ( pEntry->mbEnabled? CTRL_STATE_ENABLED: 0 ), + ControlState::SELECTED | ( pEntry->mbEnabled ? ControlState::ENABLED : ControlState::NONE ), ImplControlValue(), OUString() ) ) { @@ -1277,7 +1277,7 @@ static void ImplPaintCheckBackground( vcl::Window* i_pWindow, const Rectangle& i if( i_pWindow->IsNativeControlSupported( CTRL_TOOLBAR, PART_BUTTON ) ) { ImplControlValue aControlValue; - ControlState nState = CTRL_STATE_PRESSED | CTRL_STATE_ENABLED; + ControlState nState = ControlState::PRESSED | ControlState::ENABLED; aControlValue.setTristateVal( BUTTONVALUE_ON ); @@ -1396,16 +1396,16 @@ void ToolbarMenu::implPaint( ToolbarMenuEntry* pThisOnly, bool bHighlighted ) ? PART_MENU_ITEM_RADIO_MARK : PART_MENU_ITEM_CHECK_MARK); - ControlState nState = 0; + ControlState nState = ControlState::NONE; if ( pEntry->mbChecked ) - nState |= CTRL_STATE_PRESSED; + nState |= ControlState::PRESSED; if ( pEntry->mbEnabled ) - nState |= CTRL_STATE_ENABLED; + nState |= ControlState::ENABLED; if ( bHighlighted ) - nState |= CTRL_STATE_SELECTED; + nState |= ControlState::SELECTED; long nCtrlHeight = (pEntry->mnBits & MenuItemBits::RADIOCHECK) ? nCheckHeight : nRadioHeight; aTmpPos.X() = aOuterCheckRect.Left() + (aOuterCheckRect.GetWidth() - nCtrlHeight)/2; diff --git a/svtools/source/toolpanel/paneltabbar.cxx b/svtools/source/toolpanel/paneltabbar.cxx index 302d58e4c22b..d8813475f84d 100644 --- a/svtools/source/toolpanel/paneltabbar.cxx +++ b/svtools/source/toolpanel/paneltabbar.cxx @@ -67,10 +67,10 @@ namespace svt { ControlState lcl_ItemToControlState( const ItemFlags i_nItemFlags ) { - ControlState nState = CTRL_STATE_ENABLED; - if ( i_nItemFlags & ITEM_STATE_FOCUSED ) nState |= CTRL_STATE_FOCUSED | CTRL_STATE_PRESSED; - if ( i_nItemFlags & ITEM_STATE_HOVERED ) nState |= CTRL_STATE_ROLLOVER; - if ( i_nItemFlags & ITEM_STATE_ACTIVE ) nState |= CTRL_STATE_SELECTED; + ControlState nState = ControlState::ENABLED; + if ( i_nItemFlags & ITEM_STATE_FOCUSED ) nState |= ControlState::FOCUSED | ControlState::PRESSED; + if ( i_nItemFlags & ITEM_STATE_HOVERED ) nState |= ControlState::ROLLOVER; + if ( i_nItemFlags & ITEM_STATE_ACTIVE ) nState |= ControlState::SELECTED; return nState; } } @@ -288,7 +288,7 @@ namespace svt aBackground.Top() = aBackground.Bottom(); getTargetDevice().DrawNativeControl( CTRL_TAB_PANE, PART_ENTIRE_CONTROL, aBackground, - CTRL_STATE_ENABLED, ImplControlValue(), OUString() ); + ControlState::ENABLED, ImplControlValue(), OUString() ); } |