summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorobo <obo@openoffice.org>2010-06-22 11:08:42 +0200
committerobo <obo@openoffice.org>2010-06-22 11:08:42 +0200
commit5b564da1f38f1235b7dc1e18ac00f4825b1a9a4d (patch)
treeb7e0ba0805d60e1276b30bb8e67a60c51e541041
parent00d3dbcbe1840eb7639bacc05ed15a6afca12093 (diff)
parent09d3dcb10d4a4dc4afe6957d4307e57541f4d05e (diff)
CWS-TOOLING: integrate CWS fwk143
-rw-r--r--officecfg/registry/data/org/openoffice/Office/Common.xcu5
-rw-r--r--officecfg/registry/schema/org/openoffice/Office/Common.xcs13
-rw-r--r--sfx2/source/appl/appserv.cxx63
3 files changed, 73 insertions, 8 deletions
diff --git a/officecfg/registry/data/org/openoffice/Office/Common.xcu b/officecfg/registry/data/org/openoffice/Office/Common.xcu
index bb3c7795a4..28fd176c79 100644
--- a/officecfg/registry/data/org/openoffice/Office/Common.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/Common.xcu
@@ -157,6 +157,11 @@
<value install:module="wnt">WIN</value>
</prop>
</node>
+ <node oor:name="Dictionaries">
+ <prop oor:name="RepositoryURL" install:module="brand">
+ <value>${DICT_REPO_URL}</value>
+ </prop>
+ </node>
<node oor:name="AutoCorrect">
<prop oor:name="ReplaceSingleQuote" install:module="korea">
<value>true</value>
diff --git a/officecfg/registry/schema/org/openoffice/Office/Common.xcs b/officecfg/registry/schema/org/openoffice/Office/Common.xcs
index cb19bb01e1..02e05a9329 100644
--- a/officecfg/registry/schema/org/openoffice/Office/Common.xcs
+++ b/officecfg/registry/schema/org/openoffice/Office/Common.xcs
@@ -974,6 +974,19 @@
<value>false</value>
</prop>
</group>
+ <group oor:name="Dictionaries">
+ <info>
+ <author>CD</author>
+ <desc>Contains settings related to dictionaries.</desc>
+ </info>
+ <prop oor:name="RepositoryURL" oor:type="xs:string">
+ <info>
+ <author>CD</author>
+ <desc>Specifies a repository URL where users can download additional dictionaries.</desc>
+ </info>
+ <value/>
+ </prop>
+ </group>
<group oor:name="Drawinglayer">
<info>
<author>AW</author>
diff --git a/sfx2/source/appl/appserv.cxx b/sfx2/source/appl/appserv.cxx
index c079a5a5f0..2f4c757121 100644
--- a/sfx2/source/appl/appserv.cxx
+++ b/sfx2/source/appl/appserv.cxx
@@ -51,20 +51,15 @@
#include <com/sun/star/system/SystemShellExecuteFlags.hpp>
#include <com/sun/star/system/SystemShellExecuteException.hpp>
-#ifndef _UNOTOOLS_PROCESSFACTORY_HXX
#include <comphelper/processfactory.hxx>
-#endif
#include <comphelper/storagehelper.hxx>
+#include "comphelper/configurationhelper.hxx"
-#ifndef _SVT_DOC_ADDRESSTEMPLATE_HXX_
#include <svtools/addresstemplate.hxx>
-#endif
#include <svl/visitem.hxx>
#include <unotools/intlwrapper.hxx>
-#ifndef _UNOTOOLS_CONFIGMGR_HXX_
#include <unotools/configmgr.hxx>
-#endif
#include <tools/config.hxx>
#include <tools/diagnose_ex.h>
#include <vcl/msgbox.hxx>
@@ -90,6 +85,7 @@
#include <vos/process.hxx>
#include <rtl/bootstrap.hxx>
#include <cppuhelper/exc_hlp.hxx>
+#include <rtl/ustrbuf.hxx>
#include <com/sun/star/script/provider/XScriptProviderFactory.hpp>
#include <com/sun/star/frame/XModuleManager.hpp>
@@ -879,6 +875,31 @@ namespace
}
}
+static ::rtl::OUString getConfigurationStringValue(
+ const ::rtl::OUString& rPackage,
+ const ::rtl::OUString& rRelPath,
+ const ::rtl::OUString& rKey,
+ const ::rtl::OUString& rDefaultValue )
+{
+ ::rtl::OUString aDefVal( rDefaultValue );
+
+ try
+ {
+ ::comphelper::ConfigurationHelper::readDirectKey(
+ comphelper::getProcessServiceFactory(),
+ rPackage,
+ rRelPath,
+ rKey,
+ ::comphelper::ConfigurationHelper::E_READONLY) >>= aDefVal;
+ }
+ catch(const com::sun::star::uno::RuntimeException& exRun)
+ { throw exRun; }
+ catch(const com::sun::star::uno::Exception&)
+ {}
+
+ return aDefVal;
+}
+
void SfxApplication::OfaExec_Impl( SfxRequest& rReq )
{
DBG_MEMTEST();
@@ -924,8 +945,34 @@ void SfxApplication::OfaExec_Impl( SfxRequest& rReq )
uno::Reference< css::system::XSystemShellExecute > xSystemShell(
xSMGR->createInstance( DEFINE_CONST_UNICODE("com.sun.star.system.SystemShellExecute" ) ),
uno::UNO_QUERY_THROW );
- if ( xSystemShell.is() )
- xSystemShell->execute( DEFINE_CONST_UNICODE("http://extensions.services.openoffice.org/dictionary?cid=926385"), ::rtl::OUString(), css::system::SystemShellExecuteFlags::DEFAULTS );
+
+ // read repository URL from configuration
+ ::rtl::OUString sTemplRepoURL =
+ getConfigurationStringValue(
+ ::rtl::OUString::createFromAscii("org.openoffice.Office.Common"),
+ ::rtl::OUString::createFromAscii("Dictionaries"),
+ ::rtl::OUString::createFromAscii("RepositoryURL"),
+ ::rtl::OUString());
+
+ if ( xSystemShell.is() && sTemplRepoURL.getLength() > 0 )
+ {
+ ::rtl::OUStringBuffer aURLBuf( sTemplRepoURL );
+ aURLBuf.appendAscii( "?" );
+ aURLBuf.appendAscii( "lang=" );
+
+ // read locale from configuration
+ ::rtl::OUString sLocale = getConfigurationStringValue(
+ ::rtl::OUString::createFromAscii("org.openoffice.Setup"),
+ ::rtl::OUString::createFromAscii("L10N"),
+ ::rtl::OUString::createFromAscii("ooLocale"),
+ ::rtl::OUString::createFromAscii("en-US"));
+
+ aURLBuf.append( sLocale );
+ xSystemShell->execute(
+ aURLBuf.makeStringAndClear(),
+ ::rtl::OUString(),
+ css::system::SystemShellExecuteFlags::DEFAULTS );
+ }
}
catch( const ::com::sun::star::uno::Exception& )
{