sw/source/filter/ww8/docxattributeoutput.cxx | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-)
New commits: commit 0cf9b9ab4bec65055e88517e937d18f751818ff6 Author: Eike Rathke <er...@redhat.com> Date: Wed Jul 10 17:16:14 2013 +0200 use LanguageTag to convert Change-Id: Ib998339f9097cee3185bb7c71a3ebb3e7e282943 diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx index 69c3888..bda961a 100644 --- a/sw/source/filter/ww8/docxattributeoutput.cxx +++ b/sw/source/filter/ww8/docxattributeoutput.cxx @@ -1199,9 +1199,7 @@ void DocxAttributeOutput::StartRuby( const SwTxtNode& rNode, xub_StrLen nPos, co // lid lang::Locale aLocale( SwBreakIt::Get()->GetLocale( rNode.GetLang( nPos ) ) ); - OUString sLang( aLocale.Language ); - if ( !aLocale.Country.isEmpty() ) - sLang += "-" + aLocale.Country; + OUString sLang( LanguageTag( aLocale).getBcp47() ); m_pSerializer->singleElementNS( XML_w, XML_lid, FSNS( XML_w, XML_val ), OUStringToOString( sLang, RTL_TEXTENCODING_UTF8 ).getStr( ), FSEND ); @@ -3624,11 +3622,9 @@ void DocxAttributeOutput::CharLanguage( const SvxLanguageItem& rLanguage ) if (!m_pCharLangAttrList) m_pCharLangAttrList = m_pSerializer->createAttrList(); - ::com::sun::star::lang::Locale xLocale= LanguageTag( rLanguage.GetLanguage( ) ).getLocale(); - OString sLanguage = OUStringToOString(xLocale.Language, RTL_TEXTENCODING_UTF8); - OString sCountry = OUStringToOString(xLocale.Country, RTL_TEXTENCODING_UTF8); - - OString aLanguageCode = sLanguage + "-" + sCountry; + OString aLanguageCode( OUStringToOString( + LanguageTag( rLanguage.GetLanguage()).getBcp47(), + RTL_TEXTENCODING_UTF8)); switch ( rLanguage.Which() ) { _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits