diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2014-02-28 12:17:51 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2014-02-28 13:51:35 +0100 |
commit | 440fbd609054d78e37f4953dfdde8c79c10b4981 (patch) | |
tree | 587ce0c0df692ac025d0167bac0ea0bfb25e25dd /oox/source/drawingml/textcharacterproperties.cxx | |
parent | 757996c46e09e6a14e15ee8ce2a993c0ec3b79f8 (diff) |
DOCX import: handle font theme references in group shape text
Change-Id: I1d5b86ad17b2c4a0945f483c94ac6abf410cf1d6
Diffstat (limited to 'oox/source/drawingml/textcharacterproperties.cxx')
-rw-r--r-- | oox/source/drawingml/textcharacterproperties.cxx | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/oox/source/drawingml/textcharacterproperties.cxx b/oox/source/drawingml/textcharacterproperties.cxx index 1ad0bae6e51e..b7827616ecfb 100644 --- a/oox/source/drawingml/textcharacterproperties.cxx +++ b/oox/source/drawingml/textcharacterproperties.cxx @@ -44,8 +44,11 @@ void TextCharacterProperties::assignUsed( const TextCharacterProperties& rSource // overwrite all properties exisiting in rSourceProps maHyperlinkPropertyMap.insert( rSourceProps.maHyperlinkPropertyMap.begin(), rSourceProps.maHyperlinkPropertyMap.end() ); maLatinFont.assignIfUsed( rSourceProps.maLatinFont ); + maLatinThemeFont.assignIfUsed( rSourceProps.maLatinThemeFont ); maAsianFont.assignIfUsed( rSourceProps.maAsianFont ); + maAsianThemeFont.assignIfUsed( rSourceProps.maAsianThemeFont ); maComplexFont.assignIfUsed( rSourceProps.maComplexFont ); + maComplexThemeFont.assignIfUsed( rSourceProps.maComplexThemeFont ); maSymbolFont.assignIfUsed( rSourceProps.maSymbolFont ); maCharColor.assignIfUsed( rSourceProps.maCharColor ); maHighlightColor.assignIfUsed( rSourceProps.maHighlightColor ); @@ -68,21 +71,31 @@ void TextCharacterProperties::pushToPropMap( PropertyMap& rPropMap, const XmlFil sal_Int16 nFontPitch = 0; sal_Int16 nFontFamily = 0; - if( maLatinFont.getFontData( aFontName, nFontPitch, nFontFamily, rFilter ) ) + bool bRet = maLatinFont.getFontData( aFontName, nFontPitch, nFontFamily, rFilter ); + if (!bRet) + // In case there is no direct font, try to look it up as a theme reference. + bRet = maLatinThemeFont.getFontData( aFontName, nFontPitch, nFontFamily, rFilter ); + if (bRet) { rPropMap[ PROP_CharFontName ] <<= aFontName; rPropMap[ PROP_CharFontPitch ] <<= nFontPitch; rPropMap[ PROP_CharFontFamily ] <<= nFontFamily; } - if( maAsianFont.getFontData( aFontName, nFontPitch, nFontFamily, rFilter ) ) + bRet = maAsianFont.getFontData( aFontName, nFontPitch, nFontFamily, rFilter ); + if (!bRet) + bRet = maAsianThemeFont.getFontData( aFontName, nFontPitch, nFontFamily, rFilter ); + if (bRet) { rPropMap[ PROP_CharFontNameAsian ] <<= aFontName; rPropMap[ PROP_CharFontPitchAsian ] <<= nFontFamily; rPropMap[ PROP_CharFontFamilyAsian ] <<= nFontPitch; } - if( maComplexFont.getFontData( aFontName, nFontPitch, nFontFamily, rFilter ) ) + bRet = maComplexFont.getFontData( aFontName, nFontPitch, nFontFamily, rFilter ); + if (!bRet) + bRet = maComplexThemeFont.getFontData( aFontName, nFontPitch, nFontFamily, rFilter ); + if (bRet) { rPropMap[ PROP_CharFontNameComplex ] <<= aFontName; rPropMap[ PROP_CharFontPitchComplex ] <<= nFontPitch; |