diff options
author | Noel Grandin <noel@peralex.com> | 2014-10-18 20:16:11 +0200 |
---|---|---|
committer | Noel Grandin <noelgrandin@gmail.com> | 2014-10-20 07:16:46 +0000 |
commit | 67c9d054517fc3b5cbc203c330eedef4b50f0e57 (patch) | |
tree | 1fad773f770e4ee4265bb05ba77d7f3084aedd3b /framework | |
parent | 8091cf383a122f2348d6e25df90fc26579fe6ef7 (diff) |
fdo#84938: replace TIB_ constants with enum
Change-Id: I435ce2331fb49e7ce9fe97bdfddfaef706759a84
Reviewed-on: https://gerrit.libreoffice.org/12023
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'framework')
7 files changed, 32 insertions, 32 deletions
diff --git a/framework/inc/uielement/toolbarmanager.hxx b/framework/inc/uielement/toolbarmanager.hxx index 90458fb0ce64..462f48ee8eb2 100644 --- a/framework/inc/uielement/toolbarmanager.hxx +++ b/framework/inc/uielement/toolbarmanager.hxx @@ -158,7 +158,7 @@ class ToolBarManager : public ToolbarManager_Base void UpdateImageOrientation(); void ImplClearPopupMenu( ToolBox *pToolBar ); void RequestImages(); - sal_uInt16 ConvertStyleToToolboxItemBits( sal_Int32 nStyle ); + ToolBoxItemBits ConvertStyleToToolboxItemBits( sal_Int32 nStyle ); ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > GetModelFromFrame() const; bool IsPluginMode() const; Image QueryAddonsImage( const OUString& aCommandURL, bool bBigImages ); diff --git a/framework/source/uielement/complextoolbarcontroller.cxx b/framework/source/uielement/complextoolbarcontroller.cxx index 7e731b306964..49026882bddb 100644 --- a/framework/source/uielement/complextoolbarcontroller.cxx +++ b/framework/source/uielement/complextoolbarcontroller.cxx @@ -140,8 +140,8 @@ throw ( RuntimeException, std::exception ) { m_pToolbar->EnableItem( m_nID, Event.IsEnabled ); - sal_uInt16 nItemBits = m_pToolbar->GetItemBits( m_nID ); - nItemBits &= ~TIB_CHECKABLE; + ToolBoxItemBits nItemBits = m_pToolbar->GetItemBits( m_nID ); + nItemBits &= ~ToolBoxItemBits::CHECKABLE; TriState eTri = TRISTATE_FALSE; bool bValue; @@ -158,7 +158,7 @@ throw ( RuntimeException, std::exception ) m_pToolbar->CheckItem( m_nID, bValue ); if ( bValue ) eTri = TRISTATE_TRUE; - nItemBits |= TIB_CHECKABLE; + nItemBits |= ToolBoxItemBits::CHECKABLE; } else if ( Event.State >>= aStrValue ) { @@ -172,7 +172,7 @@ throw ( RuntimeException, std::exception ) else if ( Event.State >>= aItemState ) { eTri = TRISTATE_INDET; - nItemBits |= TIB_CHECKABLE; + nItemBits |= ToolBoxItemBits::CHECKABLE; if ( m_bMadeInvisible ) m_pToolbar->ShowItem( m_nID, true ); } diff --git a/framework/source/uielement/generictoolbarcontroller.cxx b/framework/source/uielement/generictoolbarcontroller.cxx index c3a836bf60a4..11cf7ee004ff 100644 --- a/framework/source/uielement/generictoolbarcontroller.cxx +++ b/framework/source/uielement/generictoolbarcontroller.cxx @@ -188,8 +188,8 @@ throw ( RuntimeException, std::exception ) { m_pToolbar->EnableItem( m_nID, Event.IsEnabled ); - sal_uInt16 nItemBits = m_pToolbar->GetItemBits( m_nID ); - nItemBits &= ~TIB_CHECKABLE; + ToolBoxItemBits nItemBits = m_pToolbar->GetItemBits( m_nID ); + nItemBits &= ~ToolBoxItemBits::CHECKABLE; TriState eTri = TRISTATE_FALSE; bool bValue; @@ -205,7 +205,7 @@ throw ( RuntimeException, std::exception ) m_pToolbar->CheckItem( m_nID, bValue ); if ( bValue ) eTri = TRISTATE_TRUE; - nItemBits |= TIB_CHECKABLE; + nItemBits |= ToolBoxItemBits::CHECKABLE; } else if ( Event.State >>= aStrValue ) { @@ -219,7 +219,7 @@ throw ( RuntimeException, std::exception ) m_pToolbar->CheckItem( m_nID, bValue ); if ( bValue ) eTri = TRISTATE_TRUE; - nItemBits |= TIB_CHECKABLE; + nItemBits |= ToolBoxItemBits::CHECKABLE; } else { @@ -252,7 +252,7 @@ throw ( RuntimeException, std::exception ) else if (( Event.State >>= aItemState ) && !m_bEnumCommand ) { eTri = TRISTATE_INDET; - nItemBits |= TIB_CHECKABLE; + nItemBits |= ToolBoxItemBits::CHECKABLE; if ( m_bMadeInvisible ) m_pToolbar->ShowItem( m_nID, true ); } diff --git a/framework/source/uielement/popuptoolbarcontroller.cxx b/framework/source/uielement/popuptoolbarcontroller.cxx index 10617f6e0906..fbb28088e7e1 100644 --- a/framework/source/uielement/popuptoolbarcontroller.cxx +++ b/framework/source/uielement/popuptoolbarcontroller.cxx @@ -70,7 +70,7 @@ protected: PopupMenuToolbarController( const css::uno::Reference< css::uno::XComponentContext >& rxContext, const OUString &rPopupCommand = OUString() ); virtual void functionExecuted( const OUString &rCommand ); - virtual sal_uInt16 getDropDownStyle() const; + virtual ToolBoxItemBits getDropDownStyle() const; void createPopupMenuController(); css::uno::Reference< css::uno::XComponentContext > m_xContext; @@ -205,9 +205,9 @@ void PopupMenuToolbarController::functionExecuted( const OUString &/*rCommand*/) { } -sal_uInt16 PopupMenuToolbarController::getDropDownStyle() const +ToolBoxItemBits PopupMenuToolbarController::getDropDownStyle() const { - return TIB_DROPDOWN; + return ToolBoxItemBits::DROPDOWN; } void PopupMenuToolbarController::createPopupMenuController() @@ -260,7 +260,7 @@ public: virtual css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames() throw (css::uno::RuntimeException) SAL_OVERRIDE; private: - sal_uInt16 getDropDownStyle() const SAL_OVERRIDE; + ToolBoxItemBits getDropDownStyle() const SAL_OVERRIDE; }; WizardsToolbarController::WizardsToolbarController( @@ -290,9 +290,9 @@ css::uno::Sequence<OUString> WizardsToolbarController::getSupportedServiceNames( return aRet; } -sal_uInt16 WizardsToolbarController::getDropDownStyle() const +ToolBoxItemBits WizardsToolbarController::getDropDownStyle() const { - return TIB_DROPDOWNONLY; + return ToolBoxItemBits::DROPDOWNONLY; } class OpenToolbarController : public PopupMenuToolbarController diff --git a/framework/source/uielement/togglebuttontoolbarcontroller.cxx b/framework/source/uielement/togglebuttontoolbarcontroller.cxx index 5d73812ab615..3ee98ab91f24 100644 --- a/framework/source/uielement/togglebuttontoolbarcontroller.cxx +++ b/framework/source/uielement/togglebuttontoolbarcontroller.cxx @@ -64,9 +64,9 @@ ToggleButtonToolbarController::ToggleButtonToolbarController( m_eStyle( eStyle ) { if ( eStyle == STYLE_DROPDOWNBUTTON ) - m_pToolbar->SetItemBits( m_nID, TIB_DROPDOWNONLY | m_pToolbar->GetItemBits( m_nID ) ); + m_pToolbar->SetItemBits( m_nID, ToolBoxItemBits::DROPDOWNONLY | m_pToolbar->GetItemBits( m_nID ) ); else if ( eStyle == STYLE_TOGGLE_DROPDOWNBUTTON ) - m_pToolbar->SetItemBits( m_nID, TIB_DROPDOWN | m_pToolbar->GetItemBits( m_nID ) ); + m_pToolbar->SetItemBits( m_nID, ToolBoxItemBits::DROPDOWN | m_pToolbar->GetItemBits( m_nID ) ); } ToggleButtonToolbarController::~ToggleButtonToolbarController() diff --git a/framework/source/uielement/toolbarmanager.cxx b/framework/source/uielement/toolbarmanager.cxx index b9ec5385d099..e00a974607a2 100644 --- a/framework/source/uielement/toolbarmanager.cxx +++ b/framework/source/uielement/toolbarmanager.cxx @@ -947,7 +947,7 @@ void ToolBarManager::CreateControllers() // Accessibility support: Set toggle button role for specific commands sal_Int32 nProps = RetrievePropertiesFromCommand( aCommandURL ); if ( nProps & UICOMMANDDESCRIPTION_PROPERTIES_TOGGLEBUTTON ) - m_pToolBar->SetItemBits( nId, m_pToolBar->GetItemBits( nId ) | TIB_CHECKABLE ); + m_pToolBar->SetItemBits( nId, m_pToolBar->GetItemBits( nId ) | ToolBoxItemBits::CHECKABLE ); } else xController = Reference< XStatusListener >( @@ -1110,25 +1110,25 @@ void ToolBarManager::AddImageOrientationListener() } } -sal_uInt16 ToolBarManager::ConvertStyleToToolboxItemBits( sal_Int32 nStyle ) +ToolBoxItemBits ToolBarManager::ConvertStyleToToolboxItemBits( sal_Int32 nStyle ) { - sal_uInt16 nItemBits( 0 ); + ToolBoxItemBits nItemBits( ToolBoxItemBits::NONE ); if ( nStyle & ::com::sun::star::ui::ItemStyle::RADIO_CHECK ) - nItemBits |= TIB_RADIOCHECK; + nItemBits |= ToolBoxItemBits::RADIOCHECK; if ( nStyle & ::com::sun::star::ui::ItemStyle::ALIGN_LEFT ) - nItemBits |= TIB_LEFT; + nItemBits |= ToolBoxItemBits::LEFT; if ( nStyle & ::com::sun::star::ui::ItemStyle::AUTO_SIZE ) - nItemBits |= TIB_AUTOSIZE; + nItemBits |= ToolBoxItemBits::AUTOSIZE; if ( nStyle & ::com::sun::star::ui::ItemStyle::DROP_DOWN ) - nItemBits |= TIB_DROPDOWN; + nItemBits |= ToolBoxItemBits::DROPDOWN; if ( nStyle & ::com::sun::star::ui::ItemStyle::REPEAT ) - nItemBits |= TIB_REPEAT; + nItemBits |= ToolBoxItemBits::REPEAT; if ( nStyle & ::com::sun::star::ui::ItemStyle::DROPDOWN_ONLY ) - nItemBits |= TIB_DROPDOWNONLY; + nItemBits |= ToolBoxItemBits::DROPDOWNONLY; if ( nStyle & ::com::sun::star::ui::ItemStyle::TEXT ) - nItemBits |= TIB_TEXT_ONLY; + nItemBits |= ToolBoxItemBits::TEXT_ONLY; if ( nStyle & ::com::sun::star::ui::ItemStyle::ICON ) - nItemBits |= TIB_ICON_ONLY; + nItemBits |= ToolBoxItemBits::ICON_ONLY; return nItemBits; } @@ -1268,11 +1268,11 @@ void ToolBarManager::FillToolbar( const Reference< XIndexAccess >& rItemContaine { OUString aString( RetrieveLabelFromCommand( aCommandURL )); - sal_uInt16 nItemBits = ConvertStyleToToolboxItemBits( nStyle ); + ToolBoxItemBits nItemBits = ConvertStyleToToolboxItemBits( nStyle ); if ( aMenuDesc.is() ) { m_aMenuMap[ nId ] = aMenuDesc; - nItemBits |= TIB_DROPDOWNONLY; + nItemBits |= ToolBoxItemBits::DROPDOWNONLY; } m_pToolBar->InsertItem( nId, aString, nItemBits ); m_pToolBar->SetItemCommand( nId, aCommandURL ); diff --git a/framework/source/uielement/toolbarmerger.cxx b/framework/source/uielement/toolbarmerger.cxx index 42d139dead33..798b76cdbec5 100644 --- a/framework/source/uielement/toolbarmerger.cxx +++ b/framework/source/uielement/toolbarmerger.cxx @@ -662,7 +662,7 @@ bool ToolBarMerger::RemoveItems( void ToolBarMerger::CreateToolbarItem( ToolBox* pToolbar, CommandToInfoMap& rCommandMap, sal_uInt16 nPos, sal_uInt16 nItemId, const AddonToolbarItem& rItem ) { - pToolbar->InsertItem( nItemId, rItem.aLabel, 0, nPos ); + pToolbar->InsertItem( nItemId, rItem.aLabel, ToolBoxItemBits::NONE, nPos ); pToolbar->SetItemCommand( nItemId, rItem.aCommandURL ); pToolbar->SetQuickHelpText( nItemId, rItem.aLabel ); pToolbar->SetItemText( nItemId, rItem.aLabel ); |