diff options
author | Radek Doulik <rodo@novell.com> | 2010-11-10 21:24:12 +0100 |
---|---|---|
committer | Radek Doulik <rodo@novell.com> | 2010-11-10 21:24:12 +0100 |
commit | c1baa49e00284654064572e941dd7266c048cb3f (patch) | |
tree | 7de84371aec9ff606f821f8a7097d7108e22aa59 /oox/source/drawingml/textcharacterproperties.cxx | |
parent | 6fc2bebf2482249d84368ff2b01c7dbb5476ef3c (diff) |
fix how the table cells style is applied in pptx import, n#650008
Diffstat (limited to 'oox/source/drawingml/textcharacterproperties.cxx')
-rw-r--r-- | oox/source/drawingml/textcharacterproperties.cxx | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/oox/source/drawingml/textcharacterproperties.cxx b/oox/source/drawingml/textcharacterproperties.cxx index 52b8a112076e..feda383cf444 100644 --- a/oox/source/drawingml/textcharacterproperties.cxx +++ b/oox/source/drawingml/textcharacterproperties.cxx @@ -70,7 +70,7 @@ void TextCharacterProperties::assignUsed( const TextCharacterProperties& rSource moUnderlineFillFollowText.assignIfUsed( rSourceProps.moUnderlineFillFollowText ); } -void TextCharacterProperties::pushToPropMap( PropertyMap& rPropMap, const XmlFilterBase& rFilter ) const + void TextCharacterProperties::pushToPropMap( PropertyMap& rPropMap, const XmlFilterBase& rFilter, bool bUseOptional ) const { OUString aFontName; sal_Int16 nFontPitch = 0; @@ -134,15 +134,19 @@ void TextCharacterProperties::pushToPropMap( PropertyMap& rPropMap, const XmlFil rPropMap[ PROP_CharStrikeout ] <<= GetFontStrikeout( moStrikeout.get( XML_noStrike ) ); rPropMap[ PROP_CharCaseMap ] <<= GetCaseMap( moCaseMap.get( XML_none ) ); - float fWeight = moBold.get( false ) ? awt::FontWeight::BOLD : awt::FontWeight::NORMAL; - rPropMap[ PROP_CharWeight ] <<= fWeight; - rPropMap[ PROP_CharWeightAsian ] <<= fWeight; - rPropMap[ PROP_CharWeightComplex ] <<= fWeight; + if( !bUseOptional || moBold.has() ) { + float fWeight = moBold.get( false ) ? awt::FontWeight::BOLD : awt::FontWeight::NORMAL; + rPropMap[ PROP_CharWeight ] <<= fWeight; + rPropMap[ PROP_CharWeightAsian ] <<= fWeight; + rPropMap[ PROP_CharWeightComplex ] <<= fWeight; + } - awt::FontSlant eSlant = moItalic.get( false ) ? awt::FontSlant_ITALIC : awt::FontSlant_NONE; - rPropMap[ PROP_CharPosture ] <<= eSlant; - rPropMap[ PROP_CharPostureAsian ] <<= eSlant; - rPropMap[ PROP_CharPostureComplex ] <<= eSlant; + if( !bUseOptional || moItalic.has() ) { + awt::FontSlant eSlant = moItalic.get( false ) ? awt::FontSlant_ITALIC : awt::FontSlant_NONE; + rPropMap[ PROP_CharPosture ] <<= eSlant; + rPropMap[ PROP_CharPostureAsian ] <<= eSlant; + rPropMap[ PROP_CharPostureComplex ] <<= eSlant; + } bool bUnderlineFillFollowText = moUnderlineFillFollowText.get( false ); if( moUnderline.has() && maUnderlineColor.isUsed() && !bUnderlineFillFollowText ) @@ -152,10 +156,10 @@ void TextCharacterProperties::pushToPropMap( PropertyMap& rPropMap, const XmlFil } } -void TextCharacterProperties::pushToPropSet( PropertySet& rPropSet, const XmlFilterBase& rFilter ) const + void TextCharacterProperties::pushToPropSet( PropertySet& rPropSet, const XmlFilterBase& rFilter, bool bUseOptional ) const { PropertyMap aPropMap; - pushToPropMap( aPropMap, rFilter ); + pushToPropMap( aPropMap, rFilter, bUseOptional ); rPropSet.setProperties( aPropMap ); } |