summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMuthu Subramanian <sumuthu@collabora.com>2014-03-31 15:13:51 +0530
committerMuthu Subramanian <sumuthu@collabora.com>2014-03-31 15:13:51 +0530
commite05d649cbbafe9b22176a49fc316069e89926e70 (patch)
tree7c9bee7fd54683a71c17f6cc2e7fb62c1a3e0e8d
parent193ecefaef948272695b0dd0a42a3bcc3256f631 (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.hxx2
-rw-r--r--oox/source/drawingml/textcharacterproperties.cxx3
-rw-r--r--oox/source/drawingml/textcharacterpropertiescontext.cxx4
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 );