diff options
author | Caolán McNamara <caolanm@redhat.com> | 2012-03-26 09:55:29 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2012-03-26 12:36:35 +0100 |
commit | adf7d6e17334391459343d1f96c152872ce6e704 (patch) | |
tree | ed4ed12449fb1a60924c51b72d8ca0a7ec80eba5 | |
parent | e443216ce2eeb2d4c7463bb019eed32f5ca4ad1c (diff) |
configuration checked before component context exists
in simple applications, e.g. spadmin, which don't have a custom main, then this
configuration check happens too early before Application::Main gets run to have
a chance to set the ProcessComponentContext.
-rw-r--r-- | vcl/unx/generic/plugadapt/salplug.cxx | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/vcl/unx/generic/plugadapt/salplug.cxx b/vcl/unx/generic/plugadapt/salplug.cxx index 6bc7d89390f7..b92c8c750e21 100644 --- a/vcl/unx/generic/plugadapt/salplug.cxx +++ b/vcl/unx/generic/plugadapt/salplug.cxx @@ -28,6 +28,8 @@ #include "officecfg/Office/Common.hxx" +#include "comphelper/processfactory.hxx" + #include "osl/module.h" #include "osl/process.h" @@ -54,11 +56,14 @@ static SalInstance* tryInstance( const OUString& rModuleBase, bool bForce = fals { SalInstance* pInst = NULL; #if !defined(ANDROID) - // Disable gtk3 plugin load except in experimental mode for now. - if( !bForce && - rModuleBase.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "gtk3" ) ) && - !officecfg::Office::Common::Misc::ExperimentalMode::get() ) - return NULL; + if (!bForce && rModuleBase.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("gtk3"))) + { + // Disable gtk3 plugin load except in experimental mode for now. + using namespace com::sun::star; + uno::Reference< uno::XComponentContext > xContext = comphelper::getProcessComponentContext(); + if (!xContext.is() || !officecfg::Office::Common::Misc::ExperimentalMode::get(xContext)) + return NULL; + } #endif OUStringBuffer aModName( 128 ); aModName.appendAscii( SAL_DLLPREFIX"vclplug_" ); |