[ooo-build-commit] .: svtools/inc svtools/source

Thorsten Behrens thorsten at kemper.freedesktop.org
Thu Oct 7 03:45:39 PDT 2010


 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(-)

New commits:
commit 745ee04b088d79849ff0499dcdd0b538413b4079
Author: Thorsten Behrens <tbehrens at novell.com>
Date:   Thu Oct 7 12:29:38 2010 +0200

    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.

diff --git a/svtools/inc/svtools/langhelp.hxx b/svtools/inc/svtools/langhelp.hxx
new file mode 100644
index 0000000..4939a89
--- /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 0e3b127..4a495f8 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 0000000..bd3308a
--- /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 32781db..3f609da 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             \


More information about the ooo-build-commit mailing list