diff options
author | Tor Lillqvist <tml@collabora.com> | 2019-03-01 17:43:13 +0200 |
---|---|---|
committer | Tor Lillqvist <tml@collabora.com> | 2019-03-02 16:52:46 +0100 |
commit | 21233e29602e3a003b18bb0710e9be458bc27235 (patch) | |
tree | a4fba89d5c7cbe011b12855bb713b5874b8132dd /vbahelper | |
parent | fbee19602e5f530f25b4d2fe01e73bf5946cfe4d (diff) |
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@collabora.com>
Diffstat (limited to 'vbahelper')
-rw-r--r-- | vbahelper/source/vbahelper/vbacommandbarhelper.cxx | 6 |
1 files changed, 4 insertions, 2 deletions
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 ); } |