From bae855e667993ea6cddd551452c6e2fa60bdc2f3 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Sat, 20 Dec 2014 16:21:21 +0200 Subject: fdo#84938: replace BUTTONTYPE_ constants with 'enum class' Change-Id: I54f9019297913683605b5aea9f79b3defc1dcc13 --- vcl/source/window/toolbox.cxx | 12 ++++++------ vcl/source/window/toolbox2.cxx | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-) (limited to 'vcl') diff --git a/vcl/source/window/toolbox.cxx b/vcl/source/window/toolbox.cxx index 490feac7f767..5816fe333970 100644 --- a/vcl/source/window/toolbox.cxx +++ b/vcl/source/window/toolbox.cxx @@ -169,11 +169,11 @@ ButtonType determineButtonType( ImplToolItem* pItem, ButtonType defaultType ) ButtonType tmpButtonType = defaultType; if ( pItem->mnBits & (ToolBoxItemBits::TEXT_ONLY | ToolBoxItemBits::ICON_ONLY) ) // item has custom setting { - tmpButtonType = BUTTON_SYMBOLTEXT; + tmpButtonType = ButtonType::SYMBOLTEXT; if ( pItem->mnBits & ToolBoxItemBits::TEXT_ONLY ) - tmpButtonType = BUTTON_TEXT; + tmpButtonType = ButtonType::TEXT; else if ( pItem->mnBits & ToolBoxItemBits::ICON_ONLY ) - tmpButtonType = BUTTON_SYMBOL; + tmpButtonType = ButtonType::SYMBOLONLY; } return tmpButtonType; } @@ -1398,7 +1398,7 @@ void ToolBox::ImplInit( vcl::Window* pParent, WinBits nStyle ) mbIsShift = false; mbIsKeyEvent = false; mbChangingHighlight = false; - meButtonType = BUTTON_SYMBOL; + meButtonType = ButtonType::SYMBOLONLY; meAlign = WINDOWALIGN_TOP; meLastStyle = POINTER_ARROW; mnWinStyle = nStyle; @@ -1755,7 +1755,7 @@ bool ToolBox::ImplCalcItem() it->mbEmptyBtn = false; - if ( tmpButtonType == BUTTON_SYMBOL ) + if ( tmpButtonType == ButtonType::SYMBOLONLY ) { // we're drawing images only if ( bImage || !bText ) @@ -1769,7 +1769,7 @@ bool ToolBox::ImplCalcItem() it->mbVisibleText = true; } } - else if ( tmpButtonType == BUTTON_TEXT ) + else if ( tmpButtonType == ButtonType::TEXT ) { // we're drawing text only if ( bText || !bImage ) diff --git a/vcl/source/window/toolbox2.cxx b/vcl/source/window/toolbox2.cxx index 938a93223025..c1f4e0581b3d 100644 --- a/vcl/source/window/toolbox2.cxx +++ b/vcl/source/window/toolbox2.cxx @@ -282,7 +282,7 @@ void ImplToolItem::DetermineButtonDrawStyle( ButtonType eButtonType, bool& rbIma // prefer images if symbolonly buttons are drawn // prefer texts if textonly buttons are dreawn - if ( eButtonType == BUTTON_SYMBOL ) // drawing icons only + if ( eButtonType == ButtonType::SYMBOLONLY ) // drawing icons only { if( bHasImage || !bHasText ) { @@ -295,7 +295,7 @@ void ImplToolItem::DetermineButtonDrawStyle( ButtonType eButtonType, bool& rbIma rbText = true; } } - else if ( eButtonType == BUTTON_TEXT ) // drawing text only + else if ( eButtonType == ButtonType::TEXT ) // drawing text only { if( bHasText || !bHasImage ) { @@ -1270,7 +1270,7 @@ void ToolBox::SetItemText( sal_uInt16 nItemId, const OUString& rText ) ImplToolItem* pItem = &mpData->m_aItems[nPos]; // only once all is calculated, do extra work if ( !mbCalc && - ((meButtonType != BUTTON_SYMBOL) || !pItem->maImage) ) + ((meButtonType != ButtonType::SYMBOLONLY) || !pItem->maImage) ) { long nOldWidth = GetCtrlTextWidth( pItem->maText ); pItem->maText = ImplConvertMenuString( rText ); -- cgit v1.2.3