[Libreoffice-commits] core.git: cui/source

Mike Kaganski (via logerrit) logerrit at kemper.freedesktop.org
Mon Jun 17 05:51:36 UTC 2019


 cui/source/customize/CustomNotebookbarGenerator.cxx |   11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

New commits:
commit abd059fcd81975e2e4f9188734fc8418299caf6b
Author:     Mike Kaganski <mike.kaganski at collabora.com>
AuthorDate: Mon Jun 17 06:11:25 2019 +0200
Commit:     Mike Kaganski <mike.kaganski at collabora.com>
CommitDate: Mon Jun 17 07:50:56 2019 +0200

    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 at collabora.com>

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);


More information about the Libreoffice-commits mailing list