diff options
-rw-r--r-- | framework/inc/uiconfiguration/globalsettings.hxx | 11 | ||||
-rw-r--r-- | framework/source/layoutmanager/layoutmanager.cxx | 6 | ||||
-rw-r--r-- | framework/source/uiconfiguration/globalsettings.cxx | 24 |
3 files changed, 13 insertions, 28 deletions
diff --git a/framework/inc/uiconfiguration/globalsettings.hxx b/framework/inc/uiconfiguration/globalsettings.hxx index 2609647989db..7123836958ec 100644 --- a/framework/inc/uiconfiguration/globalsettings.hxx +++ b/framework/inc/uiconfiguration/globalsettings.hxx @@ -44,13 +44,6 @@ class GlobalSettings GlobalSettings( const css::uno::Reference< css::uno::XComponentContext >& rxContext ); ~GlobalSettings(); - enum UIElementType - { - UIELEMENT_TYPE_TOOLBAR, - UIELEMENT_TYPE_DOCKWINDOW, - UIELEMENT_TYPE_STATUSBAR - }; - enum StateInfo { STATEINFO_LOCKED, @@ -58,8 +51,8 @@ class GlobalSettings }; // settings access - bool HasStatesInfo( UIElementType eElementType ); - bool GetStateInfo( UIElementType eElementType, StateInfo eStateInfo, css::uno::Any& aValue ); + bool HasToolbarStatesInfo(); + bool GetToolbarStateInfo( StateInfo eStateInfo, css::uno::Any& aValue ); private: GlobalSettings(const GlobalSettings&) = delete; diff --git a/framework/source/layoutmanager/layoutmanager.cxx b/framework/source/layoutmanager/layoutmanager.cxx index 2f9f88160cd6..425b57879739 100644 --- a/framework/source/layoutmanager/layoutmanager.cxx +++ b/framework/source/layoutmanager/layoutmanager.cxx @@ -584,18 +584,18 @@ bool LayoutManager::readWindowStateData( const OUString& aName, UIElement& rElem // oversteer values with global settings if ( pGlobalSettings && ( bGetSettingsState || bGlobalSettings )) { - if ( pGlobalSettings->HasStatesInfo( GlobalSettings::UIELEMENT_TYPE_TOOLBAR )) + if ( pGlobalSettings->HasToolbarStatesInfo()) { SolarMutexClearableGuard aWriteLock2; bInGlobalSettings = true; aWriteLock2.clear(); uno::Any aValue; - if ( pGlobalSettings->GetStateInfo( GlobalSettings::UIELEMENT_TYPE_TOOLBAR, + if ( pGlobalSettings->GetToolbarStateInfo( GlobalSettings::STATEINFO_LOCKED, aValue )) aValue >>= rElementData.m_aDockedData.m_bLocked; - if ( pGlobalSettings->GetStateInfo( GlobalSettings::UIELEMENT_TYPE_TOOLBAR, + if ( pGlobalSettings->GetToolbarStateInfo( GlobalSettings::STATEINFO_DOCKED, aValue )) { diff --git a/framework/source/uiconfiguration/globalsettings.cxx b/framework/source/uiconfiguration/globalsettings.cxx index c5e8e2b3710b..94df703b3140 100644 --- a/framework/source/uiconfiguration/globalsettings.cxx +++ b/framework/source/uiconfiguration/globalsettings.cxx @@ -60,8 +60,8 @@ class GlobalSettings_Access : public ::cppu::WeakImplHelper< virtual void SAL_CALL disposing( const css::lang::EventObject& Source ) override; // settings access - bool HasStatesInfo( GlobalSettings::UIElementType eElementType ); - bool GetStateInfo( GlobalSettings::UIElementType eElementType, GlobalSettings::StateInfo eStateInfo, css::uno::Any& aValue ); + bool HasToolbarStatesInfo(); + bool GetToolbarStateInfo( GlobalSettings::StateInfo eStateInfo, css::uno::Any& aValue ); private: void impl_initConfigAccess(); @@ -112,13 +112,9 @@ void SAL_CALL GlobalSettings_Access::disposing( const css::lang::EventObject& ) } // settings access -bool GlobalSettings_Access::HasStatesInfo( GlobalSettings::UIElementType eElementType ) +bool GlobalSettings_Access::HasToolbarStatesInfo() { osl::MutexGuard g(m_mutex); - if ( eElementType == GlobalSettings::UIELEMENT_TYPE_DOCKWINDOW ) - return false; - else if ( eElementType == GlobalSettings::UIELEMENT_TYPE_STATUSBAR ) - return false; if ( m_bDisposed ) return false; @@ -150,13 +146,9 @@ bool GlobalSettings_Access::HasStatesInfo( GlobalSettings::UIElementType eElemen return false; } -bool GlobalSettings_Access::GetStateInfo( GlobalSettings::UIElementType eElementType, GlobalSettings::StateInfo eStateInfo, css::uno::Any& aValue ) +bool GlobalSettings_Access::GetToolbarStateInfo( GlobalSettings::StateInfo eStateInfo, css::uno::Any& aValue ) { osl::MutexGuard g(m_mutex); - if ( eElementType == GlobalSettings::UIELEMENT_TYPE_DOCKWINDOW ) - return false; - else if ( eElementType == GlobalSettings::UIELEMENT_TYPE_STATUSBAR ) - return false; if ( m_bDisposed ) return false; @@ -257,22 +249,22 @@ GlobalSettings::~GlobalSettings() } // settings access -bool GlobalSettings::HasStatesInfo( UIElementType eElementType ) +bool GlobalSettings::HasToolbarStatesInfo() { GlobalSettings_Access* pSettings( GetGlobalSettings( m_xContext )); if ( pSettings ) - return pSettings->HasStatesInfo( eElementType ); + return pSettings->HasToolbarStatesInfo(); else return false; } -bool GlobalSettings::GetStateInfo( UIElementType eElementType, StateInfo eStateInfo, css::uno::Any& aValue ) +bool GlobalSettings::GetToolbarStateInfo( StateInfo eStateInfo, css::uno::Any& aValue ) { GlobalSettings_Access* pSettings( GetGlobalSettings( m_xContext )); if ( pSettings ) - return pSettings->GetStateInfo( eElementType, eStateInfo, aValue ); + return pSettings->GetToolbarStateInfo( eStateInfo, aValue ); else return false; } |