summaryrefslogtreecommitdiffstats
path: root/sw/source/core/doc/docfmt.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sw/source/core/doc/docfmt.cxx')
-rw-r--r--sw/source/core/doc/docfmt.cxx18
1 files changed, 6 insertions, 12 deletions
diff --git a/sw/source/core/doc/docfmt.cxx b/sw/source/core/doc/docfmt.cxx
index 57c42c529e..d6c943dbcd 100644
--- a/sw/source/core/doc/docfmt.cxx
+++ b/sw/source/core/doc/docfmt.cxx
@@ -25,10 +25,10 @@
#include <editeng/lrspitem.hxx>
#include <editeng/formatbreakitem.hxx>
#include <editeng/rsiditem.hxx>
-#include <editeng/colritem.hxx>
#include <officecfg/Office/Common.hxx>
#include <osl/diagnose.h>
#include <svl/zforlist.hxx>
+#include <svx/DocumentColorHelper.hxx>
#include <comphelper/processfactory.hxx>
#include <unotools/configmgr.hxx>
#include <sal/log.hxx>
@@ -2036,17 +2036,11 @@ std::set<Color> SwDoc::GetDocColors()
{
std::set<Color> aDocColors;
SwAttrPool& rPool = GetAttrPool();
- const sal_uInt16 pAttribs[] = {RES_CHRATR_COLOR, RES_CHRATR_HIGHLIGHT, RES_BACKGROUND};
- for (sal_uInt16 nAttrib : pAttribs)
- {
- for (const SfxPoolItem* pItem : rPool.GetItemSurrogates(nAttrib))
- {
- auto pColorItem = static_cast<const SvxColorItem*>(pItem);
- Color aColor( pColorItem->GetValue() );
- if (COL_AUTO != aColor)
- aDocColors.insert(aColor);
- }
- }
+
+ svx::DocumentColorHelper::queryColors<SvxColorItem>(RES_CHRATR_COLOR, &rPool, aDocColors);
+ svx::DocumentColorHelper::queryColors<SvxBrushItem>(RES_CHRATR_HIGHLIGHT, &rPool, aDocColors);
+ svx::DocumentColorHelper::queryColors<SvxBrushItem>(RES_CHRATR_BACKGROUND, &rPool, aDocColors);
+
return aDocColors;
}