From d793b848147f5fd382d44239c4b7e27337782811 Mon Sep 17 00:00:00 2001 From: Markus Mohrhard Date: Fri, 11 May 2012 07:21:05 +0200 Subject: also support theme based colors in xlsx Change-Id: I6a159d7e5a9315b23a5ff7ee6487ee65457552ff --- sc/source/filter/oox/condformatbuffer.cxx | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'sc') diff --git a/sc/source/filter/oox/condformatbuffer.cxx b/sc/source/filter/oox/condformatbuffer.cxx index dd6150faaafa..d14ce8aae467 100644 --- a/sc/source/filter/oox/condformatbuffer.cxx +++ b/sc/source/filter/oox/condformatbuffer.cxx @@ -51,6 +51,7 @@ #include "addressconverter.hxx" #include "biffinputstream.hxx" #include "stylesbuffer.hxx" +#include "themebuffer.hxx" #include "colorscale.hxx" #include "document.hxx" @@ -206,7 +207,14 @@ namespace { void ColorScaleRule::importColor( const AttributeList& rAttribs ) { - sal_Int32 nColor = rAttribs.getIntegerHex( XML_rgb, API_RGB_TRANSPARENT ); + sal_Int32 nColor = 0; + if( rAttribs.hasAttribute( XML_rgb ) ) + nColor = rAttribs.getIntegerHex( XML_rgb, API_RGB_TRANSPARENT ); + else if( rAttribs.hasAttribute( XML_theme ) ) + { + sal_uInt32 nThemeIndex = rAttribs.getUnsigned( XML_theme, 0 ); + nColor = getTheme().getColorByToken( nThemeIndex ); + } ::Color aColor = RgbToRgbComponents( nColor ); -- cgit