20#include <com/sun/star/uno/Sequence.hxx>
27#include <officecfg/Office/Chart.hxx>
29#define ROW_COLOR_COUNT 12
43 SAL_WARN(
"cui.options",
"SvxChartColorTable::[] invalid index" );
54 SAL_WARN(
"cui.options",
"SvxChartColorTable::getColorData invalid index" );
86 "SvxChartColorTable::replace invalid index" );
93 static const Color aColors[] = {
94 Color( 0x00, 0x45, 0x86 ),
95 Color( 0xff, 0x42, 0x0e ),
96 Color( 0xff, 0xd3, 0x20 ),
97 Color( 0x57, 0x9d, 0x1c ),
98 Color( 0x7e, 0x00, 0x21 ),
99 Color( 0x83, 0xca, 0xff ),
100 Color( 0x31, 0x40, 0x04 ),
101 Color( 0xae, 0xcf, 0x00 ),
102 Color( 0x4b, 0x1f, 0x6f ),
103 Color( 0xff, 0x95, 0x0e ),
104 Color( 0xc5, 0x00, 0x0b ),
105 Color( 0x00, 0x84, 0xd1 )
120 std::u16string_view sDefaultNamePrefix;
121 std::u16string_view sDefaultNamePostfix;
122 OUString aResName(
CuiResId( RID_CUISTR_DIAGRAM_ROW ) );
123 sal_Int32
nPos = aResName.indexOf(
"$(ROW)" );
126 sDefaultNamePrefix = aResName.subView( 0,
nPos );
127 sDefaultNamePostfix = aResName.subView(
nPos +
sizeof(
"$(ROW)" ) - 1 );
131 sDefaultNamePrefix = aResName;
134 aName = sDefaultNamePrefix + OUString::number(_nIndex + 1) + sDefaultNamePostfix;
168 sal_Int32
nCount = aColorSeq.getLength();
172 OUString aResName(
CuiResId( RID_CUISTR_DIAGRAM_ROW ) );
173 std::u16string_view aPrefix, aPostfix;
175 sal_Int32
nPos = aResName.indexOf(
"$(ROW)" );
178 aPrefix = aResName.subView( 0,
nPos );
179 sal_Int32
idx =
nPos +
sizeof(
"$(ROW)" ) - 1;
180 aPostfix = aResName.subView(
idx );
191 aName = aPrefix + OUString::number(
i + 1) + aPostfix;
205 auto aColorsRange = asNonConstRange(aColors);
209 aColorsRange[
i ] = sal_uInt32(
aData);
212 officecfg::Office::Chart::DefaultColor::Series::set(aColors, batch);
219 m_aColorTable(
std::move( aTable ))
230 assert(SfxPoolItem::operator==(rAttr));
virtual SvxChartColorTableItem * Clone(SfxItemPool *pPool=nullptr) const override
SvxChartColorTableItem(sal_uInt16 nWhich, SvxChartColorTable)
SvxChartColorTable m_aColorTable
virtual bool operator==(const SfxPoolItem &) const override
void remove(size_t _nIndex)
bool operator==(const SvxChartColorTable &_rOther) const
std::vector< XColorEntry > m_aColorEntries
void replace(size_t _nIndex, const XColorEntry &_rEntry)
const XColorEntry & operator[](size_t _nIndex) const
static OUString getDefaultName(size_t _nIndex)
void append(const XColorEntry &_rEntry)
Color getColor(size_t _nIndex) const
static std::shared_ptr< ConfigurationChanges > create()
constexpr ::Color COL_BLACK(0x00, 0x00, 0x00)
OUString CuiResId(TranslateId aKey)
#define DBG_ASSERT(sCon, aError)
#define SAL_WARN(area, stream)
constexpr OUStringLiteral aData
void SetDefaultColors(const SvxChartColorTable &aCol)
SvxChartColorTable GetDefaultColors()