From 5a7157d319477830426797532e02ac39d3b859f4 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Mon, 15 Apr 2024 11:29:03 +0200 Subject: Merging upstream version 4:24.2.1. Signed-off-by: Daniel Baumann --- sw/source/core/doc/docfmt.cxx | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) (limited to 'sw/source/core/doc/docfmt.cxx') 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 #include #include -#include #include #include #include +#include #include #include #include @@ -2036,17 +2036,11 @@ std::set SwDoc::GetDocColors() { std::set 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(pItem); - Color aColor( pColorItem->GetValue() ); - if (COL_AUTO != aColor) - aDocColors.insert(aColor); - } - } + + svx::DocumentColorHelper::queryColors(RES_CHRATR_COLOR, &rPool, aDocColors); + svx::DocumentColorHelper::queryColors(RES_CHRATR_HIGHLIGHT, &rPool, aDocColors); + svx::DocumentColorHelper::queryColors(RES_CHRATR_BACKGROUND, &rPool, aDocColors); + return aDocColors; } -- cgit v1.2.3