summaryrefslogtreecommitdiff
path: root/framework/source
diff options
context:
space:
mode:
authorSzymon Kłos <eszkadev@gmail.com>2016-09-21 15:28:26 +0200
committerSamuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>2016-09-22 09:02:48 +0000
commitaf3df5340d5d1a26b0d031b03c85cf715ef6ad57 (patch)
treebb44ed5e13fe5a75b3377e1fe83d15193387feeb /framework/source
parentd749277ac0e035a9e34351faa28fcb4201ccfb81 (diff)
Notebookbar: separate .ui files settings for each module
* each module have own list of implementations * deleted placeholder .ui files from Calc and Impress Change-Id: Ib7d4cafbb332447e769ca753003d31e9f3025f0a Reviewed-on: https://gerrit.libreoffice.org/29143 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
Diffstat (limited to 'framework/source')
-rw-r--r--framework/source/uielement/notebookbarmenucontroller.cxx30
1 files changed, 25 insertions, 5 deletions
diff --git a/framework/source/uielement/notebookbarmenucontroller.cxx b/framework/source/uielement/notebookbarmenucontroller.cxx
index c5de77f306b5..7173356fe92b 100644
--- a/framework/source/uielement/notebookbarmenucontroller.cxx
+++ b/framework/source/uielement/notebookbarmenucontroller.cxx
@@ -84,9 +84,29 @@ void NotebookbarMenuController::fillPopupMenu( Reference< css::awt::XPopupMenu >
SolarMutexGuard aSolarMutexGuard;
resetPopupMenu( rPopupMenu );
+ const Reference<frame::XModuleManager> xModuleManager = frame::ModuleManager::create( m_xContext );
+ vcl::EnumContext::Application eApp = vcl::EnumContext::GetApplicationEnum(xModuleManager->identify(m_xFrame));
+
+ OUStringBuffer aPath("org.openoffice.Office.UI.Notebookbar/Applications/");
+ switch ( eApp )
+ {
+ case vcl::EnumContext::Application::Application_Writer:
+ aPath.append("Writer");
+ break;
+ case vcl::EnumContext::Application::Application_Calc:
+ aPath.append("Calc");
+ break;
+ case vcl::EnumContext::Application::Application_Impress:
+ aPath.append("Impress");
+ break;
+ default:
+ break;
+ }
+ aPath.append("/Implementations");
+
const utl::OConfigurationTreeRoot aImplementationsNode(
m_xContext,
- OUString("org.openoffice.Office.UI.Notebookbar/Implementations"),
+ OUString( aPath.makeStringAndClear() ),
false);
if ( !aImplementationsNode.isValid() )
return;
@@ -222,7 +242,7 @@ void SAL_CALL NotebookbarMenuController::itemSelected( const css::awt::MenuEvent
void SAL_CALL NotebookbarMenuController::itemActivated( const css::awt::MenuEvent& ) throw (RuntimeException, std::exception)
{
- OUString aActive = officecfg::Office::UI::Notebookbar::Active::get( m_xContext );
+ OUString aActive;
const Reference<frame::XModuleManager> xModuleManager = frame::ModuleManager::create( m_xContext );
vcl::EnumContext::Application eApp = vcl::EnumContext::GetApplicationEnum(xModuleManager->identify(m_xFrame));
@@ -232,15 +252,15 @@ void SAL_CALL NotebookbarMenuController::itemActivated( const css::awt::MenuEven
{
case vcl::EnumContext::Application::Application_Writer:
aPath.append("Writer");
+ aActive = officecfg::Office::UI::Notebookbar::ActiveWriter::get( m_xContext );
break;
case vcl::EnumContext::Application::Application_Calc:
aPath.append("Calc");
+ aActive = officecfg::Office::UI::Notebookbar::ActiveCalc::get( m_xContext );
break;
case vcl::EnumContext::Application::Application_Impress:
aPath.append("Impress");
- break;
- case vcl::EnumContext::Application::Application_Draw:
- aPath.append("Draw");
+ aActive = officecfg::Office::UI::Notebookbar::ActiveImpress::get( m_xContext );
break;
default:
break;