diff options
author | Jan Holesovsky <kendy@collabora.com> | 2014-09-17 12:46:01 +0200 |
---|---|---|
committer | Jan Holesovsky <kendy@collabora.com> | 2014-09-17 12:47:27 +0200 |
commit | cc6c01632dda28db0da8d007f2fcac63f1c85e38 (patch) | |
tree | d02eabfe4fa22a499f22e8c10e111ce33613872a | |
parent | 2d9cdbd9d9a43e41a7242f9c5bc843fde9362920 (diff) |
Fix Windows build - the same thing in Writer.
Change-Id: Iba40d99dd6c162f20ca35e5a937b7c5ee3d2e126
-rw-r--r-- | sw/source/core/doc/docfmt.cxx | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/sw/source/core/doc/docfmt.cxx b/sw/source/core/doc/docfmt.cxx index 4cd06b279889..1283e4a69e20 100644 --- a/sw/source/core/doc/docfmt.cxx +++ b/sw/source/core/doc/docfmt.cxx @@ -1915,8 +1915,6 @@ 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) @@ -1937,14 +1935,23 @@ std::vector<Color> SwDoc::GetDocColors() if( SfxItemState::SET == pItemSet->GetItemState( nWhich, false, &pItem ) ) { sal_uInt16 aWhich = pItem->Which(); - if( std::find(aColAttrs.begin(), aColAttrs.end(), aWhich) != aColAttrs.end() ) + switch (aWhich) { - Color aColor( ((SvxColorItem*)pItem)->GetValue() ); - if( COL_AUTO != aColor.GetColor() && - std::find(docColors.begin(), docColors.end(), aColor) == docColors.end() ) - { - docColors.push_back( aColor ); - } + // list of color attributes to collect + case RES_CHRATR_COLOR: + case RES_CHRATR_HIGHLIGHT: + case RES_BACKGROUND: + { + Color aColor( ((SvxColorItem*)pItem)->GetValue() ); + if( COL_AUTO != aColor.GetColor() && + std::find(docColors.begin(), docColors.end(), aColor) == docColors.end() ) + { + docColors.push_back( aColor ); + } + } + break; + default: + break; } } |