diff options
author | Carsten Driesner <cd@openoffice.org> | 2009-10-30 17:29:27 +0100 |
---|---|---|
committer | Carsten Driesner <cd@openoffice.org> | 2009-10-30 17:29:27 +0100 |
commit | d76b686cf064df423f85adf591b93fffa405fb01 (patch) | |
tree | 0bb63dcc7925e29374dd253181197d43b26d85c3 /framework | |
parent | e92917d1bc75f095222ec757f0006b8ef6883a9b (diff) |
#i89394# StartCenter now adds the Office locale as an argument to the URLs
Diffstat (limited to 'framework')
-rw-r--r-- | framework/source/services/backingwindow.cxx | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/framework/source/services/backingwindow.cxx b/framework/source/services/backingwindow.cxx index 40e4a9f7a6b9..39506c6a6556 100644 --- a/framework/source/services/backingwindow.cxx +++ b/framework/source/services/backingwindow.cxx @@ -49,6 +49,7 @@ #include "comphelper/processfactory.hxx" #include "comphelper/sequenceashashmap.hxx" +#include "comphelper/configurationhelper.hxx" #include "rtl/strbuf.hxx" #include "rtl/ustrbuf.hxx" @@ -738,6 +739,41 @@ IMPL_LINK( BackingWindow, ToolboxHdl, void*, EMPTYARG ) Any value( xNameAccess->getByName(rtl::OUString::createFromAscii(pNode)) ); sURL = value.get<rtl::OUString> (); + // extend the URLs with Office locale argument + INetURLObject aURLObj( sURL ); + + rtl::OUString sParam = aURLObj.GetParam(); + rtl::OUStringBuffer aURLBuf( sParam ); + if ( sParam.getLength() > 0 ) + aURLBuf.appendAscii( "&" ); + aURLBuf.appendAscii( "lang=" ); + + // read locale from configuration + ::rtl::OUString sLocale; + ::rtl::OUString sPackage = ::rtl::OUString::createFromAscii("org.openoffice.Setup"); + ::rtl::OUString sRelPath = ::rtl::OUString::createFromAscii("L10N"); + ::rtl::OUString sKey = ::rtl::OUString::createFromAscii("ooLocale"); + + try + { + ::comphelper::ConfigurationHelper::readDirectKey(comphelper::getProcessServiceFactory(), + sPackage, + sRelPath, + sKey, + ::comphelper::ConfigurationHelper::E_READONLY) >>= sLocale; + } + catch(const com::sun::star::uno::RuntimeException& exRun) + { throw exRun; } + catch(const com::sun::star::uno::Exception&) + { sLocale = ::rtl::OUString::createFromAscii("en-US"); } + + aURLBuf.append(sLocale); + + sParam = aURLBuf.makeStringAndClear(); + + aURLObj.SetParam( sParam ); + sURL = aURLObj.GetMainURL( INetURLObject::NO_DECODE ); + Reference< com::sun::star::system::XSystemShellExecute > xSystemShellExecute( comphelper::getProcessServiceFactory()->createInstance( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.system.SystemShellExecute" ) ) ), |