diff options
author | Noel Grandin <noel@peralex.com> | 2016-05-10 10:06:09 +0200 |
---|---|---|
committer | Noel Grandin <noelgrandin@gmail.com> | 2016-05-10 09:54:00 +0000 |
commit | effde80f670c60986a92ca0f1c5c9922eb17908d (patch) | |
tree | d9757c8e035d53710728e404bf4fb741594c1bb8 /framework | |
parent | 034e481613742e7fc6f9d14c34dd1896bc1ba671 (diff) |
Convert StatusBarItemBits to scoped enum
Change-Id: Ic979d1470052039c4b966edd1d896af31ef55668
Reviewed-on: https://gerrit.libreoffice.org/24826
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'framework')
-rw-r--r-- | framework/inc/uielement/statusbarmerger.hxx | 14 | ||||
-rw-r--r-- | framework/source/fwe/xml/statusbardocumenthandler.cxx | 2 | ||||
-rw-r--r-- | framework/source/uielement/statusbaritem.cxx | 14 | ||||
-rw-r--r-- | framework/source/uielement/statusbarmanager.cxx | 22 | ||||
-rw-r--r-- | framework/source/uielement/statusbarmerger.cxx | 12 |
5 files changed, 32 insertions, 32 deletions
diff --git a/framework/inc/uielement/statusbarmerger.hxx b/framework/inc/uielement/statusbarmerger.hxx index d4675fa95c9d..fc296d512be8 100644 --- a/framework/inc/uielement/statusbarmerger.hxx +++ b/framework/inc/uielement/statusbarmerger.hxx @@ -28,17 +28,17 @@ namespace framework struct AddonStatusbarItemData { - rtl::OUString aLabel; - sal_uInt16 nItemBits; + rtl::OUString aLabel; + StatusBarItemBits nItemBits; }; struct AddonStatusbarItem { - rtl::OUString aCommandURL; - rtl::OUString aLabel; - rtl::OUString aContext; - sal_uInt16 nItemBits; - sal_Int16 nWidth; + rtl::OUString aCommandURL; + rtl::OUString aLabel; + rtl::OUString aContext; + StatusBarItemBits nItemBits; + sal_Int16 nWidth; }; typedef ::std::vector< AddonStatusbarItem > AddonStatusbarItemContainer; diff --git a/framework/source/fwe/xml/statusbardocumenthandler.cxx b/framework/source/fwe/xml/statusbardocumenthandler.cxx index 6219eb184d7a..1640db19d4a1 100644 --- a/framework/source/fwe/xml/statusbardocumenthandler.cxx +++ b/framework/source/fwe/xml/statusbardocumenthandler.cxx @@ -602,7 +602,7 @@ throw ( SAXException, RuntimeException ) ATTRIBUTE_ALIGN_LEFT ); } - // style ( SIB_IN is default ) + // style ( StatusBarItemBits::In is default ) if ( nStyle & ItemStyle::DRAW_FLAT ) { pList->AddAttribute( m_aXMLStatusBarNS + ATTRIBUTE_STYLE, diff --git a/framework/source/uielement/statusbaritem.cxx b/framework/source/uielement/statusbaritem.cxx index a79e0dd387b3..3c11376ca6b8 100644 --- a/framework/source/uielement/statusbaritem.cxx +++ b/framework/source/uielement/statusbaritem.cxx @@ -33,28 +33,28 @@ namespace framework namespace { -sal_uInt16 impl_convertItemBitsToItemStyle( sal_Int16 nItemBits ) +sal_uInt16 impl_convertItemBitsToItemStyle( StatusBarItemBits nItemBits ) { sal_uInt16 nStyle( 0 ); - if ( ( nItemBits & SIB_RIGHT ) == SIB_RIGHT ) + if ( nItemBits & StatusBarItemBits::Right ) nStyle |= ItemStyle::ALIGN_RIGHT; - else if ( ( nItemBits & SIB_LEFT ) == SIB_LEFT ) + else if ( nItemBits & StatusBarItemBits::Left ) nStyle |= ItemStyle::ALIGN_LEFT; else nStyle |= ItemStyle::ALIGN_CENTER; - if ( ( nItemBits & SIB_FLAT ) == SIB_FLAT ) + if ( nItemBits & StatusBarItemBits::Flat ) nStyle |= ItemStyle::DRAW_FLAT; - else if ( ( nItemBits & SIB_OUT ) == SIB_OUT ) + else if ( nItemBits & StatusBarItemBits::Out ) nStyle |= ItemStyle::DRAW_OUT3D; else nStyle |= ItemStyle::DRAW_IN3D; - if ( ( nItemBits & SIB_AUTOSIZE ) == SIB_AUTOSIZE ) + if ( nItemBits & StatusBarItemBits::AutoSize ) nStyle |= ItemStyle::AUTO_SIZE; - if ( ( nItemBits & SIB_USERDRAW ) == SIB_USERDRAW ) + if ( nItemBits & StatusBarItemBits::UserDraw ) nStyle |= ItemStyle::OWNER_DRAW; return nStyle; diff --git a/framework/source/uielement/statusbarmanager.cxx b/framework/source/uielement/statusbarmanager.cxx index 0e3f094117cc..64ac4247fa2d 100644 --- a/framework/source/uielement/statusbarmanager.cxx +++ b/framework/source/uielement/statusbarmanager.cxx @@ -100,28 +100,28 @@ struct lcl_RemoveController : public std::unary_function< typename MAP::value_ty } }; -sal_uInt16 impl_convertItemStyleToItemBits( sal_Int16 nStyle ) +StatusBarItemBits impl_convertItemStyleToItemBits( sal_Int16 nStyle ) { - sal_uInt16 nItemBits( 0 ); + StatusBarItemBits nItemBits( StatusBarItemBits::NONE ); if (( nStyle & css::ui::ItemStyle::ALIGN_RIGHT ) == css::ui::ItemStyle::ALIGN_RIGHT ) - nItemBits |= SIB_RIGHT; + nItemBits |= StatusBarItemBits::Right; else if ( nStyle & css::ui::ItemStyle::ALIGN_LEFT ) - nItemBits |= SIB_LEFT; + nItemBits |= StatusBarItemBits::Left; else - nItemBits |= SIB_CENTER; + nItemBits |= StatusBarItemBits::Center; if (( nStyle & css::ui::ItemStyle::DRAW_FLAT ) == css::ui::ItemStyle::DRAW_FLAT ) - nItemBits |= SIB_FLAT; + nItemBits |= StatusBarItemBits::Flat; else if ( nStyle & css::ui::ItemStyle::DRAW_OUT3D ) - nItemBits |= SIB_OUT; + nItemBits |= StatusBarItemBits::Out; else - nItemBits |= SIB_IN; + nItemBits |= StatusBarItemBits::In; if (( nStyle & css::ui::ItemStyle::AUTO_SIZE ) == css::ui::ItemStyle::AUTO_SIZE ) - nItemBits |= SIB_AUTOSIZE; + nItemBits |= StatusBarItemBits::AutoSize; if ( nStyle & css::ui::ItemStyle::OWNER_DRAW ) - nItemBits |= SIB_USERDRAW; + nItemBits |= StatusBarItemBits::UserDraw; return nItemBits; } @@ -469,7 +469,7 @@ void StatusBarManager::FillStatusBar( const uno::Reference< container::XIndexAcc if (( nType == css::ui::ItemType::DEFAULT ) && !aCommandURL.isEmpty() ) { OUString aString( vcl::CommandInfoProvider::Instance().GetLabelForCommand(aCommandURL, m_xFrame)); - sal_uInt16 nItemBits( impl_convertItemStyleToItemBits( nStyle )); + StatusBarItemBits nItemBits( impl_convertItemStyleToItemBits( nStyle )); m_pStatusBar->InsertItem( nId, nWidth, nItemBits, nOffset ); m_pStatusBar->SetItemCommand( nId, aCommandURL ); diff --git a/framework/source/uielement/statusbarmerger.cxx b/framework/source/uielement/statusbarmerger.cxx index 68ca2c84966e..9459acc8e61b 100644 --- a/framework/source/uielement/statusbarmerger.cxx +++ b/framework/source/uielement/statusbarmerger.cxx @@ -78,18 +78,18 @@ void lcl_ConvertSequenceToValues( } } - sal_uInt16 nItemBits(0); + StatusBarItemBits nItemBits(StatusBarItemBits::NONE); if ( bAutoSize ) - nItemBits |= SIB_AUTOSIZE; + nItemBits |= StatusBarItemBits::AutoSize; if ( bOwnerDraw ) - nItemBits |= SIB_USERDRAW; + nItemBits |= StatusBarItemBits::UserDraw; if ( sAlignment == STATUSBAR_ALIGN_CENTER ) - nItemBits |= SIB_CENTER; + nItemBits |= StatusBarItemBits::Center; else if ( sAlignment == STATUSBAR_ALIGN_RIGHT ) - nItemBits |= SIB_RIGHT; + nItemBits |= StatusBarItemBits::Right; else // if unset, defaults to left alignment - nItemBits |= SIB_LEFT; + nItemBits |= StatusBarItemBits::Left; rItem.nItemBits = nItemBits; } |