diff options
author | Eike Rathke <erack@redhat.com> | 2013-07-04 21:07:26 +0200 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2013-07-04 21:09:00 +0200 |
commit | 633ca742749ed006351d89852211fc2a8c48b523 (patch) | |
tree | c77ce1466d8442ffa88238067cfaf35fddf56d87 /oox | |
parent | 7191ff96bcd0fd265bd6af30d6422c694f66e1d7 (diff) |
use LanguageTag instead of mouth-painted implementation
Change-Id: Idd84ce9740de179c399702f896b7d39ab321f6f7
Diffstat (limited to 'oox')
-rw-r--r-- | oox/source/docprop/docprophandler.cxx | 18 | ||||
-rw-r--r-- | oox/source/docprop/docprophandler.hxx | 1 |
2 files changed, 2 insertions, 17 deletions
diff --git a/oox/source/docprop/docprophandler.cxx b/oox/source/docprop/docprophandler.cxx index 50d5d4c363a4..85df37dd0560 100644 --- a/oox/source/docprop/docprophandler.cxx +++ b/oox/source/docprop/docprophandler.cxx @@ -24,6 +24,7 @@ #include <com/sun/star/lang/Locale.hpp> #include <osl/time.h> +#include <i18nlangtag/languagetag.hxx> #include <vector> #include <boost/algorithm/string.hpp> @@ -178,21 +179,6 @@ uno::Sequence< OUString > OOXMLDocPropHandler::GetKeywordsSet( const OUString& a } return uno::Sequence< OUString >(); } -// ------------------------------------------------ -lang::Locale OOXMLDocPropHandler::GetLanguage( const OUString& aChars ) -{ - lang::Locale aResult; - if ( aChars.getLength() >= 2 ) - { - aResult.Language = aChars.copy( 0, 2 ); - if ( aChars.getLength() >= 5 && aChars.getStr()[2] == (sal_Unicode)'-' ) - aResult.Country = aChars.copy( 3, 2 ); - - // TODO/LATER: the variant could be also detected - } - - return aResult; -} // ------------------------------------------------ void OOXMLDocPropHandler::UpdateDocStatistic( const OUString& aChars ) @@ -423,7 +409,7 @@ void SAL_CALL OOXMLDocPropHandler::characters( const OUString& aChars ) case DC_TOKEN( language ): if ( aChars.getLength() >= 2 ) - m_xDocProp->setLanguage( GetLanguage( aChars ) ); + m_xDocProp->setLanguage( LanguageTag( aChars).getLocale() ); break; case COREPR_TOKEN( lastModifiedBy ): diff --git a/oox/source/docprop/docprophandler.hxx b/oox/source/docprop/docprophandler.hxx index b3e79048eb67..00a3d384a99c 100644 --- a/oox/source/docprop/docprophandler.hxx +++ b/oox/source/docprop/docprophandler.hxx @@ -62,7 +62,6 @@ public: ::com::sun::star::util::DateTime GetDateTimeFromW3CDTF( const OUString& aChars ); ::com::sun::star::uno::Sequence< OUString > GetKeywordsSet( const OUString& aChars ); - ::com::sun::star::lang::Locale GetLanguage( const OUString& aChars ); void UpdateDocStatistic( const OUString& aChars ); // com.sun.star.xml.sax.XFastDocumentHandler |