diff options
author | Noel Grandin <noel@peralex.com> | 2014-12-20 16:21:21 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2015-01-06 10:59:40 +0200 |
commit | bae855e667993ea6cddd551452c6e2fa60bdc2f3 (patch) | |
tree | 6ddf4f5d003ce53e9855cbe260851ef00ffa69ca /framework | |
parent | 9b45157ab20c9b158a1ef8f4f364d7a46d9c276b (diff) |
fdo#84938: replace BUTTONTYPE_ constants with 'enum class'
Change-Id: I54f9019297913683605b5aea9f79b3defc1dcc13
Diffstat (limited to 'framework')
-rw-r--r-- | framework/inc/uielement/uielement.hxx | 6 | ||||
-rw-r--r-- | framework/source/layoutmanager/layoutmanager.cxx | 2 | ||||
-rw-r--r-- | framework/source/layoutmanager/toolbarlayoutmanager.cxx | 4 |
3 files changed, 5 insertions, 7 deletions
diff --git a/framework/inc/uielement/uielement.hxx b/framework/inc/uielement/uielement.hxx index 49ddd1bf9842..bbec95ab92ba 100644 --- a/framework/inc/uielement/uielement.hxx +++ b/framework/inc/uielement/uielement.hxx @@ -68,7 +68,7 @@ struct UIElement m_bNoClose( false ), m_bSoftClose( false ), m_bStateRead( false ), - m_nStyle( BUTTON_SYMBOL ) + m_nStyle( ButtonType::SYMBOLONLY ) {} UIElement( const OUString& rName, @@ -89,7 +89,7 @@ struct UIElement m_bNoClose( false ), m_bSoftClose( false ), m_bStateRead( false ), - m_nStyle( BUTTON_SYMBOL ) {} + m_nStyle( ButtonType::SYMBOLONLY ) {} bool operator< ( const UIElement& aUIElement ) const; UIElement& operator=( const UIElement& rUIElement ); @@ -109,7 +109,7 @@ struct UIElement bool m_bNoClose, m_bSoftClose, m_bStateRead; - sal_Int16 m_nStyle; + ButtonType m_nStyle; DockedData m_aDockedData; FloatingData m_aFloatingData; }; diff --git a/framework/source/layoutmanager/layoutmanager.cxx b/framework/source/layoutmanager/layoutmanager.cxx index 245b5b07da36..d1d5dbc5d4d5 100644 --- a/framework/source/layoutmanager/layoutmanager.cxx +++ b/framework/source/layoutmanager/layoutmanager.cxx @@ -552,7 +552,7 @@ bool LayoutManager::readWindowStateData( const OUString& aName, UIElement& rElem { sal_Int32 nStyle = 0; if ( aWindowState[n].Value >>= nStyle ) - rElementData.m_nStyle = sal_Int16( nStyle ); + rElementData.m_nStyle = static_cast<ButtonType>( nStyle ); } else if ( aWindowState[n].Name == WINDOWSTATE_PROPERTY_LOCKED ) { diff --git a/framework/source/layoutmanager/toolbarlayoutmanager.cxx b/framework/source/layoutmanager/toolbarlayoutmanager.cxx index b044bad39c7e..4a793ddc7a9c 100644 --- a/framework/source/layoutmanager/toolbarlayoutmanager.cxx +++ b/framework/source/layoutmanager/toolbarlayoutmanager.cxx @@ -1422,8 +1422,6 @@ void ToolbarLayoutManager::implts_setElementData( UIElement& rElement, const uno } if ( pToolBox ) { - if (( rElement.m_nStyle < 0 ) || ( rElement.m_nStyle > BUTTON_SYMBOLTEXT )) - rElement.m_nStyle = BUTTON_SYMBOL; pToolBox->SetButtonType( (ButtonType)rElement.m_nStyle ); if ( rElement.m_bNoClose ) pToolBox->SetFloatStyle( pToolBox->GetFloatStyle() & ~WB_CLOSEABLE ); @@ -1604,7 +1602,7 @@ void ToolbarLayoutManager::implts_writeWindowStateData( const UIElement& rElemen aWindowState[7].Name = WINDOWSTATE_PROPERTY_LOCKED; aWindowState[7].Value = uno::makeAny( rElementData.m_aDockedData.m_bLocked ); aWindowState[8].Name = WINDOWSTATE_PROPERTY_STYLE; - aWindowState[8].Value = uno::makeAny( rElementData.m_nStyle ); + aWindowState[8].Value = uno::makeAny( static_cast<sal_uInt16>(rElementData.m_nStyle) ); OUString aName = rElementData.m_aName; if ( xPersistentWindowState->hasByName( aName )) |