diff options
author | Krisztian Pinter <pin.terminator@gmail.com> | 2014-07-28 16:21:35 +0200 |
---|---|---|
committer | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2014-09-17 10:19:51 +0200 |
commit | d5109b2fcf1ed7880e7e68c70daaa2f05b0b3cea (patch) | |
tree | 79bed66eb27b38594b1a2086f77e976e25229562 /sc | |
parent | 78afbfa1cb0f99a62dc643fc64e38c1eaa2014f1 (diff) |
Make it easier to add new color attributes to GetDocColors
Change-Id: I2098892fc44c7a8bde1eb30f6db1709e58925577
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/core/data/document10.cxx | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sc/source/core/data/document10.cxx b/sc/source/core/data/document10.cxx index 9d1509979bff..0e12001152b9 100644 --- a/sc/source/core/data/document10.cxx +++ b/sc/source/core/data/document10.cxx @@ -248,6 +248,8 @@ void ScDocument::CopyCellValuesFrom( const ScAddress& rTopPos, const sc::CellVal std::vector<Color> ScDocument::GetDocColors() { + // list of color attributes to collect + const std::vector<sal_uInt16> aColAttrs({ATTR_FONT_COLOR, ATTR_BACKGROUND}); std::vector<Color> docColors; for( unsigned int nTabIx = 0; nTabIx < maTabs.size(); ++nTabIx ) @@ -271,8 +273,7 @@ std::vector<Color> ScDocument::GetDocColors() if( SFX_ITEM_SET == rItemSet.GetItemState( nWhich, false, &pItem ) ) { sal_uInt16 aWhich = pItem->Which(); - if( ATTR_FONT_COLOR == aWhich || - ATTR_BACKGROUND == aWhich ) + if( std::find(aColAttrs.begin(), aColAttrs.end(), aWhich) != aColAttrs.end() ) { Color aColor( ((SvxColorItem*)pItem)->GetValue() ); if( COL_AUTO != aColor.GetColor() && |