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

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Sat Mar 2 15:53:07 UTC 2019


 vbahelper/source/vbahelper/vbacommandbarhelper.cxx |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

New commits:
commit 21233e29602e3a003b18bb0710e9be458bc27235
Author:     Tor Lillqvist <tml at collabora.com>
AuthorDate: Fri Mar 1 17:43:13 2019 +0200
Commit:     Tor Lillqvist <tml at collabora.com>
CommitDate: Sat Mar 2 16:52:46 2019 +0100

    Use comphelper::getProcessComponentContext()
    
    The context in the mxContext member does not seem to be usable for
    what we need it for here. Using what
    comphelper::getProcessComponentContext() returns works better. Let's
    hope it has no unintended side-effects.
    
    This likely makes the mxContext member unused, but I did not bother
    removing it yet, to keep this commit minimal.
    
    Change-Id: Ic048683b066af7952e2e84b03ea306e7daaba259
    Reviewed-on: https://gerrit.libreoffice.org/68592
    Tested-by: Jenkins
    Reviewed-by: Tor Lillqvist <tml at collabora.com>

diff --git a/vbahelper/source/vbahelper/vbacommandbarhelper.cxx b/vbahelper/source/vbahelper/vbacommandbarhelper.cxx
index 961288463c63..533f96713d18 100644
--- a/vbahelper/source/vbahelper/vbacommandbarhelper.cxx
+++ b/vbahelper/source/vbahelper/vbacommandbarhelper.cxx
@@ -28,6 +28,7 @@
 #include <com/sun/star/ui/UIElementType.hpp>
 #include <com/sun/star/ui/theWindowStateConfiguration.hpp>
 #include <comphelper/random.hxx>
+#include <comphelper/processfactory.hxx>
 #include <vbahelper/vbahelper.hxx>
 #include <rtl/ustrbuf.hxx>
 #include <sal/log.hxx>
@@ -110,12 +111,13 @@ void VbaCommandBarHelper::Init( )
         throw uno::RuntimeException( "Not implemented" );
     }
 
+    css::uno::Reference< css::uno::XComponentContext > xContext(comphelper::getProcessComponentContext());
     css::uno::Reference< css::ui::XModuleUIConfigurationManagerSupplier > xUICfgMgrSupp(
-        css::ui::theModuleUIConfigurationManagerSupplier::get(mxContext) );
+        css::ui::theModuleUIConfigurationManagerSupplier::get( xContext ) );
 
     m_xAppCfgMgr.set( xUICfgMgrSupp->getUIConfigurationManager( maModuleId ), uno::UNO_QUERY_THROW );
 
-    css::uno::Reference< css::container::XNameAccess > xNameAccess = css::ui::theWindowStateConfiguration::get( mxContext );
+    css::uno::Reference< css::container::XNameAccess > xNameAccess = css::ui::theWindowStateConfiguration::get( xContext );
 
     m_xWindowState.set( xNameAccess->getByName( maModuleId ), uno::UNO_QUERY_THROW );
 }


More information about the Libreoffice-commits mailing list