summaryrefslogtreecommitdiff
path: root/desktop
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2012-02-20 13:35:57 +0100
committerPetr Mladek <pmladek@suse.cz>2012-02-20 15:00:04 +0100
commitc97a01d009f8b5f686998f3638cff25e228a1305 (patch)
treebe03a6e0393c58ff959df1447dbf760a52b0bb0b /desktop
parent5004de693a95ba3678ec41f25bb55beef4a32ed1 (diff)
Clean up work around spurious warning about missing JRE
Signed-off-by: Petr Mladek <pmladek@suse.cz>
Diffstat (limited to 'desktop')
-rw-r--r--desktop/source/deployment/registry/help/dp_help.cxx35
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 ba1009c25379..43762f266e95 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"
#include <l10ntools/compilehelp.hxx>
#include <com/sun/star/ucb/XSimpleFileAccess.hpp>
@@ -59,6 +60,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
{
@@ -418,10 +442,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 >(