summaryrefslogtreecommitdiff
path: root/svl
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2013-03-29 14:07:33 +0100
committerEike Rathke <erack@redhat.com>2013-03-29 14:09:01 +0100
commit5be14df2444d9fcc3518c5f54872c87b924e3e98 (patch)
tree5a0b3b4b588469e9ff012c3a3328bdb224843160 /svl
parentba4df3dd31ee9b2ced2a9119ecfd263e95de5ee6 (diff)
ResMgr with LanguageTag
Change-Id: Ie5ce9157a7ea59db7b0509fbaec61d07f8f9edf0
Diffstat (limited to 'svl')
-rw-r--r--svl/inc/svl/inettype.hxx4
-rw-r--r--svl/source/items/ctypeitm.cxx2
-rw-r--r--svl/source/misc/getstringresource.cxx13
-rw-r--r--svl/source/misc/getstringresource.hxx2
-rw-r--r--svl/source/misc/inettype.cxx2
5 files changed, 10 insertions, 13 deletions
diff --git a/svl/inc/svl/inettype.hxx b/svl/inc/svl/inettype.hxx
index 976452882372..a68d7911d37c 100644
--- a/svl/inc/svl/inettype.hxx
+++ b/svl/inc/svl/inettype.hxx
@@ -22,7 +22,7 @@
#include "svl/svldllapi.h"
#include <tools/inetmime.hxx>
-#include <com/sun/star/lang/Locale.hpp>
+#include <i18npool/languagetag.hxx>
//============================================================================
/** Definitions for frequently used media type names.
@@ -259,7 +259,7 @@ public:
static rtl::OUString GetContentType(INetContentType eTypeID);
static OUString GetPresentation(INetContentType eTypeID,
- const ::com::sun::star::lang::Locale& aLocale);
+ const LanguageTag& aLocale);
static INetContentType GetContentType4Extension(OUString const & rExtension);
diff --git a/svl/source/items/ctypeitm.cxx b/svl/source/items/ctypeitm.cxx
index 7d3da748c61d..b62254c4bf72 100644
--- a/svl/source/items/ctypeitm.cxx
+++ b/svl/source/items/ctypeitm.cxx
@@ -157,7 +157,7 @@ SfxItemPresentation CntContentTypeItem::GetPresentation(
if (pIntlWrapper)
(const_cast< CntContentTypeItem * >(this))->_aPresentation
= INetContentTypes::GetPresentation(GetEnumValue(),
- pIntlWrapper->getLanguageTag().getLocale());
+ pIntlWrapper->getLanguageTag());
}
if (!_aPresentation.isEmpty())
{
diff --git a/svl/source/misc/getstringresource.cxx b/svl/source/misc/getstringresource.cxx
index 22d5cad97847..866fd8f7d188 100644
--- a/svl/source/misc/getstringresource.cxx
+++ b/svl/source/misc/getstringresource.cxx
@@ -23,7 +23,7 @@
#include "boost/noncopyable.hpp"
#include "boost/scoped_ptr.hpp"
-#include "com/sun/star/lang/Locale.hpp"
+#include <i18npool/languagetag.hxx>
#include "rtl/instance.hxx"
#include "rtl/ustrbuf.hxx"
#include "rtl/ustring.hxx"
@@ -39,7 +39,7 @@ class ResMgrMap: private boost::noncopyable {
public:
~ResMgrMap();
- SimpleResMgr * get(css::lang::Locale const & locale);
+ SimpleResMgr * get(LanguageTag const & locale);
private:
typedef std::map< rtl::OUString, SimpleResMgr * > Map;
@@ -58,11 +58,8 @@ ResMgrMap::~ResMgrMap() {
}
}
-SimpleResMgr * ResMgrMap::get(css::lang::Locale const & locale) {
- rtl::OUStringBuffer buf(locale.Language);
- buf.append(sal_Unicode('-'));
- buf.append(locale.Country);
- rtl::OUString code(buf.makeStringAndClear());
+SimpleResMgr * ResMgrMap::get(LanguageTag const & locale) {
+ OUString code( locale.getBcp47());
Map::iterator i(map_.find(code));
if (i == map_.end()) {
boost::scoped_ptr< SimpleResMgr > mgr(
@@ -79,7 +76,7 @@ struct theResMgrMap: public rtl::Static< ResMgrMap, theResMgrMap > {};
namespace svl {
-rtl::OUString getStringResource(sal_uInt16 id, css::lang::Locale const & locale)
+rtl::OUString getStringResource(sal_uInt16 id, LanguageTag const & locale)
{
return theResMgrMap::get().get(locale)->ReadString(id);
}
diff --git a/svl/source/misc/getstringresource.hxx b/svl/source/misc/getstringresource.hxx
index 254765be44fe..1410c1577e99 100644
--- a/svl/source/misc/getstringresource.hxx
+++ b/svl/source/misc/getstringresource.hxx
@@ -32,7 +32,7 @@ namespace rtl { class OUString; }
namespace svl {
rtl::OUString getStringResource(
- sal_uInt16 id, com::sun::star::lang::Locale const & locale);
+ sal_uInt16 id, LanguageTag const & locale);
}
diff --git a/svl/source/misc/inettype.cxx b/svl/source/misc/inettype.cxx
index becc31548872..36878223b912 100644
--- a/svl/source/misc/inettype.cxx
+++ b/svl/source/misc/inettype.cxx
@@ -737,7 +737,7 @@ OUString INetContentTypes::GetContentType(INetContentType eTypeID)
//============================================================================
//static
OUString INetContentTypes::GetPresentation(INetContentType eTypeID,
- const ::com::sun::star::lang::Locale& aLocale)
+ const LanguageTag& aLocale)
{
sal_uInt16 nResID = sal_uInt16();
if (eTypeID <= CONTENT_TYPE_LAST)
-05-03remove empty commentsNoel Grandin found with: git ls-files | xargs grep -Pzl '/\*\* (\*|\s| )*\*/' Change-Id: I1f47bcb94d5a7b290a6c622c6941195fbb578597 Reviewed-on: https://gerrit.libreoffice.org/37159 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> 2017-01-26Remove dynamic exception specificationsStephan Bergmann ...(for now, from LIBO_INTERNAL_CODE only). See the mail thread starting at <https://lists.freedesktop.org/archives/libreoffice/2017-January/076665.html> "Dynamic Exception Specifications" for details. Most changes have been done automatically by the rewriting loplugin:dynexcspec (after enabling the rewriting mode, to be committed shortly). The way it only removes exception specs from declarations if it also sees a definition, it identified some dead declarations-w/o-definitions (that have been removed manually) and some cases where a definition appeared in multiple include files (which have also been cleaned up manually). There's also been cases of macro paramters (that were used to abstract over exception specs) that have become unused now (and been removed). Furthermore, some code needed to be cleaned up manually (avmedia/source/quicktime/ and connectivity/source/drivers/kab/), as I had no configurations available that would actually build that code. Missing @throws documentation has not been applied in such manual clean-up. Change-Id: I3408691256c9b0c12bc5332de976743626e13960 Reviewed-on: https://gerrit.libreoffice.org/33574 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com> 2016-10-27loplugin:expandablemethods in svxNoel Grandin Change-Id: I0d193ddf07cc0ddc89b6ce2df6eb71d44e49b631 Reviewed-on: https://gerrit.libreoffice.org/30295 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> 2016-05-12clang-tidy modernize-loop-convert in svxNoel Grandin Change-Id: I09e5243e5dff46ceccef1a707e648ee9cb0c37c5 Reviewed-on: https://gerrit.libreoffice.org/24875 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>