fdo#84938: replace TOOLBOXITEM_ constants with enum

Change-Id: I08c4a456f9e80f70719ca8c3ad5c0f0d2d8282f6
Reviewed-on: https://gerrit.libreoffice.org/12258
Tested-by: LibreOffice gerrit bot <gerrit@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
This commit is contained in:
Noel Grandin
2014-11-04 21:10:34 +02:00
committed by Noel Grandin
parent 705c48d32e
commit 3c58f07680
10 changed files with 52 additions and 52 deletions

View File

@@ -80,7 +80,7 @@ VCLXAccessibleToolBoxItem::VCLXAccessibleToolBoxItem( ToolBox* _pToolBox, sal_In
ToolBoxItemType eType = m_pToolBox->GetItemType( (sal_uInt16)m_nIndexInParent ); ToolBoxItemType eType = m_pToolBox->GetItemType( (sal_uInt16)m_nIndexInParent );
switch ( eType ) switch ( eType )
{ {
case TOOLBOXITEM_BUTTON : case ToolBoxItemType::BUTTON :
{ {
ToolBoxItemBits nBits = m_pToolBox->GetItemBits( m_nItemId ); ToolBoxItemBits nBits = m_pToolBox->GetItemBits( m_nItemId );
if ( if (
@@ -99,12 +99,12 @@ VCLXAccessibleToolBoxItem::VCLXAccessibleToolBoxItem( ToolBox* _pToolBox, sal_In
break; break;
} }
case TOOLBOXITEM_SPACE : case ToolBoxItemType::SPACE :
m_nRole = AccessibleRole::FILLER; m_nRole = AccessibleRole::FILLER;
break; break;
case TOOLBOXITEM_SEPARATOR : case ToolBoxItemType::SEPARATOR :
case TOOLBOXITEM_BREAK : case ToolBoxItemType::BREAK :
m_nRole = AccessibleRole::SEPARATOR; m_nRole = AccessibleRole::SEPARATOR;
break; break;

View File

@@ -357,7 +357,7 @@ namespace frm
for ( sal_uInt16 i=0; i<nItemCount; ++i ) for ( sal_uInt16 i=0; i<nItemCount; ++i )
{ {
sal_uInt16 nId = m_pToolbar->GetItemId( i ); sal_uInt16 nId = m_pToolbar->GetItemId( i );
if ( ( TOOLBOXITEM_BUTTON == m_pToolbar->GetItemType( i ) ) && !isArtificialItem( nId ) ) if ( ( ToolBoxItemType::BUTTON == m_pToolbar->GetItemType( i ) ) && !isArtificialItem( nId ) )
aFormFeatures.push_back( nId ); aFormFeatures.push_back( nId );
} }

View File

@@ -242,7 +242,7 @@ void AddonsToolBarManager::FillToolbar( const Sequence< Sequence< PropertyValue
if ( aURL == TOOLBOXITEM_SEPARATOR_STR ) if ( aURL == TOOLBOXITEM_SEPARATOR_STR )
{ {
sal_uInt16 nCount = m_pToolBar->GetItemCount(); sal_uInt16 nCount = m_pToolBar->GetItemCount();
if ( nCount > 0 && ( m_pToolBar->GetItemType( nCount-1 ) != TOOLBOXITEM_SEPARATOR ) && nElements > 0 ) if ( nCount > 0 && ( m_pToolBar->GetItemType( nCount-1 ) != ToolBoxItemType::SEPARATOR ) && nElements > 0 )
{ {
nElements = 0; nElements = 0;
m_pToolBar->InsertSeparator(); m_pToolBar->InsertSeparator();
@@ -251,7 +251,7 @@ void AddonsToolBarManager::FillToolbar( const Sequence< Sequence< PropertyValue
else else
{ {
sal_uInt16 nCount = m_pToolBar->GetItemCount(); sal_uInt16 nCount = m_pToolBar->GetItemCount();
if ( bAppendSeparator && nCount > 0 && ( m_pToolBar->GetItemType( nCount-1 ) != TOOLBOXITEM_SEPARATOR )) if ( bAppendSeparator && nCount > 0 && ( m_pToolBar->GetItemType( nCount-1 ) != ToolBoxItemType::SEPARATOR ))
{ {
// We have to append a separator first if the last item is not a separator // We have to append a separator first if the last item is not a separator
m_pToolBar->InsertSeparator(); m_pToolBar->InsertSeparator();

View File

@@ -1719,7 +1719,7 @@ bool ToolBarManager::MenuItemAllowed( sal_uInt16 ) const
for ( nPos = 0; nPos < m_pToolBar->GetItemCount(); ++nPos ) for ( nPos = 0; nPos < m_pToolBar->GetItemCount(); ++nPos )
{ {
if ( m_pToolBar->GetItemType(nPos) == TOOLBOXITEM_BUTTON ) if ( m_pToolBar->GetItemType(nPos) == ToolBoxItemType::BUTTON )
{ {
sal_uInt16 nId = m_pToolBar->GetItemId(nPos); sal_uInt16 nId = m_pToolBar->GetItemId(nPos);
OUString aCommandURL = m_pToolBar->GetItemCommand( nId ); OUString aCommandURL = m_pToolBar->GetItemCommand( nId );

View File

@@ -72,9 +72,7 @@ namespace o3tl
template<> struct typed_flags<ToolBoxItemBits> : is_typed_flags<ToolBoxItemBits, 0x3ff> {}; template<> struct typed_flags<ToolBoxItemBits> : is_typed_flags<ToolBoxItemBits, 0x3ff> {};
} }
enum ToolBoxItemType { TOOLBOXITEM_DONTKNOW, TOOLBOXITEM_BUTTON, enum class ToolBoxItemType { DONTKNOW, BUTTON, SPACE, SEPARATOR, BREAK };
TOOLBOXITEM_SPACE, TOOLBOXITEM_SEPARATOR,
TOOLBOXITEM_BREAK };
enum ButtonType { BUTTON_SYMBOL, BUTTON_TEXT, BUTTON_SYMBOLTEXT }; enum ButtonType { BUTTON_SYMBOL, BUTTON_TEXT, BUTTON_SYMBOLTEXT };

View File

@@ -42,6 +42,7 @@ enum class WindowBorderStyle : sal_Int16;
enum class TimeFieldFormat : sal_Int32; enum class TimeFieldFormat : sal_Int32;
enum class KeyFuncType : sal_Int32; enum class KeyFuncType : sal_Int32;
enum class MenuItemBits : sal_Int16; enum class MenuItemBits : sal_Int16;
enum class ToolBoxItemType;
struct WriteRcContext struct WriteRcContext
{ {
@@ -153,6 +154,7 @@ class RscTypCont
inline void SETCONST( RscConst *p1, const char * p2, TimeFieldFormat p3 ) { SETCONST(p1, p2, static_cast<sal_uInt32>(p3)); } inline void SETCONST( RscConst *p1, const char * p2, TimeFieldFormat p3 ) { SETCONST(p1, p2, static_cast<sal_uInt32>(p3)); }
inline void SETCONST( RscConst *p1, const char * p2, MenuItemBits p3 ) { SETCONST(p1, p2, static_cast<sal_uInt32>(p3)); } inline void SETCONST( RscConst *p1, const char * p2, MenuItemBits p3 ) { SETCONST(p1, p2, static_cast<sal_uInt32>(p3)); }
inline void SETCONST( RscConst *p1, Atom p2, MenuItemBits p3 ) { SETCONST(p1, p2, static_cast<sal_uInt32>(p3)); } inline void SETCONST( RscConst *p1, Atom p2, MenuItemBits p3 ) { SETCONST(p1, p2, static_cast<sal_uInt32>(p3)); }
inline void SETCONST( RscConst *p1, const char * p2, ToolBoxItemType p3 ) { SETCONST(p1, p2, static_cast<sal_uInt32>(p3)); }
RscEnum * InitLangType(); RscEnum * InitLangType();
RscEnum * InitFieldUnitsType(); RscEnum * InitFieldUnitsType();
RscEnum * InitTimeFieldFormat(); RscEnum * InitTimeFieldFormat();

View File

@@ -1290,10 +1290,10 @@ RscTop * RscTypCont::InitClassToolBoxItem( RscTop * pSuper,
RscEnum * pEnum; RscEnum * pEnum;
aBaseLst.push_back( pEnum = new RscEnum( pHS->getID( "EnumToolBoxItemType" ), RSC_NOTYPE ) ); aBaseLst.push_back( pEnum = new RscEnum( pHS->getID( "EnumToolBoxItemType" ), RSC_NOTYPE ) );
SETCONST( pEnum, "TOOLBOXITEM_BUTTON", TOOLBOXITEM_BUTTON ); SETCONST( pEnum, "TOOLBOXITEM_BUTTON", ToolBoxItemType::BUTTON );
SETCONST( pEnum, "TOOLBOXITEM_SPACE", TOOLBOXITEM_SPACE ); SETCONST( pEnum, "TOOLBOXITEM_SPACE", ToolBoxItemType::SPACE );
SETCONST( pEnum, "TOOLBOXITEM_SEPARATOR", TOOLBOXITEM_SEPARATOR ); SETCONST( pEnum, "TOOLBOXITEM_SEPARATOR", ToolBoxItemType::SEPARATOR );
SETCONST( pEnum, "TOOLBOXITEM_BREAK", TOOLBOXITEM_BREAK ); SETCONST( pEnum, "TOOLBOXITEM_BREAK", ToolBoxItemType::BREAK );
// Variable einfuegen // Variable einfuegen
nId = aNmTb.Put( "Type", VARNAME ); nId = aNmTb.Put( "Type", VARNAME );

View File

@@ -211,7 +211,7 @@ void SfxImageManager_Impl::SetSymbolsSize_Impl( sal_Int16 nNewSymbolsSize )
for ( sal_uInt16 nPos=0; nPos<nCount; nPos++ ) for ( sal_uInt16 nPos=0; nPos<nCount; nPos++ )
{ {
sal_uInt16 nId = pBox->GetItemId( nPos ); sal_uInt16 nId = pBox->GetItemId( nPos );
if ( pBox->GetItemType(nPos) == TOOLBOXITEM_BUTTON ) if ( pBox->GetItemType(nPos) == ToolBoxItemType::BUTTON )
{ {
pBox->SetItemImage( nId, GetImage( nId, bLarge ) ); pBox->SetItemImage( nId, GetImage( nId, bLarge ) );
SfxStateCache *pCache = SfxViewFrame::Current()->GetBindings().GetStateCache( nId ); SfxStateCache *pCache = SfxViewFrame::Current()->GetBindings().GetStateCache( nId );

View File

@@ -1738,7 +1738,7 @@ bool ToolBox::ImplCalcItem()
it->mbVisibleText = false; // indicates if text will definitely be drawn, influences dropdown pos it->mbVisibleText = false; // indicates if text will definitely be drawn, influences dropdown pos
if ( it->meType == TOOLBOXITEM_BUTTON ) if ( it->meType == ToolBoxItemType::BUTTON )
{ {
// check if image and/or text exists // check if image and/or text exists
if ( !(it->maImage) ) if ( !(it->maImage) )
@@ -1838,18 +1838,18 @@ bool ToolBox::ImplCalcItem()
it->maContentSize.Height() = tmp; it->maContentSize.Height() = tmp;
} }
} }
else if ( it->meType == TOOLBOXITEM_SPACE ) else if ( it->meType == ToolBoxItemType::SPACE )
{ {
it->maItemSize = Size( nDefWidth, nDefHeight ); it->maItemSize = Size( nDefWidth, nDefHeight );
it->maContentSize = it->maItemSize; it->maContentSize = it->maItemSize;
} }
if ( it->meType == TOOLBOXITEM_BUTTON || it->meType == TOOLBOXITEM_SPACE ) if ( it->meType == ToolBoxItemType::BUTTON || it->meType == ToolBoxItemType::SPACE )
{ {
// add borders // add borders
ImplAddButtonBorder( it->maItemSize.Width(), it->maItemSize.Height(), mpData->mbNativeButtons ); ImplAddButtonBorder( it->maItemSize.Width(), it->maItemSize.Height(), mpData->mbNativeButtons );
if( it->meType == TOOLBOXITEM_BUTTON ) if( it->meType == ToolBoxItemType::BUTTON )
{ {
long nMinW = std::max(nMinWidth, it->maMinimalItemSize.Width()); long nMinW = std::max(nMinWidth, it->maMinimalItemSize.Width());
long nMinH = std::max(nMinHeight, it->maMinimalItemSize.Height()); long nMinH = std::max(nMinHeight, it->maMinimalItemSize.Height());
@@ -1962,7 +1962,7 @@ sal_uInt16 ToolBox::ImplCalcBreaks( long nWidth, long* pMaxLineWidth, bool bCalc
bBreak = false; bBreak = false;
nCurWidth = 0; nCurWidth = 0;
if ( it->meType == TOOLBOXITEM_BUTTON || it->meType == TOOLBOXITEM_SPACE ) if ( it->meType == ToolBoxItemType::BUTTON || it->meType == ToolBoxItemType::SPACE )
{ {
if ( bCalcHorz ) if ( bCalcHorz )
nCurWidth = it->maItemSize.Width(); nCurWidth = it->maItemSize.Width();
@@ -1992,14 +1992,14 @@ sal_uInt16 ToolBox::ImplCalcBreaks( long nWidth, long* pMaxLineWidth, bool bCalc
( ( it != lastVisible ) && (nLineWidth+nCurWidth+nMenuWidth > nWidthTotal) && mbScroll ) ) ( ( it != lastVisible ) && (nLineWidth+nCurWidth+nMenuWidth > nWidthTotal) && mbScroll ) )
bBreak = true; bBreak = true;
} }
else if ( it->meType == TOOLBOXITEM_SEPARATOR ) else if ( it->meType == ToolBoxItemType::SEPARATOR )
{ {
nCurWidth = it->mnSepSize; nCurWidth = it->mnSepSize;
if ( !ImplIsFloatingMode() && ( it != lastVisible ) && (nLineWidth+nCurWidth+nMenuWidth > nWidthTotal) ) if ( !ImplIsFloatingMode() && ( it != lastVisible ) && (nLineWidth+nCurWidth+nMenuWidth > nWidthTotal) )
bBreak = true; bBreak = true;
} }
// treat breaks as separators, except when using old style toolbars (ie. no menu button) // treat breaks as separators, except when using old style toolbars (ie. no menu button)
else if ( (it->meType == TOOLBOXITEM_BREAK) && !IsMenuEnabled() ) else if ( (it->meType == ToolBoxItemType::BREAK) && !IsMenuEnabled() )
bBreak = true; bBreak = true;
if ( bBreak ) if ( bBreak )
@@ -2007,7 +2007,7 @@ sal_uInt16 ToolBox::ImplCalcBreaks( long nWidth, long* pMaxLineWidth, bool bCalc
nLines++; nLines++;
// Add break before the entire group or take group apart? // Add break before the entire group or take group apart?
if ( (it->meType == TOOLBOXITEM_BREAK) || if ( (it->meType == ToolBoxItemType::BREAK) ||
(nLineStart == nGroupStart) ) (nLineStart == nGroupStart) )
{ {
if ( nLineWidth > nMaxLineWidth ) if ( nLineWidth > nMaxLineWidth )
@@ -2036,7 +2036,7 @@ sal_uInt16 ToolBox::ImplCalcBreaks( long nWidth, long* pMaxLineWidth, bool bCalc
{ {
if( ImplIsFloatingMode() || !IsMenuEnabled() ) // no group breaking when being docked single-line if( ImplIsFloatingMode() || !IsMenuEnabled() ) // no group breaking when being docked single-line
{ {
if ( (it->meType != TOOLBOXITEM_BUTTON) || bWindow ) if ( (it->meType != ToolBoxItemType::BUTTON) || bWindow )
{ {
// found separator or break // found separator or break
nLastGroupLineWidth = nLineWidth; nLastGroupLineWidth = nLineWidth;
@@ -2141,7 +2141,7 @@ static void lcl_hideDoubleSeparators( std::vector< ImplToolItem >& rItems )
std::vector< ImplToolItem >::iterator it; std::vector< ImplToolItem >::iterator it;
for ( it = rItems.begin(); it != rItems.end(); ++it ) for ( it = rItems.begin(); it != rItems.end(); ++it )
{ {
if ( it->meType == TOOLBOXITEM_SEPARATOR ) if ( it->meType == ToolBoxItemType::SEPARATOR )
{ {
it->mbVisible = false; it->mbVisible = false;
if ( !bLastSep ) if ( !bLastSep )
@@ -2150,7 +2150,7 @@ static void lcl_hideDoubleSeparators( std::vector< ImplToolItem >& rItems )
std::vector< ImplToolItem >::iterator temp_it; std::vector< ImplToolItem >::iterator temp_it;
for ( temp_it = it+1; temp_it != rItems.end(); ++temp_it ) for ( temp_it = it+1; temp_it != rItems.end(); ++temp_it )
{ {
if ( ((temp_it->meType == TOOLBOXITEM_BUTTON) && if ( ((temp_it->meType == ToolBoxItemType::BUTTON) &&
temp_it->mbVisible) ) temp_it->mbVisible) )
{ {
it->mbVisible = true; it->mbVisible = true;
@@ -2985,7 +2985,7 @@ void ToolBox::ImplDrawItem( sal_uInt16 nPos, sal_uInt16 nHighlight, bool bPaint,
// draw separators in flat style only // draw separators in flat style only
if ( !bLayout && if ( !bLayout &&
(mnOutStyle & TOOLBOX_STYLE_FLAT) && (mnOutStyle & TOOLBOX_STYLE_FLAT) &&
(pItem->meType == TOOLBOXITEM_SEPARATOR) && (pItem->meType == ToolBoxItemType::SEPARATOR) &&
nPos > 0 nPos > 0
) )
{ {
@@ -2993,7 +2993,7 @@ void ToolBox::ImplDrawItem( sal_uInt16 nPos, sal_uInt16 nHighlight, bool bPaint,
} }
// do nothing if item is no button or will be displayed as window // do nothing if item is no button or will be displayed as window
if ( (pItem->meType != TOOLBOXITEM_BUTTON) || if ( (pItem->meType != ToolBoxItemType::BUTTON) ||
(pItem->mbShowWindow && !mbCustomizeMode) ) (pItem->mbShowWindow && !mbCustomizeMode) )
return; return;
@@ -3567,7 +3567,7 @@ void ToolBox::MouseMove( const MouseEvent& rMEvt )
if ( it->maRect.IsInside( aMousePos ) ) if ( it->maRect.IsInside( aMousePos ) )
{ {
// select it if it is a button // select it if it is a button
if ( it->meType == TOOLBOXITEM_BUTTON ) if ( it->meType == ToolBoxItemType::BUTTON )
{ {
// if button is disabled, do not // if button is disabled, do not
// change it // change it
@@ -3676,7 +3676,7 @@ void ToolBox::MouseMove( const MouseEvent& rMEvt )
{ {
if ( it->maRect.IsInside( aMousePos ) ) if ( it->maRect.IsInside( aMousePos ) )
{ {
if ( (it->meType == TOOLBOXITEM_BUTTON) && it->mbEnabled ) if ( (it->meType == ToolBoxItemType::BUTTON) && it->mbEnabled )
{ {
if ( !mnOutStyle || (mnOutStyle & TOOLBOX_STYLE_FLAT) ) if ( !mnOutStyle || (mnOutStyle & TOOLBOX_STYLE_FLAT) )
{ {
@@ -3780,7 +3780,7 @@ void ToolBox::MouseButtonDown( const MouseEvent& rMEvt )
{ {
// do nothing if it is a separator or // do nothing if it is a separator or
// if the item has been disabled // if the item has been disabled
if ( (it->meType == TOOLBOXITEM_BUTTON) && if ( (it->meType == ToolBoxItemType::BUTTON) &&
(!it->mbShowWindow || mbCustomizeMode) ) (!it->mbShowWindow || mbCustomizeMode) )
nNewPos = i; nNewPos = i;
@@ -4373,7 +4373,7 @@ void ToolBox::Command( const CommandEvent& rCEvt )
{ {
// do nothing if it is a separator or // do nothing if it is a separator or
// the item has been disabled // the item has been disabled
if ( (it->meType == TOOLBOXITEM_BUTTON) && if ( (it->meType == ToolBoxItemType::BUTTON) &&
!it->mbShowWindow ) !it->mbShowWindow )
mbCommandDrag = true; mbCommandDrag = true;
break; break;
@@ -4762,7 +4762,7 @@ sal_uInt16 ToolBox::ImplCountLineBreaks( const ToolBox *pThis )
std::vector< ImplToolItem >::const_iterator it = ((ToolBox*)pThis)->mpData->m_aItems.begin(); std::vector< ImplToolItem >::const_iterator it = ((ToolBox*)pThis)->mpData->m_aItems.begin();
while ( it != ((ToolBox*)pThis)->mpData->m_aItems.end() ) while ( it != ((ToolBox*)pThis)->mpData->m_aItems.end() )
{ {
if( it->meType == TOOLBOXITEM_BREAK ) if( it->meType == ToolBoxItemType::BREAK )
++nLines; ++nLines;
++it; ++it;
} }
@@ -4832,7 +4832,7 @@ Size ToolBox::CalcMinimumWindowSizePixel() const
while( it != mpData->m_aItems.end() ) while( it != mpData->m_aItems.end() )
{ {
pToolBox->CopyItem( *this, it->mnId ); pToolBox->CopyItem( *this, it->mnId );
if( (it->meType != TOOLBOXITEM_BUTTON) || if( (it->meType != ToolBoxItemType::BUTTON) ||
!it->mbVisible || ImplIsFixedControl( &(*it) ) ) !it->mbVisible || ImplIsFixedControl( &(*it) ) )
++it; ++it;
else else
@@ -5246,7 +5246,7 @@ ImplToolItem* ToolBox::ImplGetFirstValidItem( sal_uInt16 nLine )
if( !nLine ) if( !nLine )
{ {
// find first useful item // find first useful item
while( it != mpData->m_aItems.end() && ((it->meType != TOOLBOXITEM_BUTTON) || while( it != mpData->m_aItems.end() && ((it->meType != ToolBoxItemType::BUTTON) ||
/*!it->mbEnabled ||*/ !it->mbVisible || ImplIsFixedControl( &(*it) )) ) /*!it->mbEnabled ||*/ !it->mbVisible || ImplIsFixedControl( &(*it) )) )
{ {
++it; ++it;
@@ -5360,7 +5360,7 @@ void ToolBox::ImplChangeHighlight( ImplToolItem* pItem, bool bNoGrabFocus )
// check for keyboard accessible items // check for keyboard accessible items
static bool ImplIsValidItem( const ImplToolItem* pItem, bool bNotClipped ) static bool ImplIsValidItem( const ImplToolItem* pItem, bool bNotClipped )
{ {
bool bValid = (pItem && pItem->meType == TOOLBOXITEM_BUTTON && pItem->mbVisible && !ImplIsFixedControl( pItem )); bool bValid = (pItem && pItem->meType == ToolBoxItemType::BUTTON && pItem->mbVisible && !ImplIsFixedControl( pItem ));
if( bValid && bNotClipped && pItem->IsClipped() ) if( bValid && bNotClipped && pItem->IsClipped() )
bValid = false; bValid = false;
return bValid; return bValid;

View File

@@ -91,7 +91,7 @@ void ImplToolItem::init(sal_uInt16 nItemId, ToolBoxItemBits nItemBits,
mnId = nItemId; mnId = nItemId;
mpWindow = NULL; mpWindow = NULL;
mpUserData = NULL; mpUserData = NULL;
meType = TOOLBOXITEM_BUTTON; meType = ToolBoxItemType::BUTTON;
mnBits = nItemBits; mnBits = nItemBits;
meState = TRISTATE_FALSE; meState = TRISTATE_FALSE;
mbEnabled = true; mbEnabled = true;
@@ -210,7 +210,7 @@ Size ImplToolItem::GetSize( bool bHorz, bool bCheckMaxWidth, long maxWidth, cons
Size aSize( rDefaultSize ); // the size of 'standard' toolbox items Size aSize( rDefaultSize ); // the size of 'standard' toolbox items
// non-standard items are eg windows or buttons with text // non-standard items are eg windows or buttons with text
if ( (meType == TOOLBOXITEM_BUTTON) || (meType == TOOLBOXITEM_SPACE) ) if ( (meType == ToolBoxItemType::BUTTON) || (meType == ToolBoxItemType::SPACE) )
{ {
aSize = maItemSize; aSize = maItemSize;
@@ -235,7 +235,7 @@ Size ImplToolItem::GetSize( bool bHorz, bool bCheckMaxWidth, long maxWidth, cons
} }
} }
} }
else if ( meType == TOOLBOXITEM_SEPARATOR ) else if ( meType == ToolBoxItemType::SEPARATOR )
{ {
if ( bHorz ) if ( bHorz )
{ {
@@ -248,7 +248,7 @@ Size ImplToolItem::GetSize( bool bHorz, bool bCheckMaxWidth, long maxWidth, cons
aSize.Height() = mnSepSize; aSize.Height() = mnSepSize;
} }
} }
else if ( meType == TOOLBOXITEM_BREAK ) else if ( meType == ToolBoxItemType::BREAK )
{ {
aSize.Width() = 0; aSize.Width() = 0;
aSize.Height() = 0; aSize.Height() = 0;
@@ -259,7 +259,7 @@ Size ImplToolItem::GetSize( bool bHorz, bool bCheckMaxWidth, long maxWidth, cons
void ImplToolItem::DetermineButtonDrawStyle( ButtonType eButtonType, bool& rbImage, bool& rbText ) const void ImplToolItem::DetermineButtonDrawStyle( ButtonType eButtonType, bool& rbImage, bool& rbText ) const
{ {
if ( meType != TOOLBOXITEM_BUTTON ) if ( meType != ToolBoxItemType::BUTTON )
{ {
// no button -> draw nothing // no button -> draw nothing
rbImage = rbText = false; rbImage = rbText = false;
@@ -333,12 +333,12 @@ Rectangle ImplToolItem::GetDropDownRect( bool bHorz ) const
bool ImplToolItem::IsClipped() const bool ImplToolItem::IsClipped() const
{ {
return ( meType == TOOLBOXITEM_BUTTON && mbVisible && maRect.IsEmpty() ); return ( meType == ToolBoxItemType::BUTTON && mbVisible && maRect.IsEmpty() );
} }
bool ImplToolItem::IsItemHidden() const bool ImplToolItem::IsItemHidden() const
{ {
return ( meType == TOOLBOXITEM_BUTTON && !mbVisible ); return ( meType == ToolBoxItemType::BUTTON && !mbVisible );
} }
const OUString ToolBox::ImplConvertMenuString( const OUString& rStr ) const OUString ToolBox::ImplConvertMenuString( const OUString& rStr )
@@ -531,7 +531,7 @@ void ToolBox::InsertItem( const ResId& rResId, sal_uInt16 nPos )
// if this is a ButtonItem, check ID // if this is a ButtonItem, check ID
bool bNewCalc; bool bNewCalc;
if ( aItem.meType != TOOLBOXITEM_BUTTON ) if ( aItem.meType != ToolBoxItemType::BUTTON )
{ {
bNewCalc = false; bNewCalc = false;
aItem.mnId = 0; aItem.mnId = 0;
@@ -646,7 +646,7 @@ void ToolBox::InsertWindow( sal_uInt16 nItemId, vcl::Window* pWindow,
// create item and add to list // create item and add to list
ImplToolItem aItem; ImplToolItem aItem;
aItem.mnId = nItemId; aItem.mnId = nItemId;
aItem.meType = TOOLBOXITEM_BUTTON; aItem.meType = ToolBoxItemType::BUTTON;
aItem.mnBits = nBits; aItem.mnBits = nBits;
aItem.mpWindow = pWindow; aItem.mpWindow = pWindow;
mpData->m_aItems.insert( (nPos < mpData->m_aItems.size()) ? mpData->m_aItems.begin()+nPos : mpData->m_aItems.end(), aItem ); mpData->m_aItems.insert( (nPos < mpData->m_aItems.size()) ? mpData->m_aItems.begin()+nPos : mpData->m_aItems.end(), aItem );
@@ -666,7 +666,7 @@ void ToolBox::InsertSpace( sal_uInt16 nPos )
{ {
// create item and add to list // create item and add to list
ImplToolItem aItem; ImplToolItem aItem;
aItem.meType = TOOLBOXITEM_SPACE; aItem.meType = ToolBoxItemType::SPACE;
aItem.mbEnabled = false; aItem.mbEnabled = false;
mpData->m_aItems.insert( (nPos < mpData->m_aItems.size()) ? mpData->m_aItems.begin()+nPos : mpData->m_aItems.end(), aItem ); mpData->m_aItems.insert( (nPos < mpData->m_aItems.size()) ? mpData->m_aItems.begin()+nPos : mpData->m_aItems.end(), aItem );
mpData->ImplClearLayoutData(); mpData->ImplClearLayoutData();
@@ -682,7 +682,7 @@ void ToolBox::InsertSeparator( sal_uInt16 nPos, sal_uInt16 nPixSize )
{ {
// create item and add to list // create item and add to list
ImplToolItem aItem; ImplToolItem aItem;
aItem.meType = TOOLBOXITEM_SEPARATOR; aItem.meType = ToolBoxItemType::SEPARATOR;
aItem.mbEnabled = false; aItem.mbEnabled = false;
if ( nPixSize ) if ( nPixSize )
aItem.mnSepSize = nPixSize; aItem.mnSepSize = nPixSize;
@@ -700,7 +700,7 @@ void ToolBox::InsertBreak( sal_uInt16 nPos )
{ {
// create item and add to list // create item and add to list
ImplToolItem aItem; ImplToolItem aItem;
aItem.meType = TOOLBOXITEM_BREAK; aItem.meType = ToolBoxItemType::BREAK;
aItem.mbEnabled = false; aItem.mbEnabled = false;
mpData->m_aItems.insert( (nPos < mpData->m_aItems.size()) ? mpData->m_aItems.begin()+nPos : mpData->m_aItems.end(), aItem ); mpData->m_aItems.insert( (nPos < mpData->m_aItems.size()) ? mpData->m_aItems.begin()+nPos : mpData->m_aItems.end(), aItem );
mpData->ImplClearLayoutData(); mpData->ImplClearLayoutData();
@@ -717,7 +717,7 @@ void ToolBox::RemoveItem( sal_uInt16 nPos )
if( nPos < mpData->m_aItems.size() ) if( nPos < mpData->m_aItems.size() )
{ {
bool bMustCalc; bool bMustCalc;
if ( mpData->m_aItems[nPos].meType == TOOLBOXITEM_BUTTON ) if ( mpData->m_aItems[nPos].meType == ToolBoxItemType::BUTTON )
bMustCalc = true; bMustCalc = true;
else else
bMustCalc = false; bMustCalc = false;
@@ -884,7 +884,7 @@ sal_uInt16 ToolBox::GetItemCount() const
ToolBoxItemType ToolBox::GetItemType( sal_uInt16 nPos ) const ToolBoxItemType ToolBox::GetItemType( sal_uInt16 nPos ) const
{ {
return (nPos < mpData->m_aItems.size()) ? mpData->m_aItems[nPos].meType : TOOLBOXITEM_DONTKNOW; return (nPos < mpData->m_aItems.size()) ? mpData->m_aItems[nPos].meType : ToolBoxItemType::DONTKNOW;
} }
sal_uInt16 ToolBox::GetItemPos( sal_uInt16 nItemId ) const sal_uInt16 ToolBox::GetItemPos( sal_uInt16 nItemId ) const
@@ -933,7 +933,7 @@ sal_uInt16 ToolBox::GetItemId( const Point& rPos ) const
// is it this item? // is it this item?
if ( it->maRect.IsInside( rPos ) ) if ( it->maRect.IsInside( rPos ) )
{ {
if ( it->meType == TOOLBOXITEM_BUTTON ) if ( it->meType == ToolBoxItemType::BUTTON )
return it->mnId; return it->mnId;
else else
return 0; return 0;