summaryrefslogtreecommitdiff
path: root/svtools
diff options
context:
space:
mode:
authorThorsten Behrens <tbehrens@novell.com>2010-10-07 12:29:38 +0200
committerThorsten Behrens <tbehrens@novell.com>2010-10-07 12:37:34 +0200
commitc0ad15ac442231e42e5086c0ba61539b5fd4ad43 (patch)
tree9e72b59372447a9300a1dcdf784aa47490e3827c /svtools
parent2f0d406911f9790a434e46bc82ea36bb8ae714e7 (diff)
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.
Diffstat (limited to 'svtools')
-rw-r--r--svtools/inc/svtools/langhelp.hxx42
-rw-r--r--svtools/source/contnr/templwin.cxx4
-rw-r--r--svtools/source/misc/langhelp.cxx44
-rwxr-xr-xsvtools/source/misc/makefile.mk1
4 files changed, 90 insertions, 1 deletions
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
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef _SVTOOLS_LANGHELP_HXX_
+#define _SVTOOLS_LANGHELP_HXX_
+
+#include <svtools/svtdllapi.h>
+
+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 <svtools/svtdata.hxx>
+#include <svtools/langhelp.hxx>
#include <unotools/pathoptions.hxx>
#include <unotools/dynamicmenuoptions.hxx>
#include <unotools/extendedsecurityoptions.hxx>
@@ -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
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_svtools.hxx"
+
+#include <svtools/langhelp.hxx>
+
+#include <vcl/svapp.hxx>
+#include <rtl/ustring.hxx>
+
+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 \