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)