summaryrefslogtreecommitdiff
path: root/include/unotools
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2013-07-11 23:08:40 +0200
committerEike Rathke <erack@redhat.com>2013-07-12 00:10:13 +0200
commit1254a00da0fff439c8f8ac1697da7a96e10b1705 (patch)
tree4f60ed82e62d5725334ed62b5ce827962a4da208 /include/unotools
parent642f458c23eefc9fcf5447362a049329b489adf0 (diff)
eliminated some back and forth conversion between bcp47 and Locale
Change-Id: If97a4b695262a99979dbab1bcec75fe694c4de80
Diffstat (limited to 'include/unotools')
-rw-r--r--include/unotools/fontcfg.hxx39
1 files changed, 4 insertions, 35 deletions
diff --git a/include/unotools/fontcfg.hxx b/include/unotools/fontcfg.hxx
index 3e7f0ac95200..5e63ddb7fbdf 100644
--- a/include/unotools/fontcfg.hxx
+++ b/include/unotools/fontcfg.hxx
@@ -30,37 +30,9 @@
#include <boost/unordered_set.hpp>
#include <vector>
-namespace com {
-namespace sun {
-namespace star {
-namespace lang {
-
-// equality operator needed for hash_map;
-// (-> why does this need to be in the namespace of Locale ? g++ fails to compile else)
-inline bool operator==( const com::sun::star::lang::Locale& rLeft, const com::sun::star::lang::Locale& rRight )
-{
- return
- rLeft.Language.equals( rRight.Language ) &&
- rLeft.Country.equals( rRight.Country ) &&
- rLeft.Variant.equals( rRight.Variant )
- ;
-}
-}}}}
-
namespace utl
{
-struct LocaleHash
-{
- size_t operator()( const com::sun::star::lang::Locale& rLocale ) const
- {
- return
- (size_t)rLocale.Language.hashCode() ^
- (size_t)rLocale.Country.hashCode() ^
- (size_t)rLocale.Variant.hashCode();
- }
-};
-
class UNOTOOLS_DLLPUBLIC DefaultFontConfiguration
{
com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >
@@ -77,12 +49,9 @@ class UNOTOOLS_DLLPUBLIC DefaultFontConfiguration
mutable com::sun::star::uno::Reference< com::sun::star::container::XNameAccess > xAccess;
};
- boost::unordered_map< com::sun::star::lang::Locale,
- LocaleAccess,
- utl::LocaleHash >
- m_aConfig;
+ boost::unordered_map< OUString, LocaleAccess, OUStringHash > m_aConfig;
- OUString tryLocale( const com::sun::star::lang::Locale& rLocale, const OUString& rType ) const;
+ OUString tryLocale( const OUString& rBcp47, const OUString& rType ) const;
public:
DefaultFontConfiguration();
@@ -183,7 +152,7 @@ private:
LocaleSubst() : bConfigRead( false ) {}
};
- boost::unordered_map< com::sun::star::lang::Locale, LocaleSubst, utl::LocaleHash > m_aSubst;
+ boost::unordered_map< OUString, LocaleSubst, OUStringHash > m_aSubst;
typedef boost::unordered_set< OUString, OUStringHash > UniqueSubstHash;
mutable UniqueSubstHash maSubstHash;
@@ -197,7 +166,7 @@ private:
const OUString& rType ) const;
unsigned long getSubstType( const com::sun::star::uno::Reference< com::sun::star::container::XNameAccess > xFont,
const OUString& rType ) const;
- void readLocaleSubst( const com::sun::star::lang::Locale& rLocale ) const;
+ void readLocaleSubst( const OUString& rBcp47 ) const;
public:
FontSubstConfiguration();
~FontSubstConfiguration();