22#include <com/sun/star/uno/Sequence.hxx>
23#include <com/sun/star/util/Color.hpp>
25#include <osl/diagnose.h>
27#include <oox/token/tokens.hxx>
30#include <frozen/bits/defines.h>
31#include <frozen/bits/elsa_std.h>
32#include <frozen/unordered_map.h>
41constexpr frozen::unordered_map<PredefinedClrSchemeId, std::u16string_view, 12> constPredefinedClrNames
61 std::u16string_view empty;
62 auto iterator = constPredefinedClrNames.find(eID);
63 if (iterator == constPredefinedClrNames.end())
65 return iterator->second;
70 sal_Int32 nMapped = 0;
71 std::map < sal_Int32, sal_Int32 >::const_iterator aIter(
maClrMap.find( nClrToken ) );
73 nMapped = (*aIter).second;
85 maClrMap[ nClrToken ] = nMappedClrToken;
92 explicit find_by_token(sal_Int32 token):
97 bool operator()(
const std::pair<sal_Int32, ::Color>& r)
110 OSL_ASSERT((nSchemeClrToken & sal_Int32(0xFFFF0000))==0);
111 switch( nSchemeClrToken )
113 case XML_bg1 : nSchemeClrToken = XML_lt1;
break;
114 case XML_bg2 : nSchemeClrToken = XML_lt2;
break;
115 case XML_tx1 : nSchemeClrToken = XML_dk1;
break;
116 case XML_tx2 : nSchemeClrToken = XML_dk2;
break;
117 case XML_background1 : nSchemeClrToken = XML_lt1;
break;
118 case XML_background2 : nSchemeClrToken = XML_lt2;
break;
119 case XML_text1 : nSchemeClrToken = XML_dk1;
break;
120 case XML_text2 : nSchemeClrToken = XML_dk2;
break;
121 case XML_light1 : nSchemeClrToken = XML_lt1;
break;
122 case XML_light2 : nSchemeClrToken = XML_lt2;
break;
123 case XML_dark1 : nSchemeClrToken = XML_dk1;
break;
124 case XML_dark2 : nSchemeClrToken = XML_dk2;
break;
125 case XML_hyperlink : nSchemeClrToken = XML_hlink;
break;
126 case XML_followedHyperlink: nSchemeClrToken = XML_folHlink;
break;
132 rColor = aIter->second;
141 aIter->second = nColor;
157 std::vector<util::Color> aRet;
161 aRet.push_back(
static_cast<sal_Int32
>(rIndexAndColor.second));
void add(model::ThemeColorType Type, Color aColorData)
bool getColorMap(sal_Int32 &nClrToken)
void setColorMap(sal_Int32 nClrToken, sal_Int32 nMappedClrToken)
std::map< sal_Int32, sal_Int32 > maClrMap
bool getColor(sal_Int32 nSchemeClrToken, ::Color &rColor) const
void ToAny(css::uno::Any &rVal) const
bool getColorByIndex(size_t nIndex, ::Color &rColor) const
void setColor(sal_Int32 nSchemeClrToken, ::Color nColor)
std::vector< std::pair< sal_Int32, ::Color > > maClrScheme
void fill(model::ColorSet &rColorSet) const
css::uno::Sequence< DstElementType > containerToSequence(const SrcType &i_Container)
std::u16string_view getPredefinedClrNames(PredefinedClrSchemeId eID)