From bcc73432eefc08421f6ee16b3c179cba3add636a Mon Sep 17 00:00:00 2001 From: Eike Rathke Date: Thu, 28 Mar 2013 01:00:10 +0100 Subject: use LanguageTag instead of comphelper::Locale Change-Id: Id8239b3e34c343fc114a66ab9216c179b1746d56 --- xmlhelp/Library_tvhlp1.mk | 1 + xmlhelp/Library_ucpchelp1.mk | 1 + xmlhelp/source/cxxhelp/provider/databases.cxx | 20 +++++--------------- xmlhelp/source/treeview/tvread.cxx | 10 ++-------- 4 files changed, 9 insertions(+), 23 deletions(-) diff --git a/xmlhelp/Library_tvhlp1.mk b/xmlhelp/Library_tvhlp1.mk index 5607920dfc13..95c63cbb04fe 100644 --- a/xmlhelp/Library_tvhlp1.mk +++ b/xmlhelp/Library_tvhlp1.mk @@ -42,6 +42,7 @@ $(eval $(call gb_Library_use_libraries,tvhlp1,\ cppuhelper \ sal \ utl \ + i18nisolang1 \ )) $(eval $(call gb_Library_add_exception_objects,tvhlp1,\ diff --git a/xmlhelp/Library_ucpchelp1.mk b/xmlhelp/Library_ucpchelp1.mk index 5472eaa7a2f5..3d7d057ad035 100644 --- a/xmlhelp/Library_ucpchelp1.mk +++ b/xmlhelp/Library_ucpchelp1.mk @@ -71,6 +71,7 @@ $(eval $(call gb_Library_use_libraries,ucpchelp1,\ sal \ ucbhelper \ utl \ + i18nisolang1 \ )) $(eval $(call gb_Library_add_exception_objects,ucpchelp1,\ diff --git a/xmlhelp/source/cxxhelp/provider/databases.cxx b/xmlhelp/source/cxxhelp/provider/databases.cxx index 8660b53464cd..c875840f5a39 100644 --- a/xmlhelp/source/cxxhelp/provider/databases.cxx +++ b/xmlhelp/source/cxxhelp/provider/databases.cxx @@ -50,7 +50,7 @@ #include #include #include -#include +#include #include #include @@ -648,6 +648,8 @@ Databases::getCollator( const rtl::OUString& Language, else if( langStr.compareToAscii("ko") == 0 ) countryStr = rtl::OUString("KR"); } + /* FIXME-BCP47: all this does not look right for language tag context, + * also check processLang() and country() methods */ it->second->loadDefaultCollator( Locale( langStr, countryStr, rtl::OUString() ), @@ -1491,13 +1493,7 @@ rtl::OUString ExtensionIteratorBase::implGetFileFromPackage( ::std::vector< ::rtl::OUString > av; implGetLanguageVectorFromPackage( av, xPackage ); - ::std::vector< ::rtl::OUString >::const_iterator pFound = av.end(); - try - { - pFound = ::comphelper::Locale::getFallback( av, m_aLanguage ); - } - catch( ::comphelper::Locale::MalFormedLocaleException& ) - {} + ::std::vector< ::rtl::OUString >::const_iterator pFound = LanguageTag::getFallback( av, m_aLanguage ); if( pFound != av.end() ) aLanguage = *pFound; } @@ -1634,13 +1630,7 @@ helpdatafileproxy::Hdf* DataBaseIterator::implGetHdfFromPackage( Reference< depl { ::std::vector< ::rtl::OUString > av; implGetLanguageVectorFromPackage( av, xPackage ); - ::std::vector< ::rtl::OUString >::const_iterator pFound = av.end(); - try - { - pFound = ::comphelper::Locale::getFallback( av, m_aLanguage ); - } - catch( ::comphelper::Locale::MalFormedLocaleException& ) - {} + ::std::vector< ::rtl::OUString >::const_iterator pFound = LanguageTag::getFallback( av, m_aLanguage ); if( pFound != av.end() ) { aUsedLanguage = *pFound; diff --git a/xmlhelp/source/treeview/tvread.cxx b/xmlhelp/source/treeview/tvread.cxx index b47a2abd5536..30800a0c4628 100644 --- a/xmlhelp/source/treeview/tvread.cxx +++ b/xmlhelp/source/treeview/tvread.cxx @@ -34,7 +34,7 @@ #include #include #include -#include +#include #include namespace treeview { @@ -1324,13 +1324,7 @@ rtl::OUString TreeFileIterator::implGetTreeFileFromPackage ::std::vector< ::rtl::OUString > av; implGetLanguageVectorFromPackage( av, xPackage ); - ::std::vector< ::rtl::OUString >::const_iterator pFound = av.end(); - try - { - pFound = ::comphelper::Locale::getFallback( av, m_aLanguage ); - } - catch( ::comphelper::Locale::MalFormedLocaleException& ) - {} + ::std::vector< ::rtl::OUString >::const_iterator pFound = LanguageTag::getFallback( av, m_aLanguage ); if( pFound != av.end() ) aLanguage = *pFound; } -- cgit