summaryrefslogtreecommitdiff
path: root/cui
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2019-06-17 06:11:25 +0200
committerMike Kaganski <mike.kaganski@collabora.com>2019-06-17 07:50:56 +0200
commitabd059fcd81975e2e4f9188734fc8418299caf6b (patch)
treed28e0c7a2fb37580586796a8ab26a1be28160d3e /cui
parent0abdf307eae9bca36b3bdc26199e208ae2c1b5fa (diff)
Only call comphelper::getProcessComponentContext() once
Also remove useless initialization of eApp right before assigning a value to it. Change-Id: Ie52a280e2b8514870256ba0b7cdd52bd1532c3ac Reviewed-on: https://gerrit.libreoffice.org/74137 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'cui')
-rw-r--r--cui/source/customize/CustomNotebookbarGenerator.cxx11
1 files changed, 5 insertions, 6 deletions
diff --git a/cui/source/customize/CustomNotebookbarGenerator.cxx b/cui/source/customize/CustomNotebookbarGenerator.cxx
index 40fbe9012183..a1aa63bca568 100644
--- a/cui/source/customize/CustomNotebookbarGenerator.cxx
+++ b/cui/source/customize/CustomNotebookbarGenerator.cxx
@@ -231,15 +231,14 @@ void CustomNotebookbarGenerator::modifyCustomizedUIFile(Sequence<OUString> sUIIt
void CustomNotebookbarGenerator::getFileNameAndAppName(OUString& sAppName,
OUString& sNotebookbarUIFileName)
{
- utl::OConfigurationTreeRoot aRoot(::comphelper::getProcessComponentContext(),
- "org.openoffice.Office.UI.ToolbarMode/", false);
+ const auto xContext = comphelper::getProcessComponentContext();
+ utl::OConfigurationTreeRoot aRoot(xContext, "org.openoffice.Office.UI.ToolbarMode/", false);
const Reference<frame::XFrame>& xFrame
= SfxViewFrame::Current()->GetFrame().GetFrameInterface();
- const Reference<frame::XModuleManager> xModuleManager
- = frame::ModuleManager::create(::comphelper::getProcessComponentContext());
+ const Reference<frame::XModuleManager> xModuleManager = frame::ModuleManager::create(xContext);
- vcl::EnumContext::Application eApp = vcl::EnumContext::Application::Any;
- eApp = vcl::EnumContext::GetApplicationEnum(xModuleManager->identify(xFrame));
+ vcl::EnumContext::Application eApp
+ = vcl::EnumContext::GetApplicationEnum(xModuleManager->identify(xFrame));
OUString sActiveAppName(lcl_activeAppName(eApp));
sAppName = lcl_getAppName(eApp);
const Any aValue = aRoot.getNodeValue(sActiveAppName);