[Libreoffice-commits] core.git: 2 commits - oox/source
Eike Rathke
erack at redhat.com
Thu Jul 4 11:33:20 PDT 2013
oox/source/drawingml/textcharacterproperties.cxx | 13 ++-----------
oox/source/export/drawingml.cxx | 16 +++++-----------
2 files changed, 7 insertions(+), 22 deletions(-)
New commits:
commit 78f053dd87c350524cce281e6dfcee5ed00811a2
Author: Eike Rathke <erack at redhat.com>
Date: Thu Jul 4 19:51:35 2013 +0200
use LanguageTag and write bcp47 for ST_Lang
Change-Id: I6e8ad53f769939fd7f7539514ca20374e5fd9248
diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx
index 6b4f80e..0232d07 100644
--- a/oox/source/export/drawingml.cxx
+++ b/oox/source/export/drawingml.cxx
@@ -771,17 +771,11 @@ void DrawingML::WriteRunProperties( Reference< XPropertySet > rRun, sal_Bool bIs
}
if( GETA( CharLocale ) ) {
- com::sun::star::lang::Locale eLocale;
- mAny >>= eLocale;
-
- OUStringBuffer usLanguageBuffer = eLocale.Language;
- if( !eLocale.Country.isEmpty() ) {
- usLanguageBuffer.appendAscii( "-" );
- usLanguageBuffer.append( eLocale.Country );
- }
-
- if( !usLanguageBuffer.isEmpty() )
- usLanguage = usLanguageBuffer.makeStringAndClear();
+ com::sun::star::lang::Locale aLocale;
+ mAny >>= aLocale;
+ LanguageTag aLanguageTag( aLocale);
+ if (!aLanguageTag.isSystemLocale())
+ usLanguage = aLanguageTag.getBcp47();
}
mpFS->startElementNS( XML_a, XML_rPr,
commit 6dfe34d6ff30bede5a17e27e02cdc0ca54c11325
Author: Eike Rathke <erack at redhat.com>
Date: Thu Jul 4 19:42:16 2013 +0200
use LanguageTag
Change-Id: I16c1f5ba5a74858f01f5e62af2614beba608ef8c
diff --git a/oox/source/drawingml/textcharacterproperties.cxx b/oox/source/drawingml/textcharacterproperties.cxx
index 11a551a..8a12c62 100644
--- a/oox/source/drawingml/textcharacterproperties.cxx
+++ b/oox/source/drawingml/textcharacterproperties.cxx
@@ -21,6 +21,7 @@
#include <com/sun/star/lang/Locale.hpp>
#include <com/sun/star/awt/FontSlant.hpp>
#include <com/sun/star/awt/FontWeight.hpp>
+#include <i18nlangtag/languagetag.hxx>
#include "oox/helper/helper.hxx"
#include "oox/helper/propertyset.hxx"
#include "oox/core/xmlfilterbase.hxx"
@@ -93,17 +94,7 @@ void TextCharacterProperties::pushToPropMap( PropertyMap& rPropMap, const XmlFil
if( moLang.has() && !moLang.get().isEmpty() )
{
- lang::Locale aLocale;
- sal_Int32 nSepPos = moLang.get().indexOf( sal_Unicode( '-' ), 0 );
- if ( nSepPos >= 0 )
- {
- aLocale.Language = moLang.get().copy( 0, nSepPos );
- aLocale.Country = moLang.get().copy( nSepPos + 1 );
- }
- else
- {
- aLocale.Language = moLang.get();
- }
+ lang::Locale aLocale( LanguageTag( moLang.get()).getLocale());
rPropMap[ PROP_CharLocale ] <<= aLocale;
rPropMap[ PROP_CharLocaleAsian ] <<= aLocale;
rPropMap[ PROP_CharLocaleComplex ] <<= aLocale;
More information about the Libreoffice-commits
mailing list