summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2014-11-04 21:10:34 +0200
committerNoel Grandin <noelgrandin@gmail.com>2014-11-05 06:45:07 +0000
commit3c58f0768049718fae3d47d5ebfa6c7485ad52b1 (patch)
tree33235262521b5721e09a299a8fe47e444adb477c
parent705c48d32eec0aa5180e60ca157daca4b154e4a3 (diff)
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>
-rw-r--r--accessibility/source/standard/vclxaccessibletoolboxitem.cxx8
-rw-r--r--forms/source/solar/control/navtoolbar.cxx2
-rw-r--r--framework/source/uielement/addonstoolbarmanager.cxx4
-rw-r--r--framework/source/uielement/toolbarmanager.cxx2
-rw-r--r--include/rsc/rsc-vcl-shared-types.hxx4
-rw-r--r--rsc/inc/rscdb.hxx2
-rw-r--r--rsc/source/parser/rscicpx.cxx8
-rw-r--r--sfx2/source/toolbox/imgmgr.cxx2
-rw-r--r--vcl/source/window/toolbox.cxx42
-rw-r--r--vcl/source/window/toolbox2.cxx30
10 files changed, 52 insertions, 52 deletions
diff --git a/accessibility/source/standard/vclxaccessibletoolboxitem.cxx b/accessibility/source/standard/vclxaccessibletoolboxitem.cxx
index 7906f64521ec..b3143a362a29 100644
--- a/accessibility/source/standard/vclxaccessibletoolboxitem.cxx
+++ b/accessibility/source/standard/vclxaccessibletoolboxitem.cxx
@@ -80,7 +80,7 @@ VCLXAccessibleToolBoxItem::VCLXAccessibleToolBoxItem( ToolBox* _pToolBox, sal_In
ToolBoxItemType eType = m_pToolBox->GetItemType( (sal_uInt16)m_nIndexInParent );
switch ( eType )
{
- case TOOLBOXITEM_BUTTON :
+ case ToolBoxItemType::BUTTON :
{
ToolBoxItemBits nBits = m_pToolBox->GetItemBits( m_nItemId );
if (
@@ -99,12 +99,12 @@ VCLXAccessibleToolBoxItem::VCLXAccessibleToolBoxItem( ToolBox* _pToolBox, sal_In
break;
}
- case TOOLBOXITEM_SPACE :
+ case ToolBoxItemType::SPACE :
m_nRole = AccessibleRole::FILLER;
break;
- case TOOLBOXITEM_SEPARATOR :
- case TOOLBOXITEM_BREAK :
+ case ToolBoxItemType::SEPARATOR :
+ case ToolBoxItemType::BREAK :
m_nRole = AccessibleRole::SEPARATOR;
break;
diff --git a/forms/source/solar/control/navtoolbar.cxx b/forms/source/solar/control/navtoolbar.cxx
index 7e78b7fb997b..587192b48920 100644
--- a/forms/source/solar/control/navtoolbar.cxx
+++ b/forms/source/solar/control/navtoolbar.cxx
@@ -357,7 +357,7 @@ namespace frm
for ( sal_uInt16 i=0; i<nItemCount; ++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 );
}
diff --git a/framework/source/uielement/addonstoolbarmanager.cxx b/framework/source/uielement/addonstoolbarmanager.cxx
index 35abdcab9d43..467976dd2d7d 100644
--- a/framework/source/uielement/addonstoolbarmanager.cxx
+++ b/framework/source/uielement/addonstoolbarmanager.cxx
@@ -242,7 +242,7 @@ void AddonsToolBarManager::FillToolbar( const Sequence< Sequence< PropertyValue
if ( aURL == TOOLBOXITEM_SEPARATOR_STR )
{
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;
m_pToolBar->InsertSeparator();
@@ -251,7 +251,7 @@ void AddonsToolBarManager::FillToolbar( const Sequence< Sequence< PropertyValue
else
{
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
m_pToolBar->InsertSeparator();
diff --git a/framework/source/uielement/toolbarmanager.cxx b/framework/source/uielement/toolbarmanager.cxx
index c211604f8afc..01541fcf0402 100644
--- a/framework/source/uielement/toolbarmanager.cxx
+++ b/framework/source/uielement/toolbarmanager.cxx
@@ -1719,7 +1719,7 @@ bool ToolBarManager::MenuItemAllowed( sal_uInt16 ) const
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);
OUString aCommandURL = m_pToolBar->GetItemCommand( nId );
diff --git a/include/rsc/rsc-vcl-shared-types.hxx b/include/rsc/rsc-vcl-shared-types.hxx
index 005272c40efb..eab2e0419a82 100644
--- a/include/rsc/rsc-vcl-shared-types.hxx
+++ b/include/rsc/rsc-vcl-shared-types.hxx
@@ -72,9 +72,7 @@ namespace o3tl
template<> struct typed_flags<ToolBoxItemBits> : is_typed_flags<ToolBoxItemBits, 0x3ff> {};
}
-enum ToolBoxItemType { TOOLBOXITEM_DONTKNOW, TOOLBOXITEM_BUTTON,
- TOOLBOXITEM_SPACE, TOOLBOXITEM_SEPARATOR,
- TOOLBOXITEM_BREAK };
+enum class ToolBoxItemType { DONTKNOW, BUTTON, SPACE, SEPARATOR, BREAK };
enum ButtonType { BUTTON_SYMBOL, BUTTON_TEXT, BUTTON_SYMBOLTEXT };
diff --git a/rsc/inc/rscdb.hxx b/rsc/inc/rscdb.hxx
index 26e0a9ba0786..d2b8f4f1887d 100644
--- a/rsc/inc/rscdb.hxx
+++ b/rsc/inc/rscdb.hxx
@@ -42,6 +42,7 @@ enum class WindowBorderStyle : sal_Int16;
enum class TimeFieldFormat : sal_Int32;
enum class KeyFuncType : sal_Int32;
enum class MenuItemBits : sal_Int16;
+enum class ToolBoxItemType;
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, 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 * InitFieldUnitsType();
RscEnum * InitTimeFieldFormat();
diff --git a/rsc/source/parser/rscicpx.cxx b/rsc/source/parser/rscicpx.cxx
index 0d2276aa7c49..35fc0ff6a999 100644
--- a/rsc/source/parser/rscicpx.cxx
+++ b/rsc/source/parser/rscicpx.cxx
@@ -1290,10 +1290,10 @@ RscTop * RscTypCont::InitClassToolBoxItem( RscTop * pSuper,
RscEnum * pEnum;
aBaseLst.push_back( pEnum = new RscEnum( pHS->getID( "EnumToolBoxItemType" ), RSC_NOTYPE ) );
- SETCONST( pEnum, "TOOLBOXITEM_BUTTON", TOOLBOXITEM_BUTTON );
- SETCONST( pEnum, "TOOLBOXITEM_SPACE", TOOLBOXITEM_SPACE );
- SETCONST( pEnum, "TOOLBOXITEM_SEPARATOR", TOOLBOXITEM_SEPARATOR );
- SETCONST( pEnum, "TOOLBOXITEM_BREAK", TOOLBOXITEM_BREAK );
+ SETCONST( pEnum, "TOOLBOXITEM_BUTTON", ToolBoxItemType::BUTTON );
+ SETCONST( pEnum, "TOOLBOXITEM_SPACE", ToolBoxItemType::SPACE );
+ SETCONST( pEnum, "TOOLBOXITEM_SEPARATOR", ToolBoxItemType::SEPARATOR );
+ SETCONST( pEnum, "TOOLBOXITEM_BREAK", ToolBoxItemType::BREAK );
// Variable einfuegen
nId = aNmTb.Put( "Type", VARNAME );
diff --git a/sfx2/source/toolbox/imgmgr.cxx b/sfx2/source/toolbox/imgmgr.cxx
index 7e56fc0d88c9..4c865a122817 100644
--- a/sfx2/source/toolbox/imgmgr.cxx
+++ b/sfx2/source/toolbox/imgmgr.cxx
@@ -211,7 +211,7 @@ void SfxImageManager_Impl::SetSymbolsSize_Impl( sal_Int16 nNewSymbolsSize )
for ( sal_uInt16 nPos=0; nPos<nCount; 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 ) );
SfxStateCache *pCache = SfxViewFrame::Current()->GetBindings().GetStateCache( nId );
diff --git a/vcl/source/window/toolbox.cxx b/vcl/source/window/toolbox.cxx
index 227840fe0c61..4fc17254545b 100644
--- a/vcl/source/window/toolbox.cxx
+++ b/vcl/source/window/toolbox.cxx
@@ -1738,7 +1738,7 @@ bool ToolBox::ImplCalcItem()
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
if ( !(it->maImage) )
@@ -1838,18 +1838,18 @@ bool ToolBox::ImplCalcItem()
it->maContentSize.Height() = tmp;
}
}
- else if ( it->meType == TOOLBOXITEM_SPACE )
+ else if ( it->meType == ToolBoxItemType::SPACE )
{
it->maItemSize = Size( nDefWidth, nDefHeight );
it->maContentSize = it->maItemSize;
}
- if ( it->meType == TOOLBOXITEM_BUTTON || it->meType == TOOLBOXITEM_SPACE )
+ if ( it->meType == ToolBoxItemType::BUTTON || it->meType == ToolBoxItemType::SPACE )
{
// add borders
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 nMinH = std::max(nMinHeight, it->maMinimalItemSize.Height());
@@ -1962,7 +1962,7 @@ sal_uInt16 ToolBox::ImplCalcBreaks( long nWidth, long* pMaxLineWidth, bool bCalc
bBreak = false;
nCurWidth = 0;
- if ( it->meType == TOOLBOXITEM_BUTTON || it->meType == TOOLBOXITEM_SPACE )
+ if ( it->meType == ToolBoxItemType::BUTTON || it->meType == ToolBoxItemType::SPACE )
{
if ( bCalcHorz )
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 ) )
bBreak = true;
}
- else if ( it->meType == TOOLBOXITEM_SEPARATOR )
+ else if ( it->meType == ToolBoxItemType::SEPARATOR )
{
nCurWidth = it->mnSepSize;
if ( !ImplIsFloatingMode() && ( it != lastVisible ) && (nLineWidth+nCurWidth+nMenuWidth > nWidthTotal) )
bBreak = true;
}
// 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;
if ( bBreak )
@@ -2007,7 +2007,7 @@ sal_uInt16 ToolBox::ImplCalcBreaks( long nWidth, long* pMaxLineWidth, bool bCalc
nLines++;
// Add break before the entire group or take group apart?
- if ( (it->meType == TOOLBOXITEM_BREAK) ||
+ if ( (it->meType == ToolBoxItemType::BREAK) ||
(nLineStart == nGroupStart) )
{
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 ( (it->meType != TOOLBOXITEM_BUTTON) || bWindow )
+ if ( (it->meType != ToolBoxItemType::BUTTON) || bWindow )
{
// found separator or break
nLastGroupLineWidth = nLineWidth;
@@ -2141,7 +2141,7 @@ static void lcl_hideDoubleSeparators( std::vector< ImplToolItem >& rItems )
std::vector< ImplToolItem >::iterator it;
for ( it = rItems.begin(); it != rItems.end(); ++it )
{
- if ( it->meType == TOOLBOXITEM_SEPARATOR )
+ if ( it->meType == ToolBoxItemType::SEPARATOR )
{
it->mbVisible = false;
if ( !bLastSep )
@@ -2150,7 +2150,7 @@ static void lcl_hideDoubleSeparators( std::vector< ImplToolItem >& rItems )
std::vector< ImplToolItem >::iterator 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) )
{
it->mbVisible = true;
@@ -2985,7 +2985,7 @@ void ToolBox::ImplDrawItem( sal_uInt16 nPos, sal_uInt16 nHighlight, bool bPaint,
// draw separators in flat style only
if ( !bLayout &&
(mnOutStyle & TOOLBOX_STYLE_FLAT) &&
- (pItem->meType == TOOLBOXITEM_SEPARATOR) &&
+ (pItem->meType == ToolBoxItemType::SEPARATOR) &&
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
- if ( (pItem->meType != TOOLBOXITEM_BUTTON) ||
+ if ( (pItem->meType != ToolBoxItemType::BUTTON) ||
(pItem->mbShowWindow && !mbCustomizeMode) )
return;
@@ -3567,7 +3567,7 @@ void ToolBox::MouseMove( const MouseEvent& rMEvt )
if ( it->maRect.IsInside( aMousePos ) )
{
// select it if it is a button
- if ( it->meType == TOOLBOXITEM_BUTTON )
+ if ( it->meType == ToolBoxItemType::BUTTON )
{
// if button is disabled, do not
// change it
@@ -3676,7 +3676,7 @@ void ToolBox::MouseMove( const MouseEvent& rMEvt )
{
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) )
{
@@ -3780,7 +3780,7 @@ void ToolBox::MouseButtonDown( const MouseEvent& rMEvt )
{
// do nothing if it is a separator or
// if the item has been disabled
- if ( (it->meType == TOOLBOXITEM_BUTTON) &&
+ if ( (it->meType == ToolBoxItemType::BUTTON) &&
(!it->mbShowWindow || mbCustomizeMode) )
nNewPos = i;
@@ -4373,7 +4373,7 @@ void ToolBox::Command( const CommandEvent& rCEvt )
{
// do nothing if it is a separator or
// the item has been disabled
- if ( (it->meType == TOOLBOXITEM_BUTTON) &&
+ if ( (it->meType == ToolBoxItemType::BUTTON) &&
!it->mbShowWindow )
mbCommandDrag = true;
break;
@@ -4762,7 +4762,7 @@ sal_uInt16 ToolBox::ImplCountLineBreaks( const ToolBox *pThis )
std::vector< ImplToolItem >::const_iterator it = ((ToolBox*)pThis)->mpData->m_aItems.begin();
while ( it != ((ToolBox*)pThis)->mpData->m_aItems.end() )
{
- if( it->meType == TOOLBOXITEM_BREAK )
+ if( it->meType == ToolBoxItemType::BREAK )
++nLines;
++it;
}
@@ -4832,7 +4832,7 @@ Size ToolBox::CalcMinimumWindowSizePixel() const
while( it != mpData->m_aItems.end() )
{
pToolBox->CopyItem( *this, it->mnId );
- if( (it->meType != TOOLBOXITEM_BUTTON) ||
+ if( (it->meType != ToolBoxItemType::BUTTON) ||
!it->mbVisible || ImplIsFixedControl( &(*it) ) )
++it;
else
@@ -5246,7 +5246,7 @@ ImplToolItem* ToolBox::ImplGetFirstValidItem( sal_uInt16 nLine )
if( !nLine )
{
// 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;
@@ -5360,7 +5360,7 @@ void ToolBox::ImplChangeHighlight( ImplToolItem* pItem, bool bNoGrabFocus )
// check for keyboard accessible items
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() )
bValid = false;
return bValid;
diff --git a/vcl/source/window/toolbox2.cxx b/vcl/source/window/toolbox2.cxx
index 0113b12fccd9..2fc8c324209a 100644
--- a/vcl/source/window/toolbox2.cxx
+++ b/vcl/source/window/toolbox2.cxx
@@ -91,7 +91,7 @@ void ImplToolItem::init(sal_uInt16 nItemId, ToolBoxItemBits nItemBits,
mnId = nItemId;
mpWindow = NULL;
mpUserData = NULL;
- meType = TOOLBOXITEM_BUTTON;
+ meType = ToolBoxItemType::BUTTON;
mnBits = nItemBits;
meState = TRISTATE_FALSE;
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
// 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;
@@ -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 )
{
@@ -248,7 +248,7 @@ Size ImplToolItem::GetSize( bool bHorz, bool bCheckMaxWidth, long maxWidth, cons
aSize.Height() = mnSepSize;
}
}
- else if ( meType == TOOLBOXITEM_BREAK )
+ else if ( meType == ToolBoxItemType::BREAK )
{
aSize.Width() = 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
{
- if ( meType != TOOLBOXITEM_BUTTON )
+ if ( meType != ToolBoxItemType::BUTTON )
{
// no button -> draw nothing
rbImage = rbText = false;
@@ -333,12 +333,12 @@ Rectangle ImplToolItem::GetDropDownRect( bool bHorz ) const
bool ImplToolItem::IsClipped() const
{
- return ( meType == TOOLBOXITEM_BUTTON && mbVisible && maRect.IsEmpty() );
+ return ( meType == ToolBoxItemType::BUTTON && mbVisible && maRect.IsEmpty() );
}
bool ImplToolItem::IsItemHidden() const
{
- return ( meType == TOOLBOXITEM_BUTTON && !mbVisible );
+ return ( meType == ToolBoxItemType::BUTTON && !mbVisible );
}
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
bool bNewCalc;
- if ( aItem.meType != TOOLBOXITEM_BUTTON )
+ if ( aItem.meType != ToolBoxItemType::BUTTON )
{
bNewCalc = false;
aItem.mnId = 0;
@@ -646,7 +646,7 @@ void ToolBox::InsertWindow( sal_uInt16 nItemId, vcl::Window* pWindow,
// create item and add to list
ImplToolItem aItem;
aItem.mnId = nItemId;
- aItem.meType = TOOLBOXITEM_BUTTON;
+ aItem.meType = ToolBoxItemType::BUTTON;
aItem.mnBits = nBits;
aItem.mpWindow = pWindow;
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
ImplToolItem aItem;
- aItem.meType = TOOLBOXITEM_SPACE;
+ aItem.meType = ToolBoxItemType::SPACE;
aItem.mbEnabled = false;
mpData->m_aItems.insert( (nPos < mpData->m_aItems.size()) ? mpData->m_aItems.begin()+nPos : mpData->m_aItems.end(), aItem );
mpData->ImplClearLayoutData();
@@ -682,7 +682,7 @@ void ToolBox::InsertSeparator( sal_uInt16 nPos, sal_uInt16 nPixSize )
{
// create item and add to list
ImplToolItem aItem;
- aItem.meType = TOOLBOXITEM_SEPARATOR;
+ aItem.meType = ToolBoxItemType::SEPARATOR;
aItem.mbEnabled = false;
if ( nPixSize )
aItem.mnSepSize = nPixSize;
@@ -700,7 +700,7 @@ void ToolBox::InsertBreak( sal_uInt16 nPos )
{
// create item and add to list
ImplToolItem aItem;
- aItem.meType = TOOLBOXITEM_BREAK;
+ aItem.meType = ToolBoxItemType::BREAK;
aItem.mbEnabled = false;
mpData->m_aItems.insert( (nPos < mpData->m_aItems.size()) ? mpData->m_aItems.begin()+nPos : mpData->m_aItems.end(), aItem );
mpData->ImplClearLayoutData();
@@ -717,7 +717,7 @@ void ToolBox::RemoveItem( sal_uInt16 nPos )
if( nPos < mpData->m_aItems.size() )
{
bool bMustCalc;
- if ( mpData->m_aItems[nPos].meType == TOOLBOXITEM_BUTTON )
+ if ( mpData->m_aItems[nPos].meType == ToolBoxItemType::BUTTON )
bMustCalc = true;
else
bMustCalc = false;
@@ -884,7 +884,7 @@ sal_uInt16 ToolBox::GetItemCount() 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
@@ -933,7 +933,7 @@ sal_uInt16 ToolBox::GetItemId( const Point& rPos ) const
// is it this item?
if ( it->maRect.IsInside( rPos ) )
{
- if ( it->meType == TOOLBOXITEM_BUTTON )
+ if ( it->meType == ToolBoxItemType::BUTTON )
return it->mnId;
else
return 0;