diff options
author | Muthu Subramanian <sumuthu@collabora.com> | 2014-03-31 15:13:51 +0530 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2014-04-03 05:31:55 -0700 |
commit | 35f3cec61cb33b76a82bee9e4a31a2750a087f36 (patch) | |
tree | da0438c6825b56817d5bc1e634f849f7d865d541 | |
parent | e496a24b444946c0309d3d1144970417e7b0a876 (diff) |
n#870234: Import gradfill for text colors.
Uses the first color from the gradfill list.
(Which is better than plain black!)
Ported from: cfc76de83e3c0a56abd30a8f3bd7c69d3500d223
Change-Id: I57a3a54a8053a8ce320acbd02940f10941165d1c
-rw-r--r-- | oox/inc/oox/drawingml/textcharacterproperties.hxx | 2 | ||||
-rw-r--r-- | oox/source/drawingml/textcharacterproperties.cxx | 3 | ||||
-rw-r--r-- | oox/source/drawingml/textcharacterpropertiescontext.cxx | 4 |
3 files changed, 9 insertions, 0 deletions
diff --git a/oox/inc/oox/drawingml/textcharacterproperties.hxx b/oox/inc/oox/drawingml/textcharacterproperties.hxx index 1073fa65bc4f..35943daac5aa 100644 --- a/oox/inc/oox/drawingml/textcharacterproperties.hxx +++ b/oox/inc/oox/drawingml/textcharacterproperties.hxx @@ -24,6 +24,7 @@ #include "oox/helper/propertymap.hxx" #include "oox/drawingml/color.hxx" #include "oox/drawingml/textfont.hxx" +#include "oox/drawingml/fillproperties.hxx" namespace oox { class PropertySet; } @@ -53,6 +54,7 @@ struct TextCharacterProperties OptValue< bool > moItalic; OptValue< bool > moUnderlineLineFollowText; OptValue< bool > moUnderlineFillFollowText; + GradientFillProperties maGradientProps; /// Properties for gradient text colors /** Overwrites all members that are explicitly set in rSourceProps. */ void assignUsed( const TextCharacterProperties& rSourceProps ); diff --git a/oox/source/drawingml/textcharacterproperties.cxx b/oox/source/drawingml/textcharacterproperties.cxx index bc23204b5b6f..48006309bb3a 100644 --- a/oox/source/drawingml/textcharacterproperties.cxx +++ b/oox/source/drawingml/textcharacterproperties.cxx @@ -60,6 +60,7 @@ void TextCharacterProperties::assignUsed( const TextCharacterProperties& rSource moItalic.assignIfUsed( rSourceProps.moItalic ); moUnderlineLineFollowText.assignIfUsed( rSourceProps.moUnderlineLineFollowText ); moUnderlineFillFollowText.assignIfUsed( rSourceProps.moUnderlineFillFollowText ); + maGradientProps.assignUsed( rSourceProps.maGradientProps ); } void TextCharacterProperties::pushToPropMap( PropertyMap& rPropMap, const XmlFilterBase& rFilter, bool bUseOptional ) const @@ -93,6 +94,8 @@ void TextCharacterProperties::pushToPropMap( PropertyMap& rPropMap, const XmlFil if( maCharColor.isUsed() ) rPropMap[ PROP_CharColor ] <<= maCharColor.getColor( rFilter.getGraphicHelper() ); + if( maGradientProps.maGradientStops.size() > 0 ) + rPropMap[ PROP_CharColor ] <<= maGradientProps.maGradientStops.begin()->second.getColor( rFilter.getGraphicHelper() ); if( moLang.has() && !moLang.get().isEmpty() ) { diff --git a/oox/source/drawingml/textcharacterpropertiescontext.cxx b/oox/source/drawingml/textcharacterpropertiescontext.cxx index 13af2cd2bd38..ec37a070195f 100644 --- a/oox/source/drawingml/textcharacterpropertiescontext.cxx +++ b/oox/source/drawingml/textcharacterpropertiescontext.cxx @@ -161,6 +161,10 @@ Reference< XFastContextHandler > TextCharacterPropertiesContext::createFastChild case A_TOKEN( hlinkMouseOver ): // CT_Hyperlink xRet.set( new HyperLinkContext( *this, xAttributes, mrTextCharacterProperties.maHyperlinkPropertyMap ) ); break; + + case A_TOKEN( gradFill ): + xRet.set( new GradientFillContext( *this, xAttributes, mrTextCharacterProperties.maGradientProps ) ); + break; } if( !xRet.is() ) xRet.set( this ); |