diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2012-02-20 13:35:57 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2012-02-20 13:36:47 +0100 |
commit | 55892c6bd740fa0c667656cbb246327f2bb76007 (patch) | |
tree | 26dd25b44b25d4bb2c520f10957b66467dde1114 /desktop | |
parent | 65a3ec97b5032d1748c8f84eeb0b8656e1c25918 (diff) |
Clean up work around spurious warning about missing JRE
Diffstat (limited to 'desktop')
-rw-r--r-- | desktop/source/deployment/registry/help/dp_help.cxx | 35 |
1 files changed, 30 insertions, 5 deletions
diff --git a/desktop/source/deployment/registry/help/dp_help.cxx b/desktop/source/deployment/registry/help/dp_help.cxx index adc2875330f9..b5250cc120a9 100644 --- a/desktop/source/deployment/registry/help/dp_help.cxx +++ b/desktop/source/deployment/registry/help/dp_help.cxx @@ -37,8 +37,9 @@ #include "ucbhelper/content.hxx" #include "comphelper/servicedecl.hxx" #include "svl/inettype.hxx" -#include "unotools/pathoptions.hxx" +#include "svtools/javainteractionhandler.hxx" #include "uno/current_context.hxx" +#include "unotools/pathoptions.hxx" #if !defined(ANDROID) && !defined(IOS) #include <l10ntools/compilehelp.hxx> @@ -61,6 +62,29 @@ namespace backend { namespace help { namespace { +// A current context that filters out java-vm.interaction-handler: +class NonJavaCurrentContext: public cppu::WeakImplHelper1< XCurrentContext > { +public: + NonJavaCurrentContext(Reference< XCurrentContext > const & parent): + parent_(parent) {} + + virtual Any SAL_CALL getValueByName(rtl::OUString const & Name) + throw (RuntimeException); + +private: + Reference< XCurrentContext > parent_; +}; + +Any NonJavaCurrentContext::getValueByName(rtl::OUString const & Name) + throw (RuntimeException) +{ + return + (Name.equalsAsciiL( + RTL_CONSTASCII_STRINGPARAM(JAVA_INTERACTION_HANDLER_NAME)) + || !parent_.is()) + ? Any() : parent_->getValueByName(Name); +} + //============================================================================== class BackendImpl : public ::dp_registry::backend::PackageRegistryBackend { @@ -421,10 +445,11 @@ void BackendImpl::implProcessHelp( Reference< script::XInvocation > xInvocation; if( xContext.is() ) { - // Ignore the missing JRE scenario on upgrade/first-start without - // horrible end-user warnings that are ignorable,and cause grief. - Reference< XCurrentContext > xNoContext; - com::sun::star::uno::ContextLayer dummyLayer( xNoContext ); + // Ignore the missing JRE scenario on upgrade/first-start + // without horrible end-user warnings that are ignorable, + // and cause grief: + ContextLayer l( + new NonJavaCurrentContext(getCurrentContext())); try { xInvocation = Reference< script::XInvocation >( |