diff options
author | Maxim Monastirsky <momonasmon@gmail.com> | 2015-11-03 18:33:43 +0200 |
---|---|---|
committer | Maxim Monastirsky <momonasmon@gmail.com> | 2015-11-03 22:11:35 +0200 |
commit | 0c6305a01f13f5c09dc4c000d5b250319fffe0e4 (patch) | |
tree | 69cece883de7691231a49301625bf4ccde41addb /framework/source/uiconfiguration | |
parent | 281be263619a8e513a26e6a9165d1d77cf6524ea (diff) |
Support of popupmenu resource type
Reusing the same xml format as the menubar, except that
a popup menu use menu:menupopup as the root element.
Change-Id: I2987af0dc698b09aeeb757cff828617515bc3009
Diffstat (limited to 'framework/source/uiconfiguration')
-rw-r--r-- | framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx | 13 | ||||
-rw-r--r-- | framework/source/uiconfiguration/uiconfigurationmanager.cxx | 10 |
2 files changed, 11 insertions, 12 deletions
diff --git a/framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx b/framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx index 9f9999e414ee..fc1134452fd7 100644 --- a/framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx +++ b/framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx @@ -64,6 +64,7 @@ using namespace framework; #define RESOURCETYPE_MENUBAR "menubar" #define RESOURCETYPE_TOOLBAR "toolbar" #define RESOURCETYPE_STATUSBAR "statusbar" +#define RESOURCETYPE_POPUPMENU "popupmenu" namespace { @@ -429,6 +430,7 @@ void ModuleUIConfigurationManager::impl_requestUIElementData( sal_Int16 nElement break; case css::ui::UIElementType::MENUBAR: + case css::ui::UIElementType::POPUPMENU: { try { @@ -447,11 +449,6 @@ void ModuleUIConfigurationManager::impl_requestUIElementData( sal_Int16 nElement } break; - case css::ui::UIElementType::POPUPMENU: - { - break; - } - case css::ui::UIElementType::TOOLBAR: { try @@ -570,11 +567,13 @@ void ModuleUIConfigurationManager::impl_storeElementTypeData( Reference< XStorag switch( rElementType.nElementType ) { case css::ui::UIElementType::MENUBAR: + case css::ui::UIElementType::POPUPMENU: { try { MenuConfiguration aMenuCfg( m_xContext ); - aMenuCfg.StoreMenuBarConfigurationToXML( rElement.xSettings, xOutputStream ); + aMenuCfg.StoreMenuBarConfigurationToXML( + rElement.xSettings, xOutputStream, rElementType.nElementType == css::ui::UIElementType::MENUBAR ); } catch ( const css::lang::WrappedTargetException& ) { @@ -891,6 +890,8 @@ ModuleUIConfigurationManager::ModuleUIConfigurationManager( aResourceType = RESOURCETYPE_TOOLBAR; else if ( i == css::ui::UIElementType::STATUSBAR ) aResourceType = RESOURCETYPE_STATUSBAR; + else if ( i == css::ui::UIElementType::POPUPMENU ) + aResourceType = RESOURCETYPE_POPUPMENU; if ( !aResourceType.isEmpty() ) { diff --git a/framework/source/uiconfiguration/uiconfigurationmanager.cxx b/framework/source/uiconfiguration/uiconfigurationmanager.cxx index 0451b6732a0a..cb958b26f900 100644 --- a/framework/source/uiconfiguration/uiconfigurationmanager.cxx +++ b/framework/source/uiconfiguration/uiconfigurationmanager.cxx @@ -347,6 +347,7 @@ void UIConfigurationManager::impl_requestUIElementData( sal_Int16 nElementType, break; case css::ui::UIElementType::MENUBAR: + case css::ui::UIElementType::POPUPMENU: { try { @@ -365,11 +366,6 @@ void UIConfigurationManager::impl_requestUIElementData( sal_Int16 nElementType, } break; - case css::ui::UIElementType::POPUPMENU: - { - break; - } - case css::ui::UIElementType::TOOLBAR: { try @@ -479,11 +475,13 @@ void UIConfigurationManager::impl_storeElementTypeData( Reference< XStorage >& x switch( rElementType.nElementType ) { case css::ui::UIElementType::MENUBAR: + case css::ui::UIElementType::POPUPMENU: { try { MenuConfiguration aMenuCfg( m_xContext ); - aMenuCfg.StoreMenuBarConfigurationToXML( rElement.xSettings, xOutputStream ); + aMenuCfg.StoreMenuBarConfigurationToXML( + rElement.xSettings, xOutputStream, rElementType.nElementType == css::ui::UIElementType::MENUBAR ); } catch ( const css::lang::WrappedTargetException& ) { |