From c0ad15ac442231e42e5086c0ba61539b5fd4ad43 Mon Sep 17 00:00:00 2001 From: Thorsten Behrens Date: Thu, 7 Oct 2010 12:29:38 +0200 Subject: [PATCH] Webservice URLs now point to documentfoundation Changed places referencing OOo webservices to refer to *.documentfoundation.org instead. Also, append coutry string to URL. Consolidated all places that did this country string appending into svtools/langhelp helper method. --- svtools/inc/svtools/langhelp.hxx | 42 ++++++++++++++++++++++++++++ svtools/source/contnr/templwin.cxx | 4 ++- svtools/source/misc/langhelp.cxx | 44 ++++++++++++++++++++++++++++++ svtools/source/misc/makefile.mk | 1 + 4 files changed, 90 insertions(+), 1 deletion(-) create mode 100644 svtools/inc/svtools/langhelp.hxx create mode 100644 svtools/source/misc/langhelp.cxx diff --git a/svtools/inc/svtools/langhelp.hxx b/svtools/inc/svtools/langhelp.hxx new file mode 100644 index 000000000000..038941828aa0 --- /dev/null +++ b/svtools/inc/svtools/langhelp.hxx @@ -0,0 +1,42 @@ +/************************************************************************* + * + * Copyright 2010 Novell, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * or later, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _SVTOOLS_LANGHELP_HXX_ +#define _SVTOOLS_LANGHELP_HXX_ + +#include + +namespace rtl { class OUString; } + +/** Localize a URI to one of the foundation's webservices + + @param io_rURI + URI to localize - depending on your UI locale, a country local + part is appended to the URI (like "en", or "fr", or "es") + */ +SVT_DLLPUBLIC void localizeWebserviceURI( ::rtl::OUString& io_rURI ); + +#endif + diff --git a/svtools/source/contnr/templwin.cxx b/svtools/source/contnr/templwin.cxx index ef9c6d5cc9e5..1df508092d52 100644 --- a/svtools/source/contnr/templwin.cxx +++ b/svtools/source/contnr/templwin.cxx @@ -30,6 +30,7 @@ #include "templwin.hxx" #include "templdlg.hxx" #include +#include #include #include #include @@ -1739,7 +1740,7 @@ void SvtDocumentTemplateDialog::InitImpl( ) if ( !bHideLink ) { aMoreTemplatesLink.SetURL( String( - RTL_CONSTASCII_STRINGPARAM( "http://templates.services.openoffice.org/?cid=923508" ) ) ); + RTL_CONSTASCII_STRINGPARAM( "http://templates.documentfoundation.org/" ) ) ); aMoreTemplatesLink.SetClickHdl( LINK( this, SvtDocumentTemplateDialog, OpenLinkHdl_Impl ) ); } else @@ -1988,6 +1989,7 @@ IMPL_LINK ( SvtDocumentTemplateDialog, OpenLinkHdl_Impl, svt::FixedHyperlink*, E ::rtl::OUString sURL( aMoreTemplatesLink.GetURL() ); if ( sURL.getLength() > 0 ) { + localizeWebserviceURI(sURL); try { uno::Reference< lang::XMultiServiceFactory > xSMGR = diff --git a/svtools/source/misc/langhelp.cxx b/svtools/source/misc/langhelp.cxx new file mode 100644 index 000000000000..cbda7f861273 --- /dev/null +++ b/svtools/source/misc/langhelp.cxx @@ -0,0 +1,44 @@ +/************************************************************************* + * + * Copyright 2010 Novell, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * or later, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_svtools.hxx" + +#include + +#include +#include + +void localizeWebserviceURI( ::rtl::OUString& rURI ) +{ + ::rtl::OUString aLang = Application::GetSettings().GetUILocale().Language; + if ( aLang.equalsIgnoreAsciiCaseAscii( "pt" ) + && Application::GetSettings().GetUILocale().Country.equalsIgnoreAsciiCaseAscii("br") ) + { + aLang = ::rtl::OUString::createFromAscii("pt-br"); + } + + rURI += aLang; +} diff --git a/svtools/source/misc/makefile.mk b/svtools/source/misc/makefile.mk index 32781dbfefb1..3f609da24752 100755 --- a/svtools/source/misc/makefile.mk +++ b/svtools/source/misc/makefile.mk @@ -68,6 +68,7 @@ SLOFILES=\ $(SLO)$/imap3.obj \ $(SLO)$/itemdel.obj \ $(SLO)$/langtab.obj \ + $(SLO)$/langhelp.obj \ $(SLO)$/stringtransfer.obj \ $(SLO)$/svtaccessiblefactory.obj \ $(SLO)$/svtdata.obj \