[Libreoffice-commits] .: desktop/source

Stephan Bergmann sbergmann at kemper.freedesktop.org
Mon Feb 20 04:37:52 PST 2012


 desktop/source/deployment/registry/help/dp_help.cxx |   35 +++++++++++++++++---
 1 file changed, 30 insertions(+), 5 deletions(-)

New commits:
commit 55892c6bd740fa0c667656cbb246327f2bb76007
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Mon Feb 20 13:35:57 2012 +0100

    Clean up work around spurious warning about missing JRE

diff --git a/desktop/source/deployment/registry/help/dp_help.cxx b/desktop/source/deployment/registry/help/dp_help.cxx
index adc2875..b5250cc 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 >(


More information about the Libreoffice-commits mailing list