1*cdf0e10cSrcweir /*************************************************************************
2*cdf0e10cSrcweir  *
3*cdf0e10cSrcweir  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4*cdf0e10cSrcweir  *
5*cdf0e10cSrcweir  * Copyright 2000, 2010 Oracle and/or its affiliates.
6*cdf0e10cSrcweir  *
7*cdf0e10cSrcweir  * OpenOffice.org - a multi-platform office productivity suite
8*cdf0e10cSrcweir  *
9*cdf0e10cSrcweir  * This file is part of OpenOffice.org.
10*cdf0e10cSrcweir  *
11*cdf0e10cSrcweir  * OpenOffice.org is free software: you can redistribute it and/or modify
12*cdf0e10cSrcweir  * it under the terms of the GNU Lesser General Public License version 3
13*cdf0e10cSrcweir  * only, as published by the Free Software Foundation.
14*cdf0e10cSrcweir  *
15*cdf0e10cSrcweir  * OpenOffice.org is distributed in the hope that it will be useful,
16*cdf0e10cSrcweir  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17*cdf0e10cSrcweir  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18*cdf0e10cSrcweir  * GNU Lesser General Public License version 3 for more details
19*cdf0e10cSrcweir  * (a copy is included in the LICENSE file that accompanied this code).
20*cdf0e10cSrcweir  *
21*cdf0e10cSrcweir  * You should have received a copy of the GNU Lesser General Public License
22*cdf0e10cSrcweir  * version 3 along with OpenOffice.org.  If not, see
23*cdf0e10cSrcweir  * <http://www.openoffice.org/license.html>
24*cdf0e10cSrcweir  * for a copy of the LGPLv3 License.
25*cdf0e10cSrcweir  *
26*cdf0e10cSrcweir  ************************************************************************/
27*cdf0e10cSrcweir 
28*cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove
29*cdf0e10cSrcweir #include "precompiled_chart2.hxx"
30*cdf0e10cSrcweir #include "AxisWrapper.hxx"
31*cdf0e10cSrcweir #include "AxisHelper.hxx"
32*cdf0e10cSrcweir #include "TitleHelper.hxx"
33*cdf0e10cSrcweir #include "Chart2ModelContact.hxx"
34*cdf0e10cSrcweir #include "ContainerHelper.hxx"
35*cdf0e10cSrcweir #include "macros.hxx"
36*cdf0e10cSrcweir #include "WrappedDirectStateProperty.hxx"
37*cdf0e10cSrcweir #include "GridWrapper.hxx"
38*cdf0e10cSrcweir #include "TitleWrapper.hxx"
39*cdf0e10cSrcweir #include "DisposeHelper.hxx"
40*cdf0e10cSrcweir 
41*cdf0e10cSrcweir #include <comphelper/InlineContainer.hxx>
42*cdf0e10cSrcweir #include <com/sun/star/beans/PropertyAttribute.hpp>
43*cdf0e10cSrcweir #include <com/sun/star/chart/ChartAxisArrangeOrderType.hpp>
44*cdf0e10cSrcweir #include <com/sun/star/chart/ChartAxisPosition.hpp>
45*cdf0e10cSrcweir #include <com/sun/star/chart/ChartAxisLabelPosition.hpp>
46*cdf0e10cSrcweir #include <com/sun/star/chart/ChartAxisMarkPosition.hpp>
47*cdf0e10cSrcweir 
48*cdf0e10cSrcweir #include "CharacterProperties.hxx"
49*cdf0e10cSrcweir #include "LineProperties.hxx"
50*cdf0e10cSrcweir #include "UserDefinedProperties.hxx"
51*cdf0e10cSrcweir #include "WrappedCharacterHeightProperty.hxx"
52*cdf0e10cSrcweir #include "WrappedTextRotationProperty.hxx"
53*cdf0e10cSrcweir #include "WrappedGapwidthProperty.hxx"
54*cdf0e10cSrcweir #include "WrappedScaleProperty.hxx"
55*cdf0e10cSrcweir #include "WrappedDefaultProperty.hxx"
56*cdf0e10cSrcweir #include "WrappedNumberFormatProperty.hxx"
57*cdf0e10cSrcweir #include "WrappedScaleTextProperties.hxx"
58*cdf0e10cSrcweir 
59*cdf0e10cSrcweir #include <algorithm>
60*cdf0e10cSrcweir #include <rtl/ustrbuf.hxx>
61*cdf0e10cSrcweir #include <rtl/math.hxx>
62*cdf0e10cSrcweir 
63*cdf0e10cSrcweir using namespace ::com::sun::star;
64*cdf0e10cSrcweir using namespace ::com::sun::star::chart2;
65*cdf0e10cSrcweir using namespace ::chart::ContainerHelper;
66*cdf0e10cSrcweir 
67*cdf0e10cSrcweir using ::com::sun::star::beans::Property;
68*cdf0e10cSrcweir using ::osl::MutexGuard;
69*cdf0e10cSrcweir using ::com::sun::star::uno::Reference;
70*cdf0e10cSrcweir using ::com::sun::star::uno::Sequence;
71*cdf0e10cSrcweir using ::com::sun::star::uno::Any;
72*cdf0e10cSrcweir using ::rtl::OUString;
73*cdf0e10cSrcweir 
74*cdf0e10cSrcweir namespace
75*cdf0e10cSrcweir {
76*cdf0e10cSrcweir static const OUString lcl_aServiceName(
77*cdf0e10cSrcweir     RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.chart.Axis" ));
78*cdf0e10cSrcweir 
79*cdf0e10cSrcweir enum
80*cdf0e10cSrcweir {
81*cdf0e10cSrcweir     PROP_AXIS_MAX,
82*cdf0e10cSrcweir     PROP_AXIS_MIN,
83*cdf0e10cSrcweir     PROP_AXIS_STEPMAIN,
84*cdf0e10cSrcweir     PROP_AXIS_STEPHELP, //deprecated property use 'StepHelpCount' instead
85*cdf0e10cSrcweir     PROP_AXIS_STEPHELP_COUNT,
86*cdf0e10cSrcweir     PROP_AXIS_AUTO_MAX,
87*cdf0e10cSrcweir     PROP_AXIS_AUTO_MIN,
88*cdf0e10cSrcweir     PROP_AXIS_AUTO_STEPMAIN,
89*cdf0e10cSrcweir     PROP_AXIS_AUTO_STEPHELP,
90*cdf0e10cSrcweir     PROP_AXIS_TYPE,
91*cdf0e10cSrcweir     PROP_AXIS_TIME_INCREMENT,
92*cdf0e10cSrcweir     PROP_AXIS_EXPLICIT_TIME_INCREMENT,
93*cdf0e10cSrcweir     PROP_AXIS_LOGARITHMIC,
94*cdf0e10cSrcweir     PROP_AXIS_REVERSEDIRECTION,
95*cdf0e10cSrcweir     PROP_AXIS_VISIBLE,
96*cdf0e10cSrcweir     PROP_AXIS_CROSSOVER_POSITION,
97*cdf0e10cSrcweir     PROP_AXIS_CROSSOVER_VALUE,
98*cdf0e10cSrcweir     PROP_AXIS_ORIGIN,
99*cdf0e10cSrcweir     PROP_AXIS_AUTO_ORIGIN,
100*cdf0e10cSrcweir     PROP_AXIS_MARKS,
101*cdf0e10cSrcweir     PROP_AXIS_HELPMARKS,
102*cdf0e10cSrcweir     PROP_AXIS_MARK_POSITION,
103*cdf0e10cSrcweir     PROP_AXIS_DISPLAY_LABELS,
104*cdf0e10cSrcweir     PROP_AXIS_NUMBERFORMAT,
105*cdf0e10cSrcweir     PROP_AXIS_LINK_NUMBERFORMAT_TO_SOURCE,
106*cdf0e10cSrcweir     PROP_AXIS_LABEL_POSITION,
107*cdf0e10cSrcweir     PROP_AXIS_TEXT_ROTATION,
108*cdf0e10cSrcweir     PROP_AXIS_ARRANGE_ORDER,
109*cdf0e10cSrcweir     PROP_AXIS_TEXTBREAK,
110*cdf0e10cSrcweir     PROP_AXIS_CAN_OVERLAP,
111*cdf0e10cSrcweir     PROP_AXIS_STACKEDTEXT,
112*cdf0e10cSrcweir     PROP_AXIS_OVERLAP,
113*cdf0e10cSrcweir     PROP_AXIS_GAP_WIDTH
114*cdf0e10cSrcweir };
115*cdf0e10cSrcweir 
116*cdf0e10cSrcweir void lcl_AddPropertiesToVector(
117*cdf0e10cSrcweir     ::std::vector< Property > & rOutProperties )
118*cdf0e10cSrcweir {
119*cdf0e10cSrcweir     //Properties for scaling:
120*cdf0e10cSrcweir     rOutProperties.push_back(
121*cdf0e10cSrcweir         Property( C2U( "Max" ),
122*cdf0e10cSrcweir                   PROP_AXIS_MAX,
123*cdf0e10cSrcweir                   ::getCppuType( reinterpret_cast< const double * >(0)),
124*cdf0e10cSrcweir                   beans::PropertyAttribute::BOUND
125*cdf0e10cSrcweir                   | beans::PropertyAttribute::MAYBEVOID ));
126*cdf0e10cSrcweir 
127*cdf0e10cSrcweir     rOutProperties.push_back(
128*cdf0e10cSrcweir         Property( C2U( "Min" ),
129*cdf0e10cSrcweir                   PROP_AXIS_MIN,
130*cdf0e10cSrcweir                   ::getCppuType( reinterpret_cast< const double * >(0)),
131*cdf0e10cSrcweir                   beans::PropertyAttribute::BOUND
132*cdf0e10cSrcweir                   | beans::PropertyAttribute::MAYBEVOID ));
133*cdf0e10cSrcweir 
134*cdf0e10cSrcweir     rOutProperties.push_back(
135*cdf0e10cSrcweir         Property( C2U( "StepMain" ),
136*cdf0e10cSrcweir                   PROP_AXIS_STEPMAIN,
137*cdf0e10cSrcweir                   ::getCppuType( reinterpret_cast< const double * >(0)),
138*cdf0e10cSrcweir                   beans::PropertyAttribute::BOUND
139*cdf0e10cSrcweir                   | beans::PropertyAttribute::MAYBEVOID ));
140*cdf0e10cSrcweir 
141*cdf0e10cSrcweir     rOutProperties.push_back(
142*cdf0e10cSrcweir         Property( C2U( "StepHelpCount" ),
143*cdf0e10cSrcweir                   PROP_AXIS_STEPHELP_COUNT,
144*cdf0e10cSrcweir                   ::getCppuType( reinterpret_cast< const sal_Int32 * >(0)),
145*cdf0e10cSrcweir                   beans::PropertyAttribute::BOUND
146*cdf0e10cSrcweir                   | beans::PropertyAttribute::MAYBEVOID ));
147*cdf0e10cSrcweir 
148*cdf0e10cSrcweir     //deprecated property use 'StepHelpCount' instead
149*cdf0e10cSrcweir     rOutProperties.push_back(
150*cdf0e10cSrcweir         Property( C2U( "StepHelp" ),
151*cdf0e10cSrcweir                   PROP_AXIS_STEPHELP,
152*cdf0e10cSrcweir                   ::getCppuType( reinterpret_cast< const double * >(0)),
153*cdf0e10cSrcweir                   beans::PropertyAttribute::BOUND
154*cdf0e10cSrcweir                   | beans::PropertyAttribute::MAYBEVOID ));
155*cdf0e10cSrcweir 
156*cdf0e10cSrcweir     rOutProperties.push_back(
157*cdf0e10cSrcweir         Property( C2U( "AutoMax" ),
158*cdf0e10cSrcweir                   PROP_AXIS_AUTO_MAX,
159*cdf0e10cSrcweir                   ::getBooleanCppuType(),
160*cdf0e10cSrcweir                   //#i111967# no PropertyChangeEvent is fired on change so far
161*cdf0e10cSrcweir                   beans::PropertyAttribute::MAYBEDEFAULT ));
162*cdf0e10cSrcweir 
163*cdf0e10cSrcweir     rOutProperties.push_back(
164*cdf0e10cSrcweir         Property( C2U( "AutoMin" ),
165*cdf0e10cSrcweir                   PROP_AXIS_AUTO_MIN,
166*cdf0e10cSrcweir                   ::getBooleanCppuType(),
167*cdf0e10cSrcweir                   //#i111967# no PropertyChangeEvent is fired on change so far
168*cdf0e10cSrcweir                   beans::PropertyAttribute::MAYBEDEFAULT ));
169*cdf0e10cSrcweir 
170*cdf0e10cSrcweir     rOutProperties.push_back(
171*cdf0e10cSrcweir         Property( C2U( "AutoStepMain" ),
172*cdf0e10cSrcweir                   PROP_AXIS_AUTO_STEPMAIN,
173*cdf0e10cSrcweir                   ::getBooleanCppuType(),
174*cdf0e10cSrcweir                   //#i111967# no PropertyChangeEvent is fired on change so far
175*cdf0e10cSrcweir                   beans::PropertyAttribute::MAYBEDEFAULT ));
176*cdf0e10cSrcweir 
177*cdf0e10cSrcweir     rOutProperties.push_back(
178*cdf0e10cSrcweir         Property( C2U( "AutoStepHelp" ),
179*cdf0e10cSrcweir                   PROP_AXIS_AUTO_STEPHELP,
180*cdf0e10cSrcweir                   ::getBooleanCppuType(),
181*cdf0e10cSrcweir                   //#i111967# no PropertyChangeEvent is fired on change so far
182*cdf0e10cSrcweir                   beans::PropertyAttribute::MAYBEDEFAULT ));
183*cdf0e10cSrcweir 
184*cdf0e10cSrcweir     rOutProperties.push_back(
185*cdf0e10cSrcweir         Property( C2U( "AxisType" ),
186*cdf0e10cSrcweir                   PROP_AXIS_TYPE,
187*cdf0e10cSrcweir                   ::getCppuType( reinterpret_cast< const sal_Int32 * >(0)), //type com::sun::star::chart::ChartAxisType
188*cdf0e10cSrcweir                   //#i111967# no PropertyChangeEvent is fired on change so far
189*cdf0e10cSrcweir                   beans::PropertyAttribute::MAYBEDEFAULT ));
190*cdf0e10cSrcweir 
191*cdf0e10cSrcweir     rOutProperties.push_back(
192*cdf0e10cSrcweir         Property( C2U( "TimeIncrement" ),
193*cdf0e10cSrcweir                   PROP_AXIS_TIME_INCREMENT,
194*cdf0e10cSrcweir                   ::getCppuType( reinterpret_cast< const ::com::sun::star::chart::TimeIncrement * >(0)),
195*cdf0e10cSrcweir                   //#i111967# no PropertyChangeEvent is fired on change so far
196*cdf0e10cSrcweir                   beans::PropertyAttribute::MAYBEVOID ));
197*cdf0e10cSrcweir 
198*cdf0e10cSrcweir     rOutProperties.push_back(
199*cdf0e10cSrcweir         Property( C2U( "ExplicitTimeIncrement" ),
200*cdf0e10cSrcweir                   PROP_AXIS_EXPLICIT_TIME_INCREMENT,
201*cdf0e10cSrcweir                   ::getCppuType( reinterpret_cast< const ::com::sun::star::chart::TimeIncrement * >(0)),
202*cdf0e10cSrcweir                   beans::PropertyAttribute::READONLY |
203*cdf0e10cSrcweir                   beans::PropertyAttribute::MAYBEVOID ));
204*cdf0e10cSrcweir 
205*cdf0e10cSrcweir     rOutProperties.push_back(
206*cdf0e10cSrcweir         Property( C2U( "Logarithmic" ),
207*cdf0e10cSrcweir                   PROP_AXIS_LOGARITHMIC,
208*cdf0e10cSrcweir                   ::getBooleanCppuType(),
209*cdf0e10cSrcweir                   //#i111967# no PropertyChangeEvent is fired on change so far
210*cdf0e10cSrcweir                   beans::PropertyAttribute::MAYBEDEFAULT ));
211*cdf0e10cSrcweir 
212*cdf0e10cSrcweir     rOutProperties.push_back(
213*cdf0e10cSrcweir         Property( C2U( "ReverseDirection" ),
214*cdf0e10cSrcweir                   PROP_AXIS_REVERSEDIRECTION,
215*cdf0e10cSrcweir                   ::getBooleanCppuType(),
216*cdf0e10cSrcweir                   //#i111967# no PropertyChangeEvent is fired on change so far
217*cdf0e10cSrcweir                   beans::PropertyAttribute::MAYBEDEFAULT ));
218*cdf0e10cSrcweir 
219*cdf0e10cSrcweir     //todo: this property is missing in the API
220*cdf0e10cSrcweir     rOutProperties.push_back(
221*cdf0e10cSrcweir         Property( C2U( "Visible" ),
222*cdf0e10cSrcweir                   PROP_AXIS_VISIBLE,
223*cdf0e10cSrcweir                   ::getBooleanCppuType(),
224*cdf0e10cSrcweir                   beans::PropertyAttribute::BOUND
225*cdf0e10cSrcweir                   | beans::PropertyAttribute::MAYBEDEFAULT ));
226*cdf0e10cSrcweir 
227*cdf0e10cSrcweir     rOutProperties.push_back(
228*cdf0e10cSrcweir         Property( C2U( "CrossoverPosition" ),
229*cdf0e10cSrcweir                   PROP_AXIS_CROSSOVER_POSITION,
230*cdf0e10cSrcweir                   ::getCppuType( reinterpret_cast< const ::com::sun::star::chart::ChartAxisPosition * >(0)),
231*cdf0e10cSrcweir                   beans::PropertyAttribute::MAYBEDEFAULT ));
232*cdf0e10cSrcweir 
233*cdf0e10cSrcweir     rOutProperties.push_back(
234*cdf0e10cSrcweir         Property( C2U( "CrossoverValue" ),
235*cdf0e10cSrcweir                   PROP_AXIS_CROSSOVER_VALUE,
236*cdf0e10cSrcweir                   ::getCppuType( reinterpret_cast< const double * >(0)),
237*cdf0e10cSrcweir                   beans::PropertyAttribute::MAYBEVOID ));
238*cdf0e10cSrcweir 
239*cdf0e10cSrcweir 
240*cdf0e10cSrcweir     rOutProperties.push_back(
241*cdf0e10cSrcweir         Property( C2U( "Origin" ),
242*cdf0e10cSrcweir                   PROP_AXIS_ORIGIN,
243*cdf0e10cSrcweir                   ::getCppuType( reinterpret_cast< const double * >(0)),
244*cdf0e10cSrcweir                   beans::PropertyAttribute::BOUND
245*cdf0e10cSrcweir                   | beans::PropertyAttribute::MAYBEVOID ));
246*cdf0e10cSrcweir 
247*cdf0e10cSrcweir     rOutProperties.push_back(
248*cdf0e10cSrcweir         Property( C2U( "AutoOrigin" ),
249*cdf0e10cSrcweir                   PROP_AXIS_AUTO_ORIGIN,
250*cdf0e10cSrcweir                   ::getBooleanCppuType(),
251*cdf0e10cSrcweir                   //#i111967# no PropertyChangeEvent is fired on change so far
252*cdf0e10cSrcweir                   beans::PropertyAttribute::MAYBEDEFAULT ));
253*cdf0e10cSrcweir 
254*cdf0e10cSrcweir     //Properties for interval marks:
255*cdf0e10cSrcweir     rOutProperties.push_back(
256*cdf0e10cSrcweir         Property( C2U( "Marks" ),
257*cdf0e10cSrcweir                   PROP_AXIS_MARKS,
258*cdf0e10cSrcweir                   ::getCppuType( reinterpret_cast< const sal_Int32 * >(0)),
259*cdf0e10cSrcweir                   beans::PropertyAttribute::BOUND
260*cdf0e10cSrcweir                   | beans::PropertyAttribute::MAYBEDEFAULT ));
261*cdf0e10cSrcweir 
262*cdf0e10cSrcweir     rOutProperties.push_back(
263*cdf0e10cSrcweir         Property( C2U( "HelpMarks" ),
264*cdf0e10cSrcweir                   PROP_AXIS_HELPMARKS,
265*cdf0e10cSrcweir                   ::getCppuType( reinterpret_cast< const sal_Int32 * >(0)),
266*cdf0e10cSrcweir                   beans::PropertyAttribute::BOUND
267*cdf0e10cSrcweir                   | beans::PropertyAttribute::MAYBEDEFAULT ));
268*cdf0e10cSrcweir 
269*cdf0e10cSrcweir     rOutProperties.push_back(
270*cdf0e10cSrcweir         Property( C2U( "MarkPosition" ),
271*cdf0e10cSrcweir                   PROP_AXIS_MARK_POSITION,
272*cdf0e10cSrcweir                   ::getCppuType( reinterpret_cast< const ::com::sun::star::chart::ChartAxisMarkPosition * >(0)),
273*cdf0e10cSrcweir                   beans::PropertyAttribute::MAYBEDEFAULT ));
274*cdf0e10cSrcweir 
275*cdf0e10cSrcweir 
276*cdf0e10cSrcweir     //Properties for labels:
277*cdf0e10cSrcweir     rOutProperties.push_back(
278*cdf0e10cSrcweir         Property( C2U( "DisplayLabels" ),
279*cdf0e10cSrcweir                   PROP_AXIS_DISPLAY_LABELS,
280*cdf0e10cSrcweir                   ::getBooleanCppuType(),
281*cdf0e10cSrcweir                   beans::PropertyAttribute::BOUND
282*cdf0e10cSrcweir                   | beans::PropertyAttribute::MAYBEDEFAULT ));
283*cdf0e10cSrcweir 
284*cdf0e10cSrcweir     rOutProperties.push_back(
285*cdf0e10cSrcweir         Property( C2U( "NumberFormat" ),
286*cdf0e10cSrcweir                   PROP_AXIS_NUMBERFORMAT,
287*cdf0e10cSrcweir                   ::getCppuType( reinterpret_cast< const sal_Int32 * >(0)),
288*cdf0e10cSrcweir                   beans::PropertyAttribute::BOUND
289*cdf0e10cSrcweir                   | beans::PropertyAttribute::MAYBEDEFAULT ));
290*cdf0e10cSrcweir 
291*cdf0e10cSrcweir     rOutProperties.push_back(
292*cdf0e10cSrcweir         Property( C2U( "LinkNumberFormatToSource" ),
293*cdf0e10cSrcweir                   PROP_AXIS_LINK_NUMBERFORMAT_TO_SOURCE,
294*cdf0e10cSrcweir                   ::getBooleanCppuType(),
295*cdf0e10cSrcweir                   beans::PropertyAttribute::BOUND
296*cdf0e10cSrcweir                   | beans::PropertyAttribute::MAYBEDEFAULT ));
297*cdf0e10cSrcweir 
298*cdf0e10cSrcweir     rOutProperties.push_back(
299*cdf0e10cSrcweir         Property( C2U( "LabelPosition" ),
300*cdf0e10cSrcweir                   PROP_AXIS_LABEL_POSITION,
301*cdf0e10cSrcweir                   ::getCppuType( reinterpret_cast< const ::com::sun::star::chart::ChartAxisLabelPosition * >(0)),
302*cdf0e10cSrcweir                   beans::PropertyAttribute::MAYBEDEFAULT ));
303*cdf0e10cSrcweir 
304*cdf0e10cSrcweir     rOutProperties.push_back(
305*cdf0e10cSrcweir         Property( C2U( "TextRotation" ),
306*cdf0e10cSrcweir                   PROP_AXIS_TEXT_ROTATION,
307*cdf0e10cSrcweir                   ::getCppuType( reinterpret_cast< const sal_Int32 * >(0)),
308*cdf0e10cSrcweir                   beans::PropertyAttribute::BOUND
309*cdf0e10cSrcweir                   | beans::PropertyAttribute::MAYBEDEFAULT ));
310*cdf0e10cSrcweir 
311*cdf0e10cSrcweir     rOutProperties.push_back(
312*cdf0e10cSrcweir         Property( C2U( "ArrangeOrder" ),
313*cdf0e10cSrcweir                   PROP_AXIS_ARRANGE_ORDER,
314*cdf0e10cSrcweir                   ::getCppuType( reinterpret_cast< const ::com::sun::star::chart::ChartAxisArrangeOrderType * >(0)),
315*cdf0e10cSrcweir                   beans::PropertyAttribute::BOUND
316*cdf0e10cSrcweir                   | beans::PropertyAttribute::MAYBEDEFAULT ));
317*cdf0e10cSrcweir 
318*cdf0e10cSrcweir     rOutProperties.push_back(
319*cdf0e10cSrcweir         Property( C2U( "TextBreak" ),
320*cdf0e10cSrcweir                   PROP_AXIS_TEXTBREAK,
321*cdf0e10cSrcweir                   ::getBooleanCppuType(),
322*cdf0e10cSrcweir                   beans::PropertyAttribute::BOUND
323*cdf0e10cSrcweir                   | beans::PropertyAttribute::MAYBEDEFAULT ));
324*cdf0e10cSrcweir 
325*cdf0e10cSrcweir     rOutProperties.push_back(
326*cdf0e10cSrcweir         Property( C2U( "TextCanOverlap" ),
327*cdf0e10cSrcweir                   PROP_AXIS_CAN_OVERLAP,
328*cdf0e10cSrcweir                   ::getBooleanCppuType(),
329*cdf0e10cSrcweir                   beans::PropertyAttribute::BOUND
330*cdf0e10cSrcweir                   | beans::PropertyAttribute::MAYBEDEFAULT ));
331*cdf0e10cSrcweir 
332*cdf0e10cSrcweir     rOutProperties.push_back(
333*cdf0e10cSrcweir         Property( C2U( "StackedText" ),
334*cdf0e10cSrcweir                   PROP_AXIS_STACKEDTEXT,
335*cdf0e10cSrcweir                   ::getBooleanCppuType(),
336*cdf0e10cSrcweir                   beans::PropertyAttribute::BOUND
337*cdf0e10cSrcweir                   | beans::PropertyAttribute::MAYBEDEFAULT ));
338*cdf0e10cSrcweir 
339*cdf0e10cSrcweir     // Properties related to bar charts:
340*cdf0e10cSrcweir     rOutProperties.push_back(
341*cdf0e10cSrcweir         Property( C2U( "Overlap" ),
342*cdf0e10cSrcweir                   PROP_AXIS_OVERLAP,
343*cdf0e10cSrcweir                   ::getCppuType( reinterpret_cast< const sal_Int32 * >(0)),
344*cdf0e10cSrcweir                   //#i111967# no PropertyChangeEvent is fired on change so far
345*cdf0e10cSrcweir                   beans::PropertyAttribute::MAYBEDEFAULT ));
346*cdf0e10cSrcweir 
347*cdf0e10cSrcweir     rOutProperties.push_back(
348*cdf0e10cSrcweir         Property( C2U( "GapWidth" ),
349*cdf0e10cSrcweir                   PROP_AXIS_GAP_WIDTH,
350*cdf0e10cSrcweir                   ::getCppuType( reinterpret_cast< const sal_Int32 * >(0)),
351*cdf0e10cSrcweir                   //#i111967# no PropertyChangeEvent is fired on change so far
352*cdf0e10cSrcweir                   beans::PropertyAttribute::MAYBEDEFAULT ));
353*cdf0e10cSrcweir }
354*cdf0e10cSrcweir 
355*cdf0e10cSrcweir struct StaticAxisWrapperPropertyArray_Initializer
356*cdf0e10cSrcweir {
357*cdf0e10cSrcweir     Sequence< Property >* operator()()
358*cdf0e10cSrcweir     {
359*cdf0e10cSrcweir         static Sequence< Property > aPropSeq( lcl_GetPropertySequence() );
360*cdf0e10cSrcweir         return &aPropSeq;
361*cdf0e10cSrcweir     }
362*cdf0e10cSrcweir 
363*cdf0e10cSrcweir private:
364*cdf0e10cSrcweir     Sequence< Property > lcl_GetPropertySequence()
365*cdf0e10cSrcweir     {
366*cdf0e10cSrcweir         ::std::vector< ::com::sun::star::beans::Property > aProperties;
367*cdf0e10cSrcweir         lcl_AddPropertiesToVector( aProperties );
368*cdf0e10cSrcweir         ::chart::CharacterProperties::AddPropertiesToVector( aProperties );
369*cdf0e10cSrcweir         ::chart::LineProperties::AddPropertiesToVector( aProperties );
370*cdf0e10cSrcweir         //::chart::NamedLineProperties::AddPropertiesToVector( aProperties );
371*cdf0e10cSrcweir         ::chart::UserDefinedProperties::AddPropertiesToVector( aProperties );
372*cdf0e10cSrcweir         ::chart::wrapper::WrappedScaleTextProperties::addProperties( aProperties );
373*cdf0e10cSrcweir 
374*cdf0e10cSrcweir         ::std::sort( aProperties.begin(), aProperties.end(),
375*cdf0e10cSrcweir                      ::chart::PropertyNameLess() );
376*cdf0e10cSrcweir 
377*cdf0e10cSrcweir         return ::chart::ContainerHelper::ContainerToSequence( aProperties );
378*cdf0e10cSrcweir     }
379*cdf0e10cSrcweir };
380*cdf0e10cSrcweir 
381*cdf0e10cSrcweir struct StaticAxisWrapperPropertyArray : public rtl::StaticAggregate< Sequence< Property >, StaticAxisWrapperPropertyArray_Initializer >
382*cdf0e10cSrcweir {
383*cdf0e10cSrcweir };
384*cdf0e10cSrcweir 
385*cdf0e10cSrcweir } // anonymous namespace
386*cdf0e10cSrcweir 
387*cdf0e10cSrcweir // --------------------------------------------------------------------------------
388*cdf0e10cSrcweir 
389*cdf0e10cSrcweir namespace chart
390*cdf0e10cSrcweir {
391*cdf0e10cSrcweir namespace wrapper
392*cdf0e10cSrcweir {
393*cdf0e10cSrcweir 
394*cdf0e10cSrcweir AxisWrapper::AxisWrapper(
395*cdf0e10cSrcweir     tAxisType eType, ::boost::shared_ptr< Chart2ModelContact > spChart2ModelContact ) :
396*cdf0e10cSrcweir         m_spChart2ModelContact( spChart2ModelContact ),
397*cdf0e10cSrcweir         m_aEventListenerContainer( m_aMutex ),
398*cdf0e10cSrcweir         m_eType( eType )
399*cdf0e10cSrcweir {
400*cdf0e10cSrcweir }
401*cdf0e10cSrcweir 
402*cdf0e10cSrcweir AxisWrapper::~AxisWrapper()
403*cdf0e10cSrcweir {
404*cdf0e10cSrcweir }
405*cdf0e10cSrcweir 
406*cdf0e10cSrcweir // ____ chart::XAxis ____
407*cdf0e10cSrcweir Reference< beans::XPropertySet > SAL_CALL AxisWrapper::getAxisTitle() throw (uno::RuntimeException)
408*cdf0e10cSrcweir {
409*cdf0e10cSrcweir     if( !m_xAxisTitle.is() )
410*cdf0e10cSrcweir     {
411*cdf0e10cSrcweir         TitleHelper::eTitleType eTitleType( TitleHelper::X_AXIS_TITLE    );
412*cdf0e10cSrcweir         switch( m_eType )
413*cdf0e10cSrcweir         {
414*cdf0e10cSrcweir             case X_AXIS:
415*cdf0e10cSrcweir                 eTitleType = TitleHelper::X_AXIS_TITLE;
416*cdf0e10cSrcweir                 break;
417*cdf0e10cSrcweir             case Y_AXIS:
418*cdf0e10cSrcweir                 eTitleType = TitleHelper::Y_AXIS_TITLE;
419*cdf0e10cSrcweir                 break;
420*cdf0e10cSrcweir             case Z_AXIS:
421*cdf0e10cSrcweir                 eTitleType = TitleHelper::Z_AXIS_TITLE;
422*cdf0e10cSrcweir                 break;
423*cdf0e10cSrcweir             case SECOND_X_AXIS:
424*cdf0e10cSrcweir                 eTitleType = TitleHelper::SECONDARY_X_AXIS_TITLE;
425*cdf0e10cSrcweir                 break;
426*cdf0e10cSrcweir             case SECOND_Y_AXIS:
427*cdf0e10cSrcweir                 eTitleType = TitleHelper::SECONDARY_Y_AXIS_TITLE;
428*cdf0e10cSrcweir                 break;
429*cdf0e10cSrcweir             default:
430*cdf0e10cSrcweir                 return 0;
431*cdf0e10cSrcweir         }
432*cdf0e10cSrcweir         m_xAxisTitle = new TitleWrapper( eTitleType, m_spChart2ModelContact );
433*cdf0e10cSrcweir     }
434*cdf0e10cSrcweir     return m_xAxisTitle;
435*cdf0e10cSrcweir }
436*cdf0e10cSrcweir Reference< beans::XPropertySet > SAL_CALL AxisWrapper::getMajorGrid() throw (uno::RuntimeException)
437*cdf0e10cSrcweir {
438*cdf0e10cSrcweir     if( !m_xMajorGrid.is() )
439*cdf0e10cSrcweir     {
440*cdf0e10cSrcweir         GridWrapper::tGridType eGridType( GridWrapper::X_MAJOR_GRID );
441*cdf0e10cSrcweir         switch( m_eType )
442*cdf0e10cSrcweir         {
443*cdf0e10cSrcweir             case X_AXIS:
444*cdf0e10cSrcweir                 eGridType = GridWrapper::X_MAJOR_GRID;
445*cdf0e10cSrcweir                 break;
446*cdf0e10cSrcweir             case Y_AXIS:
447*cdf0e10cSrcweir                 eGridType = GridWrapper::Y_MAJOR_GRID;
448*cdf0e10cSrcweir                 break;
449*cdf0e10cSrcweir             case Z_AXIS:
450*cdf0e10cSrcweir                 eGridType = GridWrapper::Z_MAJOR_GRID;
451*cdf0e10cSrcweir                 break;
452*cdf0e10cSrcweir             default:
453*cdf0e10cSrcweir                 return 0;
454*cdf0e10cSrcweir         }
455*cdf0e10cSrcweir         m_xMajorGrid = new GridWrapper( eGridType, m_spChart2ModelContact );
456*cdf0e10cSrcweir     }
457*cdf0e10cSrcweir     return m_xMajorGrid;
458*cdf0e10cSrcweir }
459*cdf0e10cSrcweir Reference< beans::XPropertySet > SAL_CALL AxisWrapper::getMinorGrid() throw (uno::RuntimeException)
460*cdf0e10cSrcweir {
461*cdf0e10cSrcweir     if( !m_xMinorGrid.is() )
462*cdf0e10cSrcweir     {
463*cdf0e10cSrcweir         GridWrapper::tGridType eGridType( GridWrapper::X_MAJOR_GRID );
464*cdf0e10cSrcweir         switch( m_eType )
465*cdf0e10cSrcweir         {
466*cdf0e10cSrcweir             case X_AXIS:
467*cdf0e10cSrcweir                 eGridType = GridWrapper::X_MINOR_GRID;
468*cdf0e10cSrcweir                 break;
469*cdf0e10cSrcweir             case Y_AXIS:
470*cdf0e10cSrcweir                 eGridType = GridWrapper::Y_MINOR_GRID;
471*cdf0e10cSrcweir                 break;
472*cdf0e10cSrcweir             case Z_AXIS:
473*cdf0e10cSrcweir                 eGridType = GridWrapper::Z_MINOR_GRID;
474*cdf0e10cSrcweir                 break;
475*cdf0e10cSrcweir             default:
476*cdf0e10cSrcweir                 return 0;
477*cdf0e10cSrcweir         }
478*cdf0e10cSrcweir         m_xMinorGrid = new GridWrapper( eGridType, m_spChart2ModelContact );
479*cdf0e10cSrcweir     }
480*cdf0e10cSrcweir     return m_xMinorGrid;
481*cdf0e10cSrcweir }
482*cdf0e10cSrcweir 
483*cdf0e10cSrcweir // ____ XShape ____
484*cdf0e10cSrcweir awt::Point SAL_CALL AxisWrapper::getPosition()
485*cdf0e10cSrcweir     throw (uno::RuntimeException)
486*cdf0e10cSrcweir {
487*cdf0e10cSrcweir     awt::Point aResult( m_spChart2ModelContact->GetAxisPosition( this->getAxis() ) );
488*cdf0e10cSrcweir     return aResult;
489*cdf0e10cSrcweir }
490*cdf0e10cSrcweir 
491*cdf0e10cSrcweir void SAL_CALL AxisWrapper::setPosition( const awt::Point& /*aPosition*/ )
492*cdf0e10cSrcweir     throw (uno::RuntimeException)
493*cdf0e10cSrcweir {
494*cdf0e10cSrcweir     OSL_ENSURE( false, "trying to set position of Axis" );
495*cdf0e10cSrcweir }
496*cdf0e10cSrcweir 
497*cdf0e10cSrcweir awt::Size SAL_CALL AxisWrapper::getSize()
498*cdf0e10cSrcweir     throw (uno::RuntimeException)
499*cdf0e10cSrcweir {
500*cdf0e10cSrcweir     awt::Size aSize( m_spChart2ModelContact->GetAxisSize( this->getAxis() ) );
501*cdf0e10cSrcweir     return aSize;
502*cdf0e10cSrcweir }
503*cdf0e10cSrcweir 
504*cdf0e10cSrcweir void SAL_CALL AxisWrapper::setSize( const awt::Size& /*aSize*/ )
505*cdf0e10cSrcweir     throw (beans::PropertyVetoException,
506*cdf0e10cSrcweir            uno::RuntimeException)
507*cdf0e10cSrcweir {
508*cdf0e10cSrcweir     OSL_ENSURE( false, "trying to set size of Axis" );
509*cdf0e10cSrcweir }
510*cdf0e10cSrcweir 
511*cdf0e10cSrcweir // ____ XShapeDescriptor (base of XShape) ____
512*cdf0e10cSrcweir OUString SAL_CALL AxisWrapper::getShapeType()
513*cdf0e10cSrcweir     throw (uno::RuntimeException)
514*cdf0e10cSrcweir {
515*cdf0e10cSrcweir     return C2U( "com.sun.star.chart.ChartAxis" );
516*cdf0e10cSrcweir }
517*cdf0e10cSrcweir 
518*cdf0e10cSrcweir // ____ XNumberFormatsSupplier ____
519*cdf0e10cSrcweir uno::Reference< beans::XPropertySet > SAL_CALL AxisWrapper::getNumberFormatSettings()
520*cdf0e10cSrcweir     throw (uno::RuntimeException)
521*cdf0e10cSrcweir {
522*cdf0e10cSrcweir     Reference< util::XNumberFormatsSupplier > xNumSuppl( m_spChart2ModelContact->getChartModel(), uno::UNO_QUERY );
523*cdf0e10cSrcweir     if( xNumSuppl.is() )
524*cdf0e10cSrcweir         return xNumSuppl->getNumberFormatSettings();
525*cdf0e10cSrcweir 
526*cdf0e10cSrcweir     return uno::Reference< beans::XPropertySet >();
527*cdf0e10cSrcweir }
528*cdf0e10cSrcweir 
529*cdf0e10cSrcweir uno::Reference< util::XNumberFormats > SAL_CALL AxisWrapper::getNumberFormats()
530*cdf0e10cSrcweir     throw (uno::RuntimeException)
531*cdf0e10cSrcweir {
532*cdf0e10cSrcweir     Reference< util::XNumberFormatsSupplier > xNumSuppl( m_spChart2ModelContact->getChartModel(), uno::UNO_QUERY );
533*cdf0e10cSrcweir     if( xNumSuppl.is() )
534*cdf0e10cSrcweir         return xNumSuppl->getNumberFormats();
535*cdf0e10cSrcweir 
536*cdf0e10cSrcweir     return uno::Reference< util::XNumberFormats >();
537*cdf0e10cSrcweir }
538*cdf0e10cSrcweir 
539*cdf0e10cSrcweir void AxisWrapper::getDimensionAndMainAxisBool( tAxisType eType, sal_Int32& rnDimensionIndex, sal_Bool& rbMainAxis )
540*cdf0e10cSrcweir {
541*cdf0e10cSrcweir     switch( eType )
542*cdf0e10cSrcweir     {
543*cdf0e10cSrcweir         case X_AXIS:
544*cdf0e10cSrcweir             rnDimensionIndex = 0; rbMainAxis = sal_True; break;
545*cdf0e10cSrcweir         case Y_AXIS:
546*cdf0e10cSrcweir             rnDimensionIndex = 1; rbMainAxis = sal_True; break;
547*cdf0e10cSrcweir         case Z_AXIS:
548*cdf0e10cSrcweir             rnDimensionIndex = 2; rbMainAxis = sal_True; break;
549*cdf0e10cSrcweir         case SECOND_X_AXIS:
550*cdf0e10cSrcweir             rnDimensionIndex = 0; rbMainAxis = sal_False; break;
551*cdf0e10cSrcweir         case SECOND_Y_AXIS:
552*cdf0e10cSrcweir             rnDimensionIndex = 1; rbMainAxis = sal_False; break;
553*cdf0e10cSrcweir     }
554*cdf0e10cSrcweir }
555*cdf0e10cSrcweir 
556*cdf0e10cSrcweir // ____ XComponent ____
557*cdf0e10cSrcweir void SAL_CALL AxisWrapper::dispose()
558*cdf0e10cSrcweir     throw (uno::RuntimeException)
559*cdf0e10cSrcweir {
560*cdf0e10cSrcweir     Reference< uno::XInterface > xSource( static_cast< ::cppu::OWeakObject* >( this ) );
561*cdf0e10cSrcweir     m_aEventListenerContainer.disposeAndClear( lang::EventObject( xSource ) );
562*cdf0e10cSrcweir 
563*cdf0e10cSrcweir     DisposeHelper::DisposeAndClear( m_xAxisTitle );
564*cdf0e10cSrcweir     DisposeHelper::DisposeAndClear( m_xMajorGrid );
565*cdf0e10cSrcweir     DisposeHelper::DisposeAndClear( m_xMinorGrid );
566*cdf0e10cSrcweir 
567*cdf0e10cSrcweir     clearWrappedPropertySet();
568*cdf0e10cSrcweir }
569*cdf0e10cSrcweir 
570*cdf0e10cSrcweir void SAL_CALL AxisWrapper::addEventListener(
571*cdf0e10cSrcweir     const Reference< lang::XEventListener >& xListener )
572*cdf0e10cSrcweir     throw (uno::RuntimeException)
573*cdf0e10cSrcweir {
574*cdf0e10cSrcweir 	m_aEventListenerContainer.addInterface( xListener );
575*cdf0e10cSrcweir }
576*cdf0e10cSrcweir 
577*cdf0e10cSrcweir void SAL_CALL AxisWrapper::removeEventListener(
578*cdf0e10cSrcweir     const Reference< lang::XEventListener >& aListener )
579*cdf0e10cSrcweir     throw (uno::RuntimeException)
580*cdf0e10cSrcweir {
581*cdf0e10cSrcweir 	m_aEventListenerContainer.removeInterface( aListener );
582*cdf0e10cSrcweir }
583*cdf0e10cSrcweir 
584*cdf0e10cSrcweir // ================================================================================
585*cdf0e10cSrcweir 
586*cdf0e10cSrcweir //ReferenceSizePropertyProvider
587*cdf0e10cSrcweir void AxisWrapper::updateReferenceSize()
588*cdf0e10cSrcweir {
589*cdf0e10cSrcweir     Reference< beans::XPropertySet > xProp( this->getAxis(), uno::UNO_QUERY );
590*cdf0e10cSrcweir     if( xProp.is() )
591*cdf0e10cSrcweir     {
592*cdf0e10cSrcweir         if( xProp->getPropertyValue( C2U("ReferencePageSize") ).hasValue() )
593*cdf0e10cSrcweir             xProp->setPropertyValue( C2U("ReferencePageSize"), uno::makeAny(
594*cdf0e10cSrcweir             m_spChart2ModelContact->GetPageSize() ));
595*cdf0e10cSrcweir     }
596*cdf0e10cSrcweir }
597*cdf0e10cSrcweir Any AxisWrapper::getReferenceSize()
598*cdf0e10cSrcweir {
599*cdf0e10cSrcweir     Any aRet;
600*cdf0e10cSrcweir     Reference< beans::XPropertySet > xProp( this->getAxis(), uno::UNO_QUERY );
601*cdf0e10cSrcweir     if( xProp.is() )
602*cdf0e10cSrcweir         aRet = xProp->getPropertyValue( C2U("ReferencePageSize") );
603*cdf0e10cSrcweir     return aRet;
604*cdf0e10cSrcweir }
605*cdf0e10cSrcweir awt::Size AxisWrapper::getCurrentSizeForReference()
606*cdf0e10cSrcweir {
607*cdf0e10cSrcweir     return m_spChart2ModelContact->GetPageSize();
608*cdf0e10cSrcweir }
609*cdf0e10cSrcweir 
610*cdf0e10cSrcweir // ================================================================================
611*cdf0e10cSrcweir 
612*cdf0e10cSrcweir Reference< chart2::XAxis > AxisWrapper::getAxis()
613*cdf0e10cSrcweir {
614*cdf0e10cSrcweir     Reference< chart2::XAxis > xAxis;
615*cdf0e10cSrcweir     try
616*cdf0e10cSrcweir     {
617*cdf0e10cSrcweir         sal_Int32 nDimensionIndex = 0;
618*cdf0e10cSrcweir         sal_Bool  bMainAxis = sal_True;
619*cdf0e10cSrcweir         AxisWrapper::getDimensionAndMainAxisBool( m_eType, nDimensionIndex, bMainAxis );
620*cdf0e10cSrcweir 
621*cdf0e10cSrcweir         Reference< XDiagram > xDiagram( m_spChart2ModelContact->getChart2Diagram() );
622*cdf0e10cSrcweir         xAxis = AxisHelper::getAxis( nDimensionIndex, bMainAxis, xDiagram );
623*cdf0e10cSrcweir         if( !xAxis.is() )
624*cdf0e10cSrcweir         {
625*cdf0e10cSrcweir             xAxis = AxisHelper::createAxis( nDimensionIndex, bMainAxis, xDiagram, m_spChart2ModelContact->m_xContext );
626*cdf0e10cSrcweir             Reference< beans::XPropertySet > xProp( xAxis, uno::UNO_QUERY );
627*cdf0e10cSrcweir             if( xProp.is() )
628*cdf0e10cSrcweir                 xProp->setPropertyValue( C2U( "Show" ), uno::makeAny( sal_False ) );
629*cdf0e10cSrcweir         }
630*cdf0e10cSrcweir     }
631*cdf0e10cSrcweir     catch( uno::Exception & ex )
632*cdf0e10cSrcweir     {
633*cdf0e10cSrcweir         ASSERT_EXCEPTION( ex );
634*cdf0e10cSrcweir     }
635*cdf0e10cSrcweir     return xAxis;
636*cdf0e10cSrcweir }
637*cdf0e10cSrcweir 
638*cdf0e10cSrcweir // WrappedPropertySet
639*cdf0e10cSrcweir Reference< beans::XPropertySet > AxisWrapper::getInnerPropertySet()
640*cdf0e10cSrcweir {
641*cdf0e10cSrcweir     return Reference< beans::XPropertySet >( this->getAxis(), uno::UNO_QUERY );
642*cdf0e10cSrcweir }
643*cdf0e10cSrcweir 
644*cdf0e10cSrcweir const Sequence< beans::Property >& AxisWrapper::getPropertySequence()
645*cdf0e10cSrcweir {
646*cdf0e10cSrcweir     return *StaticAxisWrapperPropertyArray::get();
647*cdf0e10cSrcweir }
648*cdf0e10cSrcweir 
649*cdf0e10cSrcweir const std::vector< WrappedProperty* > AxisWrapper::createWrappedProperties()
650*cdf0e10cSrcweir {
651*cdf0e10cSrcweir     ::std::vector< ::chart::WrappedProperty* > aWrappedProperties;
652*cdf0e10cSrcweir 
653*cdf0e10cSrcweir     aWrappedProperties.push_back( new WrappedTextRotationProperty() );
654*cdf0e10cSrcweir     aWrappedProperties.push_back( new WrappedProperty( C2U( "Marks" ), C2U( "MajorTickmarks" ) ) );
655*cdf0e10cSrcweir     aWrappedProperties.push_back( new WrappedProperty( C2U( "HelpMarks" ), C2U( "MinorTickmarks" ) ) );
656*cdf0e10cSrcweir     aWrappedProperties.push_back( new WrappedProperty( C2U( "TextCanOverlap" ), C2U( "TextOverlap" ) ) );
657*cdf0e10cSrcweir     aWrappedProperties.push_back( new WrappedProperty( C2U( "ArrangeOrder" ), C2U( "ArrangeOrder" ) ) );
658*cdf0e10cSrcweir     aWrappedProperties.push_back( new WrappedProperty( C2U( "Visible" ), C2U( "Show" ) ) );
659*cdf0e10cSrcweir     aWrappedProperties.push_back( new WrappedDirectStateProperty( C2U( "DisplayLabels" ), C2U( "DisplayLabels" ) ) );
660*cdf0e10cSrcweir     aWrappedProperties.push_back( new WrappedDirectStateProperty( C2U( "TextBreak" ), C2U( "TextBreak" ) ) );
661*cdf0e10cSrcweir     WrappedNumberFormatProperty* pWrappedNumberFormatProperty = new WrappedNumberFormatProperty( m_spChart2ModelContact );
662*cdf0e10cSrcweir     aWrappedProperties.push_back( pWrappedNumberFormatProperty );
663*cdf0e10cSrcweir     aWrappedProperties.push_back( new WrappedLinkNumberFormatProperty(pWrappedNumberFormatProperty) );
664*cdf0e10cSrcweir     aWrappedProperties.push_back( new WrappedProperty( C2U( "StackedText" ), C2U( "StackCharacters" ) ) );
665*cdf0e10cSrcweir     aWrappedProperties.push_back( new WrappedDirectStateProperty( C2U( "CrossoverPosition" ), C2U( "CrossoverPosition" ) ) );
666*cdf0e10cSrcweir     {
667*cdf0e10cSrcweir         WrappedGapwidthProperty* pWrappedGapwidthProperty( new WrappedGapwidthProperty( m_spChart2ModelContact ) );
668*cdf0e10cSrcweir         WrappedBarOverlapProperty* pWrappedBarOverlapProperty( new WrappedBarOverlapProperty( m_spChart2ModelContact ) );
669*cdf0e10cSrcweir         sal_Int32 nDimensionIndex = 0;
670*cdf0e10cSrcweir         sal_Bool  bMainAxis = sal_True;
671*cdf0e10cSrcweir         sal_Int32 nAxisIndex = 0;
672*cdf0e10cSrcweir         AxisWrapper::getDimensionAndMainAxisBool( m_eType, nDimensionIndex, bMainAxis );
673*cdf0e10cSrcweir         if( !bMainAxis )
674*cdf0e10cSrcweir             nAxisIndex = 1;
675*cdf0e10cSrcweir         pWrappedGapwidthProperty->setDimensionAndAxisIndex( nDimensionIndex, nAxisIndex );
676*cdf0e10cSrcweir         pWrappedBarOverlapProperty->setDimensionAndAxisIndex( nDimensionIndex, nAxisIndex );
677*cdf0e10cSrcweir         aWrappedProperties.push_back( pWrappedGapwidthProperty );
678*cdf0e10cSrcweir         aWrappedProperties.push_back( pWrappedBarOverlapProperty );
679*cdf0e10cSrcweir     }
680*cdf0e10cSrcweir 
681*cdf0e10cSrcweir     WrappedScaleProperty::addWrappedProperties( aWrappedProperties, m_spChart2ModelContact );
682*cdf0e10cSrcweir 
683*cdf0e10cSrcweir     WrappedCharacterHeightProperty::addWrappedProperties( aWrappedProperties, this );
684*cdf0e10cSrcweir     WrappedScaleTextProperties::addWrappedProperties( aWrappedProperties, m_spChart2ModelContact );
685*cdf0e10cSrcweir 
686*cdf0e10cSrcweir     return aWrappedProperties;
687*cdf0e10cSrcweir }
688*cdf0e10cSrcweir 
689*cdf0e10cSrcweir // ================================================================================
690*cdf0e10cSrcweir 
691*cdf0e10cSrcweir Sequence< OUString > AxisWrapper::getSupportedServiceNames_Static()
692*cdf0e10cSrcweir {
693*cdf0e10cSrcweir     Sequence< OUString > aServices( 3 );
694*cdf0e10cSrcweir     aServices[ 0 ] = C2U( "com.sun.star.chart.ChartAxis" );
695*cdf0e10cSrcweir     aServices[ 1 ] = C2U( "com.sun.star.xml.UserDefinedAttributeSupplier" );
696*cdf0e10cSrcweir     aServices[ 2 ] = C2U( "com.sun.star.style.CharacterProperties" );
697*cdf0e10cSrcweir //     aServices[ 3 ] = C2U( "com.sun.star.beans.PropertySet" );
698*cdf0e10cSrcweir //     aServices[ 4 ] = C2U( "com.sun.star.drawing.LineProperties" );
699*cdf0e10cSrcweir 
700*cdf0e10cSrcweir     return aServices;
701*cdf0e10cSrcweir }
702*cdf0e10cSrcweir 
703*cdf0e10cSrcweir // implement XServiceInfo methods basing upon getSupportedServiceNames_Static
704*cdf0e10cSrcweir APPHELPER_XSERVICEINFO_IMPL( AxisWrapper, lcl_aServiceName );
705*cdf0e10cSrcweir 
706*cdf0e10cSrcweir } //  namespace wrapper
707*cdf0e10cSrcweir } //  namespace chart
708