summaryrefslogtreecommitdiff
path: root/oox
diff options
context:
space:
mode:
authorMark Hung <marklh9@gmail.com>2019-09-30 16:05:40 +0800
committerMark Hung <marklh9@gmail.com>2019-10-10 05:30:27 +0200
commitf9569785dd513b9b2f1d7c8c687fed285b0ad280 (patch)
tree355ceb0e6fba080881147893cf5178fb29392bb8 /oox
parent9377ff20724b156c32728d347cdf843fe23dcd81 (diff)
tdf#98603 fix the missing char property (1/2).
- moLang is missed from assignUsed, so the attribute was never processed. - Set CharLocale, CharLocaleAsian, or CharLocaleComplex based on lang attribute of rPr (run property). Change-Id: I6a9a636d790d244d19e7b661a1a63b1249c2bd37 Reviewed-on: https://gerrit.libreoffice.org/79972 Tested-by: Jenkins Reviewed-by: Mark Hung <marklh9@gmail.com>
Diffstat (limited to 'oox')
-rw-r--r--oox/source/drawingml/textcharacterproperties.cxx18
1 files changed, 14 insertions, 4 deletions
diff --git a/oox/source/drawingml/textcharacterproperties.cxx b/oox/source/drawingml/textcharacterproperties.cxx
index 6a0f37532d8b..703e23db9c3f 100644
--- a/oox/source/drawingml/textcharacterproperties.cxx
+++ b/oox/source/drawingml/textcharacterproperties.cxx
@@ -21,8 +21,10 @@
#include <com/sun/star/lang/Locale.hpp>
#include <com/sun/star/awt/FontSlant.hpp>
#include <com/sun/star/awt/FontWeight.hpp>
+#include <com/sun/star/i18n/ScriptType.hpp>
#include <comphelper/sequence.hxx>
#include <i18nlangtag/languagetag.hxx>
+#include <i18nlangtag/mslangid.hxx>
#include <editeng/escapementitem.hxx>
#include <oox/helper/helper.hxx>
#include <oox/helper/propertyset.hxx>
@@ -52,6 +54,7 @@ void TextCharacterProperties::assignUsed( const TextCharacterProperties& rSource
maSymbolFont.assignIfUsed( rSourceProps.maSymbolFont );
maHighlightColor.assignIfUsed( rSourceProps.maHighlightColor );
maUnderlineColor.assignIfUsed( rSourceProps.maUnderlineColor );
+ moLang.assignIfUsed( rSourceProps.moLang );
moHeight.assignIfUsed( rSourceProps.moHeight );
moFontScale.assignIfUsed(rSourceProps.moFontScale);
moSpacing.assignIfUsed( rSourceProps.moSpacing );
@@ -110,10 +113,17 @@ void TextCharacterProperties::pushToPropMap( PropertyMap& rPropMap, const XmlFil
if( moLang.has() && !moLang.get().isEmpty() )
{
- lang::Locale aLocale( LanguageTag( moLang.get()).getLocale());
- rPropMap.setProperty( PROP_CharLocale, aLocale);
- rPropMap.setProperty( PROP_CharLocaleAsian, aLocale);
- rPropMap.setProperty( PROP_CharLocaleComplex, aLocale);
+ LanguageTag aTag(moLang.get());
+ lang::Locale aLocale(aTag.getLocale());
+ switch(MsLangId::getScriptType(aTag.getLanguageType()))
+ {
+ case css::i18n::ScriptType::LATIN:
+ rPropMap.setProperty( PROP_CharLocale, aLocale);break;
+ case css::i18n::ScriptType::ASIAN:
+ rPropMap.setProperty( PROP_CharLocaleAsian, aLocale);break;
+ case css::i18n::ScriptType::COMPLEX:
+ rPropMap.setProperty( PROP_CharLocaleComplex, aLocale);break;
+ }
}
if( moHeight.has() )