summaryrefslogtreecommitdiff
path: root/sw/source/core/doc/docfmt.cxx
diff options
context:
space:
mode:
authorKrisztian Pinter <pin.terminator@gmail.com>2014-07-28 16:21:35 +0200
committerTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2014-09-17 10:19:51 +0200
commitd5109b2fcf1ed7880e7e68c70daaa2f05b0b3cea (patch)
tree79bed66eb27b38594b1a2086f77e976e25229562 /sw/source/core/doc/docfmt.cxx
parent78afbfa1cb0f99a62dc643fc64e38c1eaa2014f1 (diff)
Make it easier to add new color attributes to GetDocColors
Change-Id: I2098892fc44c7a8bde1eb30f6db1709e58925577
Diffstat (limited to 'sw/source/core/doc/docfmt.cxx')
-rw-r--r--sw/source/core/doc/docfmt.cxx6
1 files changed, 3 insertions, 3 deletions
diff --git a/sw/source/core/doc/docfmt.cxx b/sw/source/core/doc/docfmt.cxx
index e78b524c5873..539e3a2e6a12 100644
--- a/sw/source/core/doc/docfmt.cxx
+++ b/sw/source/core/doc/docfmt.cxx
@@ -1915,6 +1915,8 @@ void SwDoc::RenameFmt(SwFmt & rFmt, const OUString & sNewName,
std::vector<Color> SwDoc::GetDocColors()
{
+ // list of color attributes to collect
+ const std::vector<sal_uInt16> aColAttrs({RES_CHRATR_COLOR, RES_CHRATR_HIGHLIGHT, RES_BACKGROUND});
std::vector<Color> docColors;
for(unsigned int i = 0; i < m_pNodes->Count(); ++i)
@@ -1935,9 +1937,7 @@ std::vector<Color> SwDoc::GetDocColors()
if( SFX_ITEM_SET == pItemSet->GetItemState( nWhich, false, &pItem ) )
{
sal_uInt16 aWhich = pItem->Which();
- if( RES_CHRATR_COLOR == aWhich ||
- RES_CHRATR_HIGHLIGHT == aWhich ||
- RES_BACKGROUND == aWhich )
+ if( std::find(aColAttrs.begin(), aColAttrs.end(), aWhich) != aColAttrs.end() )
{
Color aColor( ((SvxColorItem*)pItem)->GetValue() );
if( COL_AUTO != aColor.GetColor() &&