summaryrefslogtreecommitdiff
path: root/oox
diff options
context:
space:
mode:
authorMuthu Subramanian <sumuthu@collabora.com>2014-03-28 17:24:45 +0530
committerMuthu Subramanian <sumuthu@collabora.com>2014-03-28 17:40:48 +0530
commitcfc76de83e3c0a56abd30a8f3bd7c69d3500d223 (patch)
tree16192e3a9f5ba0da14b8ebedd9d8a049f2f7d7bb /oox
parent06db1edf617b537d774f487e0ab7d3528c5626df (diff)
n#870234: Import gradfill for text colors.
Uses the first color from the gradfill list. (Which is better than plain black!) Change-Id: I4c1c0c4b031f3681c95b75b3c0683eb4de95bffb
Diffstat (limited to 'oox')
-rw-r--r--oox/source/drawingml/textcharacterproperties.cxx3
-rw-r--r--oox/source/drawingml/textcharacterpropertiescontext.cxx4
2 files changed, 7 insertions, 0 deletions
diff --git a/oox/source/drawingml/textcharacterproperties.cxx b/oox/source/drawingml/textcharacterproperties.cxx
index 6f64f2ab55e5..5f7cf4f88c3c 100644
--- a/oox/source/drawingml/textcharacterproperties.cxx
+++ b/oox/source/drawingml/textcharacterproperties.cxx
@@ -65,6 +65,7 @@ void TextCharacterProperties::assignUsed( const TextCharacterProperties& rSource
moUnderlineFillFollowText.assignIfUsed( rSourceProps.moUnderlineFillFollowText );
maTextEffectsProperties = rSourceProps.maTextEffectsProperties;
+ maGradientProps.assignUsed( rSourceProps.maGradientProps );
}
void TextCharacterProperties::pushToPropMap( PropertyMap& rPropMap, const XmlFilterBase& rFilter, bool bUseOptional ) const
@@ -108,6 +109,8 @@ void TextCharacterProperties::pushToPropMap( PropertyMap& rPropMap, const XmlFil
if( maCharColor.isUsed() )
rPropMap.setProperty( 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 5bb800c542bc..7bedd8e2f7a1 100644
--- a/oox/source/drawingml/textcharacterpropertiescontext.cxx
+++ b/oox/source/drawingml/textcharacterpropertiescontext.cxx
@@ -132,6 +132,10 @@ ContextHandlerRef TextCharacterPropertiesContext::onCreateContext( sal_Int32 aEl
case A_TOKEN( hlinkClick ): // CT_Hyperlink
case A_TOKEN( hlinkMouseOver ): // CT_Hyperlink
return new HyperLinkContext( *this, rAttribs, mrTextCharacterProperties.maHyperlinkPropertyMap );
+
+ case A_TOKEN( gradFill ):
+ return new GradientFillContext( *this, rAttribs, mrTextCharacterProperties.maGradientProps );
+
case OOX_TOKEN( doc, rFonts ):
if( rAttribs.hasAttribute(OOX_TOKEN(doc, ascii)) )
{