diff options
author | Jacobo Aragunde Pérez <jaragunde@igalia.com> | 2014-02-04 18:55:21 +0100 |
---|---|---|
committer | Jacobo Aragunde Pérez <jaragunde@igalia.com> | 2014-02-05 02:00:03 +0100 |
commit | b8a863a219ae3efaa050e5f213d5ae3a91459c06 (patch) | |
tree | 698469f3fc65d52f7e32e512c7147e4df7bbd327 /oox | |
parent | 2fcf3a871c94feeca11619ef5c8c0466ce61eb74 (diff) |
drawingML: do not write empty schemeClr tags
Change-Id: I8508f00f6af218605d1d43d3efcefbf545387ab8
Diffstat (limited to 'oox')
-rw-r--r-- | oox/source/export/drawingml.cxx | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx index 9fc0ec9a2120..f01119073bdd 100644 --- a/oox/source/export/drawingml.cxx +++ b/oox/source/export/drawingml.cxx @@ -181,6 +181,10 @@ void DrawingML::WriteColor( sal_uInt32 nColor, sal_Int32 nAlpha ) void DrawingML::WriteColor( OUString sColorSchemeName, Sequence< PropertyValue > aTransformations ) { + // prevent writing a tag with empty val attribute + if( sColorSchemeName.isEmpty() ) + return; + if( aTransformations.hasElements() ) { mpFS->startElementNS( XML_a, XML_schemeClr, @@ -219,17 +223,14 @@ void DrawingML::WriteSolidFill( OUString sSchemeName, sal_Int32 nAlpha ) mpFS->startElementNS( XML_a, XML_solidFill, FSEND ); if( nAlpha < MAX_PERCENT ) { - mpFS->startElementNS( XML_a, XML_schemeClr, XML_val, - OUStringToOString( sSchemeName, RTL_TEXTENCODING_ASCII_US ).getStr(), - FSEND ); - mpFS->singleElementNS( XML_a, XML_alpha, XML_val, OString::number(nAlpha), FSEND ); - mpFS->endElementNS( XML_a, XML_schemeClr ); + Sequence< PropertyValue > aTransformations(1); + aTransformations[0].Name = "alpha"; + aTransformations[0].Value <<= nAlpha; + WriteColor( sSchemeName, aTransformations ); } else { - mpFS->singleElementNS( XML_a, XML_schemeClr, XML_val, - OUStringToOString( sSchemeName, RTL_TEXTENCODING_ASCII_US ).getStr(), - FSEND ); + WriteColor( sSchemeName ); } mpFS->endElementNS( XML_a, XML_solidFill ); } |