From cc180d4c943c6e5d5902f95594abb1acf0d5612c Mon Sep 17 00:00:00 2001 From: Juergen Schmidt Date: Thu, 4 Mar 2010 10:06:29 +0100 Subject: jsc330: #105478#: set Java system properties for https proxyaccording the office settings --- stoc/source/javavm/javavm.cxx | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) (limited to 'stoc') diff --git a/stoc/source/javavm/javavm.cxx b/stoc/source/javavm/javavm.cxx index 8042b70c9dd1..08926e261531 100644 --- a/stoc/source/javavm/javavm.cxx +++ b/stoc/source/javavm/javavm.cxx @@ -357,6 +357,23 @@ void getINetPropsFromConfig(stoc_javavm::JVM * pjvm, } } + // read https proxy name + css::uno::Reference httpsProxy_name = xRegistryRootKey->openKey(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Settings/ooInetHTTPSProxyName"))); + if(httpsProxy_name.is() && httpsProxy_name->getStringValue().getLength()) { + rtl::OUString httpsHost = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("https.proxyHost=")); + httpsHost += httpsProxy_name->getStringValue(); + + // read https proxy port + css::uno::Reference httpsProxy_port = xRegistryRootKey->openKey(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Settings/ooInetHTTPSProxyPort"))); + if(httpsProxy_port.is() && httpsProxy_port->getLongValue()) { + rtl::OUString httpsPort = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("https.proxyPort=")); + httpsPort += rtl::OUString::valueOf(httpsProxy_port->getLongValue()); + + pjvm->pushProp(httpsHost); + pjvm->pushProp(httpsPort); + } + } + // read nonProxyHosts css::uno::Reference nonProxies_name = xRegistryRootKey->openKey(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Settings/ooInetNoProxy"))); if(nonProxies_name.is() && nonProxies_name->getStringValue().getLength()) { @@ -1172,6 +1189,22 @@ void SAL_CALL JavaVirtualMachine::elementReplaced( rEvent.Element >>= n; aPropertyValue = rtl::OUString::valueOf(n); } + else if (aAccessor.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM( + "ooInetHTTPSProxyName"))) + { + aPropertyName = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( + "https.proxyHost")); + rEvent.Element >>= aPropertyValue; + } + else if (aAccessor.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM( + "ooInetHTTPSProxyPort"))) + { + aPropertyName + = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("https.proxyPort")); + sal_Int32 n = 0; + rEvent.Element >>= n; + aPropertyValue = rtl::OUString::valueOf(n); + } else if (aAccessor.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM( "ooInetFTPProxyName"))) { -- cgit