diff options
author | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2015-04-15 18:19:47 +0200 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2015-04-15 18:23:35 +0200 |
commit | f3121049828596b369e3ea844355d61666e49795 (patch) | |
tree | 89dca766b999674508df2142d02353f0feaa7de6 /sc | |
parent | b99a4b81f53aa406a98e167fc9b8e1f1347fa970 (diff) |
use index as real index and not token, tdf#90511
At least in calc a theme index is a zero based index into the clrScheme.
A map is unsiutable for that task so let us use a vector and still allow
to get them by their tokens.
Change-Id: I09d56acaf22c3ed16387aae95c36382302c5a17e
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/filter/inc/themebuffer.hxx | 2 | ||||
-rw-r--r-- | sc/source/filter/oox/condformatbuffer.cxx | 2 | ||||
-rw-r--r-- | sc/source/filter/oox/themebuffer.cxx | 6 |
3 files changed, 9 insertions, 1 deletions
diff --git a/sc/source/filter/inc/themebuffer.hxx b/sc/source/filter/inc/themebuffer.hxx index 84ff9eaf1cc1..21f560ad27f6 100644 --- a/sc/source/filter/inc/themebuffer.hxx +++ b/sc/source/filter/inc/themebuffer.hxx @@ -37,6 +37,8 @@ public: /** Returns the theme color with the specified token identifier. */ sal_Int32 getColorByToken( sal_Int32 nToken ) const; + sal_Int32 getColorByIndex(size_t nIndex) const; + /** Returns the default font data for the current file type. */ inline const FontModel& getDefaultFontModel() const { return *mxDefFontModel; } diff --git a/sc/source/filter/oox/condformatbuffer.cxx b/sc/source/filter/oox/condformatbuffer.cxx index 2c0414226323..cfe4af21b167 100644 --- a/sc/source/filter/oox/condformatbuffer.cxx +++ b/sc/source/filter/oox/condformatbuffer.cxx @@ -245,7 +245,7 @@ void DataBarRule::importColor( const AttributeList& rAttribs ) else if( rAttribs.hasAttribute( XML_theme ) ) { sal_uInt32 nThemeIndex = rAttribs.getUnsigned( XML_theme, 0 ); - nColor = getTheme().getColorByToken( nThemeIndex ); + nColor = getTheme().getColorByIndex( nThemeIndex ); } ::Color aColor = RgbToRgbComponents( nColor ); diff --git a/sc/source/filter/oox/themebuffer.cxx b/sc/source/filter/oox/themebuffer.cxx index 58ed24219cfc..a4dfc32574ce 100644 --- a/sc/source/filter/oox/themebuffer.cxx +++ b/sc/source/filter/oox/themebuffer.cxx @@ -56,6 +56,12 @@ sal_Int32 ThemeBuffer::getColorByToken( sal_Int32 nToken ) const return getClrScheme().getColor( nToken, nColor ) ? nColor : API_RGB_TRANSPARENT; } +sal_Int32 ThemeBuffer::getColorByIndex(size_t nIndex) const +{ + sal_Int32 nColor = 0; + return getClrScheme().getColorByIndex(nIndex, nColor) ? nColor : API_RGB_TRANSPARENT; +} + } // namespace xls } // namespace oox |