1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #include "ChartItemPool.hxx"
21 #include <chartview/ChartSfxItemIds.hxx>
22 #include <DataSeries.hxx>
23 #include <FormattedString.hxx>
26 #include <svx/chrtitem.hxx>
27 #include <svx/sdangitm.hxx>
28 #include <svx/svdpool.hxx>
29 #include <svx/svx3ditems.hxx>
30 #include <svl/intitem.hxx>
31 #include <editeng/editeng.hxx>
32 #include <editeng/brushitem.hxx>
33 #include <editeng/eeitem.hxx>
34 #include <editeng/sizeitem.hxx>
35 #include <svl/stritem.hxx>
36 #include <svl/ilstitem.hxx>
37 #include <comphelper/processfactory.hxx>
38 #include <editeng/editids.hrc>
39 #include <svx/svxids.hrc>
42 #include <com/sun/star/chart2/LegendPosition.hpp>
43 #include <com/sun/star/chart2/MovingAverageType.hpp>
44 #include <com/sun/star/frame/XTerminateListener.hpp>
45 #include <com/sun/star/frame/Desktop.hpp>
50 static ItemInfoPackage
& getItemInfoPackageChart()
52 class ItemInfoPackageChart
: public ItemInfoPackage
54 typedef std::array
<ItemInfoStatic
, SCHATTR_END
- SCHATTR_START
+ 1> ItemInfoArrayChart
;
55 ItemInfoArrayChart maItemInfos
{{
56 // m_nWhich, m_pItem, m_nSlotID, m_nItemInfoFlags
57 { SCHATTR_DATADESCR_SHOW_NUMBER
, new SfxBoolItem(SCHATTR_DATADESCR_SHOW_NUMBER
), 0, SFX_ITEMINFOFLAG_NONE
},
58 { SCHATTR_DATADESCR_SHOW_PERCENTAGE
, new SfxBoolItem(SCHATTR_DATADESCR_SHOW_PERCENTAGE
), 0, SFX_ITEMINFOFLAG_NONE
},
59 { SCHATTR_DATADESCR_SHOW_CATEGORY
, new SfxBoolItem(SCHATTR_DATADESCR_SHOW_CATEGORY
), 0, SFX_ITEMINFOFLAG_NONE
},
60 { SCHATTR_DATADESCR_SHOW_SYMBOL
, new SfxBoolItem(SCHATTR_DATADESCR_SHOW_SYMBOL
), 0, SFX_ITEMINFOFLAG_NONE
},
61 { SCHATTR_DATADESCR_WRAP_TEXT
, new SfxBoolItem(SCHATTR_DATADESCR_WRAP_TEXT
), 0, SFX_ITEMINFOFLAG_NONE
},
62 { SCHATTR_DATADESCR_SEPARATOR
, new SfxStringItem(SCHATTR_DATADESCR_SEPARATOR
,u
" "_ustr
), 0, SFX_ITEMINFOFLAG_NONE
},
63 { SCHATTR_DATADESCR_PLACEMENT
, new SfxInt32Item(SCHATTR_DATADESCR_PLACEMENT
,0), 0, SFX_ITEMINFOFLAG_NONE
},
64 { SCHATTR_DATADESCR_AVAILABLE_PLACEMENTS
, new SfxIntegerListItem(SCHATTR_DATADESCR_AVAILABLE_PLACEMENTS
, std::vector
< sal_Int32
>() ), 0, SFX_ITEMINFOFLAG_NONE
},
65 { SCHATTR_DATADESCR_NO_PERCENTVALUE
, new SfxBoolItem(SCHATTR_DATADESCR_NO_PERCENTVALUE
), 0, SFX_ITEMINFOFLAG_NONE
},
66 { SCHATTR_DATADESCR_CUSTOM_LEADER_LINES
, new SfxBoolItem(SCHATTR_DATADESCR_CUSTOM_LEADER_LINES
, true), 0, SFX_ITEMINFOFLAG_NONE
},
67 { SCHATTR_PERCENT_NUMBERFORMAT_VALUE
, new SfxUInt32Item(SCHATTR_PERCENT_NUMBERFORMAT_VALUE
, 0), 0, SFX_ITEMINFOFLAG_NONE
},
68 { SCHATTR_PERCENT_NUMBERFORMAT_SOURCE
, new SfxBoolItem(SCHATTR_PERCENT_NUMBERFORMAT_SOURCE
), 0, SFX_ITEMINFOFLAG_NONE
},
69 { SCHATTR_DATADESCR_SHOW_DATA_SERIES_NAME
, new SfxBoolItem(SCHATTR_DATADESCR_SHOW_DATA_SERIES_NAME
), 0, SFX_ITEMINFOFLAG_NONE
},
72 { SCHATTR_LEGEND_POS
, new SfxInt32Item(SCHATTR_LEGEND_POS
, sal_Int32(css::chart2::LegendPosition_LINE_END
) ), 0, SFX_ITEMINFOFLAG_NONE
},
73 { SCHATTR_LEGEND_SHOW
, new SfxBoolItem(SCHATTR_LEGEND_SHOW
, true), 0, SFX_ITEMINFOFLAG_NONE
},
74 { SCHATTR_LEGEND_NO_OVERLAY
, new SfxBoolItem(SCHATTR_LEGEND_NO_OVERLAY
, true), 0, SFX_ITEMINFOFLAG_NONE
},
77 { SCHATTR_TEXT_DEGREES
, new SdrAngleItem(SCHATTR_TEXT_DEGREES
, 0_deg100
), 0, SFX_ITEMINFOFLAG_NONE
},
78 { SCHATTR_TEXT_STACKED
, new SfxBoolItem(SCHATTR_TEXT_STACKED
,false), 0, SFX_ITEMINFOFLAG_NONE
},
81 { SCHATTR_STAT_AVERAGE
, new SfxBoolItem (SCHATTR_STAT_AVERAGE
), 0, SFX_ITEMINFOFLAG_NONE
},
82 { SCHATTR_STAT_KIND_ERROR
, new SvxChartKindErrorItem (SvxChartKindError::NONE
, SCHATTR_STAT_KIND_ERROR
), 0, SFX_ITEMINFOFLAG_NONE
},
83 { SCHATTR_STAT_PERCENT
, new SvxDoubleItem (0.0, SCHATTR_STAT_PERCENT
), 0, SFX_ITEMINFOFLAG_NONE
},
84 { SCHATTR_STAT_BIGERROR
, new SvxDoubleItem (0.0, SCHATTR_STAT_BIGERROR
), 0, SFX_ITEMINFOFLAG_NONE
},
85 { SCHATTR_STAT_CONSTPLUS
, new SvxDoubleItem (0.0, SCHATTR_STAT_CONSTPLUS
), 0, SFX_ITEMINFOFLAG_NONE
},
86 { SCHATTR_STAT_CONSTMINUS
, new SvxDoubleItem (0.0, SCHATTR_STAT_CONSTMINUS
), 0, SFX_ITEMINFOFLAG_NONE
},
87 { SCHATTR_STAT_INDICATE
, new SvxChartIndicateItem (SvxChartIndicate::NONE
, SCHATTR_STAT_INDICATE
), 0, SFX_ITEMINFOFLAG_NONE
},
88 { SCHATTR_STAT_RANGE_POS
, new SfxStringItem (SCHATTR_STAT_RANGE_POS
, OUString()), 0, SFX_ITEMINFOFLAG_NONE
},
89 { SCHATTR_STAT_RANGE_NEG
, new SfxStringItem (SCHATTR_STAT_RANGE_NEG
, OUString()), 0, SFX_ITEMINFOFLAG_NONE
},
90 { SCHATTR_STAT_ERRORBAR_TYPE
, new SfxBoolItem(SCHATTR_STAT_ERRORBAR_TYPE
, true), 0, SFX_ITEMINFOFLAG_NONE
},
92 { SCHATTR_STYLE_DEEP
, new SfxBoolItem (SCHATTR_STYLE_DEEP
, false), 0, SFX_ITEMINFOFLAG_NONE
},
93 { SCHATTR_STYLE_3D
, new SfxBoolItem (SCHATTR_STYLE_3D
, false), 0, SFX_ITEMINFOFLAG_NONE
},
94 { SCHATTR_STYLE_VERTICAL
, new SfxBoolItem (SCHATTR_STYLE_VERTICAL
, false), 0, SFX_ITEMINFOFLAG_NONE
},
95 { SCHATTR_STYLE_BASETYPE
, new SfxInt32Item(SCHATTR_STYLE_BASETYPE
, 0), 0, SFX_ITEMINFOFLAG_NONE
},
96 { SCHATTR_STYLE_LINES
, new SfxBoolItem (SCHATTR_STYLE_LINES
, false), 0, SFX_ITEMINFOFLAG_NONE
},
97 { SCHATTR_STYLE_PERCENT
, new SfxBoolItem (SCHATTR_STYLE_PERCENT
, false), 0, SFX_ITEMINFOFLAG_NONE
},
98 { SCHATTR_STYLE_STACKED
, new SfxBoolItem (SCHATTR_STYLE_STACKED
, false), 0, SFX_ITEMINFOFLAG_NONE
},
99 { SCHATTR_STYLE_SPLINES
, new SfxInt32Item (SCHATTR_STYLE_SPLINES
, 0), 0, SFX_ITEMINFOFLAG_NONE
},
100 { SCHATTR_STYLE_SYMBOL
, new SfxInt32Item (SCHATTR_STYLE_SYMBOL
, 0), SID_ATTR_SYMBOLTYPE
, SFX_ITEMINFOFLAG_NONE
},
101 { SCHATTR_STYLE_SHAPE
, new SfxInt32Item (SCHATTR_STYLE_SHAPE
, 0), 0, SFX_ITEMINFOFLAG_NONE
},
103 { SCHATTR_AXIS
, new SfxInt32Item(SCHATTR_AXIS
,2), 0, SFX_ITEMINFOFLAG_NONE
},
106 { SCHATTR_AXISTYPE
, new SfxInt32Item(SCHATTR_AXISTYPE
, CHART_AXIS_REALNUMBER
), 0, SFX_ITEMINFOFLAG_NONE
},
107 { SCHATTR_AXIS_REVERSE
, new SfxBoolItem(SCHATTR_AXIS_REVERSE
,false), 0, SFX_ITEMINFOFLAG_NONE
},
108 { SCHATTR_AXIS_AUTO_MIN
, new SfxBoolItem(SCHATTR_AXIS_AUTO_MIN
), 0, SFX_ITEMINFOFLAG_NONE
},
109 { SCHATTR_AXIS_MIN
, new SvxDoubleItem(0.0, SCHATTR_AXIS_MIN
), 0, SFX_ITEMINFOFLAG_NONE
},
110 { SCHATTR_AXIS_AUTO_MAX
, new SfxBoolItem(SCHATTR_AXIS_AUTO_MAX
), 0, SFX_ITEMINFOFLAG_NONE
},
111 { SCHATTR_AXIS_MAX
, new SvxDoubleItem(0.0, SCHATTR_AXIS_MAX
), 0, SFX_ITEMINFOFLAG_NONE
},
112 { SCHATTR_AXIS_AUTO_STEP_MAIN
, new SfxBoolItem(SCHATTR_AXIS_AUTO_STEP_MAIN
), 0, SFX_ITEMINFOFLAG_NONE
},
113 { SCHATTR_AXIS_STEP_MAIN
, new SvxDoubleItem(0.0, SCHATTR_AXIS_STEP_MAIN
), 0, SFX_ITEMINFOFLAG_NONE
},
114 { SCHATTR_AXIS_MAIN_TIME_UNIT
, new SfxInt32Item(SCHATTR_AXIS_MAIN_TIME_UNIT
,2), 0, SFX_ITEMINFOFLAG_NONE
},
115 { SCHATTR_AXIS_AUTO_STEP_HELP
, new SfxBoolItem(SCHATTR_AXIS_AUTO_STEP_HELP
), 0, SFX_ITEMINFOFLAG_NONE
},
116 { SCHATTR_AXIS_STEP_HELP
, new SfxInt32Item(SCHATTR_AXIS_STEP_HELP
,0), 0, SFX_ITEMINFOFLAG_NONE
},
117 { SCHATTR_AXIS_HELP_TIME_UNIT
, new SfxInt32Item(SCHATTR_AXIS_HELP_TIME_UNIT
,2), 0, SFX_ITEMINFOFLAG_NONE
},
118 { SCHATTR_AXIS_AUTO_TIME_RESOLUTION
, new SfxBoolItem(SCHATTR_AXIS_AUTO_TIME_RESOLUTION
), 0, SFX_ITEMINFOFLAG_NONE
},
119 { SCHATTR_AXIS_TIME_RESOLUTION
, new SfxInt32Item(SCHATTR_AXIS_TIME_RESOLUTION
,2), 0, SFX_ITEMINFOFLAG_NONE
},
120 { SCHATTR_AXIS_LOGARITHM
, new SfxBoolItem(SCHATTR_AXIS_LOGARITHM
), 0, SFX_ITEMINFOFLAG_NONE
},
121 { SCHATTR_AXIS_AUTO_DATEAXIS
, new SfxBoolItem(SCHATTR_AXIS_AUTO_DATEAXIS
), 0, SFX_ITEMINFOFLAG_NONE
},
122 { SCHATTR_AXIS_ALLOW_DATEAXIS
, new SfxBoolItem(SCHATTR_AXIS_ALLOW_DATEAXIS
), 0, SFX_ITEMINFOFLAG_NONE
},
123 { SCHATTR_AXIS_AUTO_ORIGIN
, new SfxBoolItem(SCHATTR_AXIS_AUTO_ORIGIN
), 0, SFX_ITEMINFOFLAG_NONE
},
124 { SCHATTR_AXIS_ORIGIN
, new SvxDoubleItem(0.0, SCHATTR_AXIS_ORIGIN
), 0, SFX_ITEMINFOFLAG_NONE
},
127 { SCHATTR_AXIS_TICKS
, new SfxInt32Item(SCHATTR_AXIS_TICKS
,CHAXIS_MARK_OUTER
), 0, SFX_ITEMINFOFLAG_NONE
},
128 { SCHATTR_AXIS_HELPTICKS
, new SfxInt32Item(SCHATTR_AXIS_HELPTICKS
,0), 0, SFX_ITEMINFOFLAG_NONE
},
129 { SCHATTR_AXIS_POSITION
, new SfxInt32Item(SCHATTR_AXIS_POSITION
,0), 0, SFX_ITEMINFOFLAG_NONE
},
130 { SCHATTR_AXIS_POSITION_VALUE
, new SvxDoubleItem(0.0, SCHATTR_AXIS_POSITION_VALUE
), 0, SFX_ITEMINFOFLAG_NONE
},
131 { SCHATTR_AXIS_CROSSING_MAIN_AXIS_NUMBERFORMAT
, new SfxUInt32Item(SCHATTR_AXIS_CROSSING_MAIN_AXIS_NUMBERFORMAT
,0), 0, SFX_ITEMINFOFLAG_NONE
},
132 { SCHATTR_AXIS_SHIFTED_CATEGORY_POSITION
, new SfxBoolItem(SCHATTR_AXIS_SHIFTED_CATEGORY_POSITION
,false), 0, SFX_ITEMINFOFLAG_NONE
},
133 { SCHATTR_AXIS_LABEL_POSITION
, new SfxInt32Item(SCHATTR_AXIS_LABEL_POSITION
,0), 0, SFX_ITEMINFOFLAG_NONE
},
134 { SCHATTR_AXIS_MARK_POSITION
, new SfxInt32Item(SCHATTR_AXIS_MARK_POSITION
,0), 0, SFX_ITEMINFOFLAG_NONE
},
137 { SCHATTR_AXIS_SHOWDESCR
, new SfxBoolItem(SCHATTR_AXIS_SHOWDESCR
,false), 0, SFX_ITEMINFOFLAG_NONE
},
138 { SCHATTR_AXIS_LABEL_ORDER
, new SvxChartTextOrderItem(SvxChartTextOrder::SideBySide
, SCHATTR_AXIS_LABEL_ORDER
), 0, SFX_ITEMINFOFLAG_NONE
},
139 { SCHATTR_AXIS_LABEL_OVERLAP
, new SfxBoolItem(SCHATTR_AXIS_LABEL_OVERLAP
,false), 0, SFX_ITEMINFOFLAG_NONE
},
140 { SCHATTR_AXIS_LABEL_BREAK
, new SfxBoolItem(SCHATTR_AXIS_LABEL_BREAK
, false ), 0, SFX_ITEMINFOFLAG_NONE
},
142 { SCHATTR_SYMBOL_BRUSH
, new SvxBrushItem(SCHATTR_SYMBOL_BRUSH
), SID_ATTR_BRUSH
, SFX_ITEMINFOFLAG_NONE
},
143 { SCHATTR_STOCK_VOLUME
, new SfxBoolItem(SCHATTR_STOCK_VOLUME
,false), 0, SFX_ITEMINFOFLAG_NONE
},
144 { SCHATTR_STOCK_UPDOWN
, new SfxBoolItem(SCHATTR_STOCK_UPDOWN
,false), 0, SFX_ITEMINFOFLAG_NONE
},
145 { SCHATTR_SYMBOL_SIZE
, new SvxSizeItem(SCHATTR_SYMBOL_SIZE
,Size(0,0)), SID_ATTR_SYMBOLSIZE
, SFX_ITEMINFOFLAG_NONE
},
146 { SCHATTR_HIDE_DATA_POINT_LEGEND_ENTRY
, new SfxBoolItem(SCHATTR_HIDE_DATA_POINT_LEGEND_ENTRY
, false), 0, SFX_ITEMINFOFLAG_NONE
},
149 { SCHATTR_BAR_OVERLAP
, new SfxInt32Item(SCHATTR_BAR_OVERLAP
,0), 0, SFX_ITEMINFOFLAG_NONE
},
150 { SCHATTR_BAR_GAPWIDTH
, new SfxInt32Item(SCHATTR_BAR_GAPWIDTH
,0), 0, SFX_ITEMINFOFLAG_NONE
},
151 { SCHATTR_BAR_CONNECT
, new SfxBoolItem(SCHATTR_BAR_CONNECT
, false), 0, SFX_ITEMINFOFLAG_NONE
},
152 { SCHATTR_NUM_OF_LINES_FOR_BAR
, new SfxInt32Item( SCHATTR_NUM_OF_LINES_FOR_BAR
, 0 ), 0, SFX_ITEMINFOFLAG_NONE
},
153 { SCHATTR_SPLINE_ORDER
, new SfxInt32Item( SCHATTR_SPLINE_ORDER
, 3 ), 0, SFX_ITEMINFOFLAG_NONE
},
154 { SCHATTR_SPLINE_RESOLUTION
, new SfxInt32Item( SCHATTR_SPLINE_RESOLUTION
, 20 ), 0, SFX_ITEMINFOFLAG_NONE
},
155 { SCHATTR_GROUP_BARS_PER_AXIS
, new SfxBoolItem(SCHATTR_GROUP_BARS_PER_AXIS
, false), 0, SFX_ITEMINFOFLAG_NONE
},
156 { SCHATTR_STARTING_ANGLE
, new SdrAngleItem( SCHATTR_STARTING_ANGLE
, 9000_deg100
), 0, SFX_ITEMINFOFLAG_NONE
},
157 { SCHATTR_CLOCKWISE
, new SfxBoolItem( SCHATTR_CLOCKWISE
, false ), 0, SFX_ITEMINFOFLAG_NONE
},
158 { SCHATTR_MISSING_VALUE_TREATMENT
, new SfxInt32Item(SCHATTR_MISSING_VALUE_TREATMENT
, 0), 0, SFX_ITEMINFOFLAG_NONE
},
159 { SCHATTR_AVAILABLE_MISSING_VALUE_TREATMENTS
, new SfxIntegerListItem(SCHATTR_AVAILABLE_MISSING_VALUE_TREATMENTS
, std::vector
< sal_Int32
>() ), 0, SFX_ITEMINFOFLAG_NONE
},
160 { SCHATTR_INCLUDE_HIDDEN_CELLS
, new SfxBoolItem(SCHATTR_INCLUDE_HIDDEN_CELLS
, true), 0, SFX_ITEMINFOFLAG_NONE
},
161 { SCHATTR_HIDE_LEGEND_ENTRY
, new SfxBoolItem(SCHATTR_HIDE_LEGEND_ENTRY
, false), 0, SFX_ITEMINFOFLAG_NONE
},
163 { SCHATTR_AXIS_FOR_ALL_SERIES
, new SfxInt32Item(SCHATTR_AXIS_FOR_ALL_SERIES
, 0), 0, SFX_ITEMINFOFLAG_NONE
},
165 { SCHATTR_REGRESSION_TYPE
, new SvxChartRegressItem (SvxChartRegress::NONE
, SCHATTR_REGRESSION_TYPE
), 0, SFX_ITEMINFOFLAG_NONE
},
166 { SCHATTR_REGRESSION_SHOW_EQUATION
, new SfxBoolItem(SCHATTR_REGRESSION_SHOW_EQUATION
, false), 0, SFX_ITEMINFOFLAG_NONE
},
167 { SCHATTR_REGRESSION_SHOW_COEFF
, new SfxBoolItem(SCHATTR_REGRESSION_SHOW_COEFF
, false), 0, SFX_ITEMINFOFLAG_NONE
},
168 { SCHATTR_REGRESSION_DEGREE
, new SfxInt32Item(SCHATTR_REGRESSION_DEGREE
, 2), 0, SFX_ITEMINFOFLAG_NONE
},
169 { SCHATTR_REGRESSION_PERIOD
, new SfxInt32Item(SCHATTR_REGRESSION_PERIOD
, 2), 0, SFX_ITEMINFOFLAG_NONE
},
170 { SCHATTR_REGRESSION_EXTRAPOLATE_FORWARD
, new SvxDoubleItem(0.0, SCHATTR_REGRESSION_EXTRAPOLATE_FORWARD
), 0, SFX_ITEMINFOFLAG_NONE
},
171 { SCHATTR_REGRESSION_EXTRAPOLATE_BACKWARD
, new SvxDoubleItem(0.0, SCHATTR_REGRESSION_EXTRAPOLATE_BACKWARD
), 0, SFX_ITEMINFOFLAG_NONE
},
172 { SCHATTR_REGRESSION_SET_INTERCEPT
, new SfxBoolItem(SCHATTR_REGRESSION_SET_INTERCEPT
, false), 0, SFX_ITEMINFOFLAG_NONE
},
173 { SCHATTR_REGRESSION_INTERCEPT_VALUE
, new SvxDoubleItem(0.0, SCHATTR_REGRESSION_INTERCEPT_VALUE
), 0, SFX_ITEMINFOFLAG_NONE
},
174 { SCHATTR_REGRESSION_CURVE_NAME
, new SfxStringItem(SCHATTR_REGRESSION_CURVE_NAME
, OUString()), 0, SFX_ITEMINFOFLAG_NONE
},
175 { SCHATTR_REGRESSION_XNAME
, new SfxStringItem(SCHATTR_REGRESSION_XNAME
, u
"x"_ustr
), 0, SFX_ITEMINFOFLAG_NONE
},
176 { SCHATTR_REGRESSION_YNAME
, new SfxStringItem(SCHATTR_REGRESSION_YNAME
, u
"f(x)"_ustr
), 0, SFX_ITEMINFOFLAG_NONE
},
177 { SCHATTR_REGRESSION_MOVING_TYPE
, new SfxInt32Item(SCHATTR_REGRESSION_MOVING_TYPE
, css::chart2::MovingAverageType::Prior
), 0, SFX_ITEMINFOFLAG_NONE
},
179 { SCHATTR_DATA_TABLE_HORIZONTAL_BORDER
, new SfxBoolItem(SCHATTR_DATA_TABLE_HORIZONTAL_BORDER
, false), 0, SFX_ITEMINFOFLAG_NONE
},
180 { SCHATTR_DATA_TABLE_VERTICAL_BORDER
, new SfxBoolItem(SCHATTR_DATA_TABLE_VERTICAL_BORDER
, false), 0, SFX_ITEMINFOFLAG_NONE
},
181 { SCHATTR_DATA_TABLE_OUTLINE
, new SfxBoolItem(SCHATTR_DATA_TABLE_OUTLINE
, false), 0, SFX_ITEMINFOFLAG_NONE
},
182 { SCHATTR_DATA_TABLE_KEYS
, new SfxBoolItem(SCHATTR_DATA_TABLE_KEYS
, false), 0, SFX_ITEMINFOFLAG_NONE
}
185 virtual const ItemInfoStatic
& getItemInfoStatic(size_t nIndex
) const override
{ return maItemInfos
[nIndex
]; }
188 virtual size_t size() const override
{ return maItemInfos
.size(); }
189 virtual const ItemInfo
& getItemInfo(size_t nIndex
, SfxItemPool
& /*rPool*/) override
{ return maItemInfos
[nIndex
]; }
192 static std::unique_ptr
<ItemInfoPackageChart
> g_aItemInfoPackageChart
;
193 if (!g_aItemInfoPackageChart
)
194 g_aItemInfoPackageChart
.reset(new ItemInfoPackageChart
);
195 return *g_aItemInfoPackageChart
;
198 ChartItemPool::ChartItemPool()
199 : SfxItemPool(u
"ChartItemPool"_ustr
)
201 registerItemInfoPackage(getItemInfoPackageChart());
204 ChartItemPool::ChartItemPool(const ChartItemPool
& rPool
)
209 ChartItemPool::~ChartItemPool()
214 rtl::Reference
<SfxItemPool
> ChartItemPool::Clone() const
216 return new ChartItemPool(*this);
219 MapUnit
ChartItemPool::GetMetric(sal_uInt16
/* nWhich */) const
221 return MapUnit::Map100thMM
;
224 rtl::Reference
<SfxItemPool
> ChartItemPool::CreateChartItemPool()
226 // There are various default values which want to call
227 // OutputDevice::GetDefaultFont. Unfortunately, when processing
228 // UNO methods which may get called from out of process, this
229 // happens on a thread that does not take the SolarMutex, which
230 // causes trouble in ImplFontCache.
231 // Trying to take the SolarMutex when initialising these default
232 // leads to ABBA deadlocks.
233 // So rather just trigger the initialisation of these things here.
234 StaticDataSeriesDefaults();
235 StaticAxisDefaults();
236 StaticLegendDefaults();
237 StaticFormattedStringDefaults();
239 return new ChartItemPool();
244 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */