Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*
3 : : * This file is part of the LibreOffice project.
4 : : *
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/.
8 : : *
9 : : * This file incorporates work covered by the following license notice:
10 : : *
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 .
18 : : */
19 : :
20 : : #include "DiagramWrapper.hxx"
21 : : #include "macros.hxx"
22 : : #include "servicenames_charttypes.hxx"
23 : : #include "DataSeriesPointWrapper.hxx"
24 : : #include "AxisWrapper.hxx"
25 : : #include "AxisHelper.hxx"
26 : : #include "Chart2ModelContact.hxx"
27 : : #include "PositionAndSizeHelper.hxx"
28 : : #include "WallFloorWrapper.hxx"
29 : : #include "MinMaxLineWrapper.hxx"
30 : : #include "UpDownBarWrapper.hxx"
31 : : #include "DiagramHelper.hxx"
32 : : #include "DataSourceHelper.hxx"
33 : : #include "ChartModelHelper.hxx"
34 : : #include "WrappedIgnoreProperty.hxx"
35 : : #include "WrappedAxisAndGridExistenceProperties.hxx"
36 : : #include "WrappedStatisticProperties.hxx"
37 : : #include "WrappedSymbolProperties.hxx"
38 : : #include "WrappedDataCaptionProperties.hxx"
39 : : #include "WrappedSplineProperties.hxx"
40 : : #include "WrappedStockProperties.hxx"
41 : : #include "WrappedSceneProperty.hxx"
42 : : #include "RelativePositionHelper.hxx"
43 : : #include "ContainerHelper.hxx"
44 : : #include "ControllerLockGuard.hxx"
45 : : #include "ModifyListenerHelper.hxx"
46 : : #include "DisposeHelper.hxx"
47 : : #include <comphelper/InlineContainer.hxx>
48 : : #include "WrappedAutomaticPositionProperties.hxx"
49 : : #include "CommonConverters.hxx"
50 : :
51 : : #include <com/sun/star/beans/PropertyAttribute.hpp>
52 : : #include <com/sun/star/chart2/XTitled.hpp>
53 : : #include <com/sun/star/chart/ChartDataRowSource.hpp>
54 : : #include <com/sun/star/chart2/RelativeSize.hpp>
55 : : #include <com/sun/star/chart2/RelativePosition.hpp>
56 : : #include <com/sun/star/chart/ChartSolidType.hpp>
57 : :
58 : : #include "LineProperties.hxx"
59 : : #include "FillProperties.hxx"
60 : : #include "UserDefinedProperties.hxx"
61 : : #include "SceneProperties.hxx"
62 : :
63 : : #include <algorithm>
64 : : #include <rtl/ustrbuf.hxx>
65 : : #include <com/sun/star/lang/XServiceName.hpp>
66 : : #include <com/sun/star/util/XRefreshable.hpp>
67 : :
68 : : using namespace ::com::sun::star;
69 : : using namespace ::chart::wrapper;
70 : :
71 : : using ::com::sun::star::uno::Reference;
72 : : using ::com::sun::star::uno::Any;
73 : : using ::com::sun::star::uno::Sequence;
74 : : using ::com::sun::star::beans::Property;
75 : : using ::com::sun::star::chart::XAxis;
76 : : using ::osl::MutexGuard;
77 : : using ::rtl::OUString;
78 : :
79 : : namespace
80 : : {
81 : 16 : static const OUString lcl_aServiceName( "com.sun.star.comp.chart.Diagram" );
82 : :
83 : : enum
84 : : {
85 : : PROP_DIAGRAM_ATTRIBUTED_DATA_POINTS,
86 : : PROP_DIAGRAM_PERCENT_STACKED,
87 : : PROP_DIAGRAM_STACKED,
88 : : PROP_DIAGRAM_THREE_D,
89 : : PROP_DIAGRAM_SOLIDTYPE,
90 : : PROP_DIAGRAM_DEEP,
91 : : PROP_DIAGRAM_VERTICAL,
92 : : PROP_DIAGRAM_NUMBER_OF_LINES,
93 : : PROP_DIAGRAM_STACKED_BARS_CONNECTED,
94 : : PROP_DIAGRAM_DATAROW_SOURCE,
95 : :
96 : : PROP_DIAGRAM_GROUP_BARS_PER_AXIS,
97 : : PROP_DIAGRAM_INCLUDE_HIDDEN_CELLS,
98 : :
99 : : PROP_DIAGRAM_SORT_BY_X_VALUES,
100 : :
101 : : PROP_DIAGRAM_STARTING_ANGLE,
102 : :
103 : : PROP_DIAGRAM_RIGHT_ANGLED_AXES,
104 : : PROP_DIAGRAM_PERSPECTIVE,
105 : : PROP_DIAGRAM_ROTATION_HORIZONTAL,
106 : : PROP_DIAGRAM_ROTATION_VERTICAL,
107 : :
108 : : PROP_DIAGRAM_MISSING_VALUE_TREATMENT,
109 : :
110 : : PROP_DIAGRAM_HAS_X_AXIS,
111 : : PROP_DIAGRAM_HAS_X_AXIS_DESCR,
112 : : PROP_DIAGRAM_HAS_X_AXIS_TITLE,
113 : : PROP_DIAGRAM_HAS_X_AXIS_GRID,
114 : : PROP_DIAGRAM_HAS_X_AXIS_HELP_GRID,
115 : :
116 : : PROP_DIAGRAM_HAS_Y_AXIS,
117 : : PROP_DIAGRAM_HAS_Y_AXIS_DESCR,
118 : : PROP_DIAGRAM_HAS_Y_AXIS_TITLE,
119 : : PROP_DIAGRAM_HAS_Y_AXIS_GRID,
120 : : PROP_DIAGRAM_HAS_Y_AXIS_HELP_GRID,
121 : :
122 : : PROP_DIAGRAM_HAS_Z_AXIS,
123 : : PROP_DIAGRAM_HAS_Z_AXIS_DESCR,
124 : : PROP_DIAGRAM_HAS_Z_AXIS_TITLE,
125 : : PROP_DIAGRAM_HAS_Z_AXIS_GRID,
126 : : PROP_DIAGRAM_HAS_Z_AXIS_HELP_GRID,
127 : :
128 : : PROP_DIAGRAM_HAS_SECOND_X_AXIS,
129 : : PROP_DIAGRAM_HAS_SECOND_X_AXIS_DESCR,
130 : :
131 : : PROP_DIAGRAM_HAS_SECOND_Y_AXIS,
132 : : PROP_DIAGRAM_HAS_SECOND_Y_AXIS_DESCR,
133 : :
134 : : PROP_DIAGRAM_HAS_SECOND_X_AXIS_TITLE,
135 : : PROP_DIAGRAM_HAS_SECOND_Y_AXIS_TITLE,
136 : :
137 : : PROP_DIAGRAM_AUTOMATIC_SIZE
138 : : };
139 : :
140 : 10 : void lcl_AddPropertiesToVector(
141 : : ::std::vector< Property > & rOutProperties )
142 : : {
143 : : rOutProperties.push_back(
144 : : Property( "AttributedDataPoints",
145 : : PROP_DIAGRAM_ATTRIBUTED_DATA_POINTS,
146 [ + - ]: 10 : ::getCppuType( reinterpret_cast< const uno::Sequence< uno::Sequence< sal_Int32 > > * >(0)),
147 : : beans::PropertyAttribute::BOUND
148 [ + - ]: 10 : | beans::PropertyAttribute::MAYBEVOID ));
149 : :
150 : : // see com.sun.star.chart.StackableDiagram
151 : : rOutProperties.push_back(
152 : : Property( "Percent",
153 : : PROP_DIAGRAM_PERCENT_STACKED,
154 [ + - ]: 10 : ::getBooleanCppuType(),
155 : : beans::PropertyAttribute::BOUND
156 [ + - ]: 10 : | beans::PropertyAttribute::MAYBEDEFAULT ));
157 : : rOutProperties.push_back(
158 : : Property( "Stacked",
159 : : PROP_DIAGRAM_STACKED,
160 [ + - ]: 10 : ::getBooleanCppuType(),
161 : : beans::PropertyAttribute::BOUND
162 [ + - ]: 10 : | beans::PropertyAttribute::MAYBEDEFAULT ));
163 : :
164 : : rOutProperties.push_back(
165 : : Property( "Dim3D",
166 : : PROP_DIAGRAM_THREE_D,
167 [ + - ]: 10 : ::getBooleanCppuType(),
168 : : beans::PropertyAttribute::BOUND
169 [ + - ]: 10 : | beans::PropertyAttribute::MAYBEDEFAULT ));
170 : :
171 : : // see com.sun.star.chart.Chart3DBarProperties
172 : : rOutProperties.push_back(
173 : : Property( "SolidType",
174 : : PROP_DIAGRAM_SOLIDTYPE,
175 [ + - ]: 10 : ::getCppuType( reinterpret_cast< sal_Int32 * >(0)),
176 : : beans::PropertyAttribute::BOUND
177 [ + - ]: 10 : | beans::PropertyAttribute::MAYBEDEFAULT ));
178 : :
179 : : // see com.sun.star.chart.BarDiagram
180 : : rOutProperties.push_back(
181 : : Property( "Deep",
182 : : PROP_DIAGRAM_DEEP,
183 [ + - ]: 10 : ::getBooleanCppuType(),
184 : : beans::PropertyAttribute::BOUND
185 [ + - ]: 10 : | beans::PropertyAttribute::MAYBEDEFAULT ));
186 : : rOutProperties.push_back(
187 : : Property( "Vertical",
188 : : PROP_DIAGRAM_VERTICAL,
189 [ + - ]: 10 : ::getBooleanCppuType(),
190 : : beans::PropertyAttribute::BOUND
191 [ + - ]: 10 : | beans::PropertyAttribute::MAYBEDEFAULT ));
192 : : rOutProperties.push_back(
193 : : Property( "NumberOfLines",
194 : : PROP_DIAGRAM_NUMBER_OF_LINES,
195 [ + - ]: 10 : ::getCppuType( reinterpret_cast< const sal_Int32 * >(0)),
196 : : beans::PropertyAttribute::BOUND
197 [ + - ]: 10 : | beans::PropertyAttribute::MAYBEDEFAULT ));
198 : : rOutProperties.push_back(
199 : : Property( "StackedBarsConnected",
200 : : PROP_DIAGRAM_STACKED_BARS_CONNECTED,
201 [ + - ]: 10 : ::getBooleanCppuType(),
202 : : beans::PropertyAttribute::BOUND
203 [ + - ]: 10 : | beans::PropertyAttribute::MAYBEDEFAULT ));
204 : :
205 : : rOutProperties.push_back(
206 : : Property( "DataRowSource",
207 : : PROP_DIAGRAM_DATAROW_SOURCE,
208 [ + - ]: 10 : ::getCppuType( reinterpret_cast< const ::com::sun::star::chart::ChartDataRowSource * >(0)),
209 : : beans::PropertyAttribute::BOUND
210 [ + - ]: 10 : | beans::PropertyAttribute::MAYBEDEFAULT ));
211 : :
212 : : rOutProperties.push_back(
213 : : Property( "GroupBarsPerAxis",
214 : : PROP_DIAGRAM_GROUP_BARS_PER_AXIS,
215 [ + - ]: 10 : ::getBooleanCppuType(),
216 : : beans::PropertyAttribute::BOUND
217 [ + - ]: 10 : | beans::PropertyAttribute::MAYBEDEFAULT ));
218 : :
219 : : rOutProperties.push_back(
220 : : Property( "IncludeHiddenCells",
221 : : PROP_DIAGRAM_INCLUDE_HIDDEN_CELLS,
222 [ + - ]: 10 : ::getBooleanCppuType(),
223 : : beans::PropertyAttribute::BOUND
224 [ + - ]: 10 : | beans::PropertyAttribute::MAYBEDEFAULT ));
225 : :
226 : : //new for XY charts
227 : : rOutProperties.push_back(
228 : : Property( "SortByXValues",
229 : : PROP_DIAGRAM_SORT_BY_X_VALUES,
230 [ + - ]: 10 : ::getBooleanCppuType(),
231 : : beans::PropertyAttribute::BOUND
232 [ + - ]: 10 : | beans::PropertyAttribute::MAYBEDEFAULT ));
233 : :
234 : : //for pie and donut charts
235 : : rOutProperties.push_back(
236 : : Property( "StartingAngle",
237 : : PROP_DIAGRAM_STARTING_ANGLE,
238 [ + - ]: 10 : ::getCppuType( reinterpret_cast< const sal_Int32 * >(0) ),
239 : : beans::PropertyAttribute::BOUND
240 [ + - ]: 10 : | beans::PropertyAttribute::MAYBEDEFAULT ));
241 : :
242 : : //new for 3D charts
243 : : rOutProperties.push_back(
244 : : Property( "RightAngledAxes",
245 : : PROP_DIAGRAM_RIGHT_ANGLED_AXES,
246 [ + - ]: 10 : ::getBooleanCppuType(),
247 : : beans::PropertyAttribute::BOUND
248 [ + - ]: 10 : | beans::PropertyAttribute::MAYBEDEFAULT ));
249 : :
250 : : rOutProperties.push_back(
251 : : Property( "Perspective",
252 : : PROP_DIAGRAM_PERSPECTIVE,
253 : 10 : ::getCppuType( reinterpret_cast< const sal_Int32 * >(0)),
254 [ + - ]: 10 : beans::PropertyAttribute::MAYBEVOID ));
255 : :
256 : : rOutProperties.push_back(
257 : : Property( "RotationHorizontal",
258 : : PROP_DIAGRAM_ROTATION_HORIZONTAL,
259 : 10 : ::getCppuType( reinterpret_cast< const sal_Int32 * >(0)),
260 [ + - ]: 10 : beans::PropertyAttribute::MAYBEVOID ));
261 : :
262 : : rOutProperties.push_back(
263 : : Property( "RotationVertical",
264 : : PROP_DIAGRAM_ROTATION_VERTICAL,
265 : 10 : ::getCppuType( reinterpret_cast< const sal_Int32 * >(0)),
266 [ + - ]: 10 : beans::PropertyAttribute::MAYBEVOID ));
267 : :
268 : : // XAxisXSupplier
269 : : rOutProperties.push_back(
270 : : Property( "HasXAxis",
271 : : PROP_DIAGRAM_HAS_X_AXIS,
272 [ + - ]: 10 : ::getBooleanCppuType(),
273 : : beans::PropertyAttribute::BOUND
274 [ + - ]: 10 : | beans::PropertyAttribute::MAYBEDEFAULT ));
275 : : rOutProperties.push_back(
276 : : Property( "HasXAxisDescription",
277 : : PROP_DIAGRAM_HAS_X_AXIS_DESCR,
278 [ + - ]: 10 : ::getBooleanCppuType(),
279 : : beans::PropertyAttribute::BOUND
280 [ + - ]: 10 : | beans::PropertyAttribute::MAYBEDEFAULT ));
281 : : rOutProperties.push_back(
282 : : Property( "HasXAxisTitle",
283 : : PROP_DIAGRAM_HAS_X_AXIS_TITLE,
284 [ + - ]: 10 : ::getBooleanCppuType(),
285 : : beans::PropertyAttribute::BOUND
286 [ + - ]: 10 : | beans::PropertyAttribute::MAYBEDEFAULT ));
287 : : rOutProperties.push_back(
288 : : Property( "HasXAxisGrid",
289 : : PROP_DIAGRAM_HAS_X_AXIS_GRID,
290 [ + - ]: 10 : ::getBooleanCppuType(),
291 : : beans::PropertyAttribute::BOUND
292 [ + - ]: 10 : | beans::PropertyAttribute::MAYBEDEFAULT ));
293 : : rOutProperties.push_back(
294 : : Property( "HasXAxisHelpGrid",
295 : : PROP_DIAGRAM_HAS_X_AXIS_HELP_GRID,
296 [ + - ]: 10 : ::getBooleanCppuType(),
297 : : beans::PropertyAttribute::BOUND
298 [ + - ]: 10 : | beans::PropertyAttribute::MAYBEDEFAULT ));
299 : :
300 : : // XAxisYSupplier
301 : : rOutProperties.push_back(
302 : : Property( "HasYAxis",
303 : : PROP_DIAGRAM_HAS_Y_AXIS,
304 [ + - ]: 10 : ::getBooleanCppuType(),
305 : : beans::PropertyAttribute::BOUND
306 [ + - ]: 10 : | beans::PropertyAttribute::MAYBEDEFAULT ));
307 : : rOutProperties.push_back(
308 : : Property( "HasYAxisDescription",
309 : : PROP_DIAGRAM_HAS_Y_AXIS_DESCR,
310 [ + - ]: 10 : ::getBooleanCppuType(),
311 : : beans::PropertyAttribute::BOUND
312 [ + - ]: 10 : | beans::PropertyAttribute::MAYBEDEFAULT ));
313 : : rOutProperties.push_back(
314 : : Property( "HasYAxisTitle",
315 : : PROP_DIAGRAM_HAS_Y_AXIS_TITLE,
316 [ + - ]: 10 : ::getBooleanCppuType(),
317 : : beans::PropertyAttribute::BOUND
318 [ + - ]: 10 : | beans::PropertyAttribute::MAYBEDEFAULT ));
319 : : rOutProperties.push_back(
320 : : Property( "HasYAxisGrid",
321 : : PROP_DIAGRAM_HAS_Y_AXIS_GRID,
322 [ + - ]: 10 : ::getBooleanCppuType(),
323 : : beans::PropertyAttribute::BOUND
324 [ + - ]: 10 : | beans::PropertyAttribute::MAYBEDEFAULT ));
325 : : rOutProperties.push_back(
326 : : Property( "HasYAxisHelpGrid",
327 : : PROP_DIAGRAM_HAS_Y_AXIS_HELP_GRID,
328 [ + - ]: 10 : ::getBooleanCppuType(),
329 : : beans::PropertyAttribute::BOUND
330 [ + - ]: 10 : | beans::PropertyAttribute::MAYBEDEFAULT ));
331 : :
332 : : // XAxisZSupplier
333 : : rOutProperties.push_back(
334 : : Property( "HasZAxis",
335 : : PROP_DIAGRAM_HAS_Z_AXIS,
336 [ + - ]: 10 : ::getBooleanCppuType(),
337 : : beans::PropertyAttribute::BOUND
338 [ + - ]: 10 : | beans::PropertyAttribute::MAYBEDEFAULT ));
339 : : rOutProperties.push_back(
340 : : Property( "HasZAxisDescription",
341 : : PROP_DIAGRAM_HAS_Z_AXIS_DESCR,
342 [ + - ]: 10 : ::getBooleanCppuType(),
343 : : beans::PropertyAttribute::BOUND
344 [ + - ]: 10 : | beans::PropertyAttribute::MAYBEDEFAULT ));
345 : : rOutProperties.push_back(
346 : : Property( "HasZAxisTitle",
347 : : PROP_DIAGRAM_HAS_Z_AXIS_TITLE,
348 [ + - ]: 10 : ::getBooleanCppuType(),
349 : : beans::PropertyAttribute::BOUND
350 [ + - ]: 10 : | beans::PropertyAttribute::MAYBEDEFAULT ));
351 : : rOutProperties.push_back(
352 : : Property( "HasZAxisGrid",
353 : : PROP_DIAGRAM_HAS_Z_AXIS_GRID,
354 [ + - ]: 10 : ::getBooleanCppuType(),
355 : : beans::PropertyAttribute::BOUND
356 [ + - ]: 10 : | beans::PropertyAttribute::MAYBEDEFAULT ));
357 : : rOutProperties.push_back(
358 : : Property( "HasZAxisHelpGrid",
359 : : PROP_DIAGRAM_HAS_Z_AXIS_HELP_GRID,
360 [ + - ]: 10 : ::getBooleanCppuType(),
361 : : beans::PropertyAttribute::BOUND
362 [ + - ]: 10 : | beans::PropertyAttribute::MAYBEDEFAULT ));
363 : :
364 : : // XTwoAxisXSupplier
365 : : rOutProperties.push_back(
366 : : Property( "HasSecondaryXAxis",
367 : : PROP_DIAGRAM_HAS_SECOND_X_AXIS,
368 [ + - ]: 10 : ::getBooleanCppuType(),
369 : : beans::PropertyAttribute::BOUND
370 [ + - ]: 10 : | beans::PropertyAttribute::MAYBEDEFAULT ));
371 : : rOutProperties.push_back(
372 : : Property( "HasSecondaryXAxisDescription",
373 : : PROP_DIAGRAM_HAS_SECOND_X_AXIS_DESCR,
374 [ + - ]: 10 : ::getBooleanCppuType(),
375 : : beans::PropertyAttribute::BOUND
376 [ + - ]: 10 : | beans::PropertyAttribute::MAYBEDEFAULT ));
377 : :
378 : : // XTwoAxisYSupplier
379 : : rOutProperties.push_back(
380 : : Property( "HasSecondaryYAxis",
381 : : PROP_DIAGRAM_HAS_SECOND_Y_AXIS,
382 [ + - ]: 10 : ::getBooleanCppuType(),
383 : : beans::PropertyAttribute::BOUND
384 [ + - ]: 10 : | beans::PropertyAttribute::MAYBEDEFAULT ));
385 : : rOutProperties.push_back(
386 : : Property( "HasSecondaryYAxisDescription",
387 : : PROP_DIAGRAM_HAS_SECOND_Y_AXIS_DESCR,
388 [ + - ]: 10 : ::getBooleanCppuType(),
389 : : beans::PropertyAttribute::BOUND
390 [ + - ]: 10 : | beans::PropertyAttribute::MAYBEDEFAULT ));
391 : :
392 : : // XSecondAxisTitleSupplier
393 : : rOutProperties.push_back(
394 : : Property( "HasSecondaryXAxisTitle",
395 : : PROP_DIAGRAM_HAS_SECOND_X_AXIS_TITLE,
396 [ + - ]: 10 : ::getBooleanCppuType(),
397 : : beans::PropertyAttribute::BOUND
398 [ + - ]: 10 : | beans::PropertyAttribute::MAYBEDEFAULT ));
399 : : rOutProperties.push_back(
400 : : Property( "HasSecondaryYAxisTitle",
401 : : PROP_DIAGRAM_HAS_SECOND_Y_AXIS_TITLE,
402 [ + - ]: 10 : ::getBooleanCppuType(),
403 : : beans::PropertyAttribute::BOUND
404 [ + - ]: 10 : | beans::PropertyAttribute::MAYBEDEFAULT ));
405 : :
406 : : rOutProperties.push_back(
407 : : Property( "MissingValueTreatment",
408 : : PROP_DIAGRAM_MISSING_VALUE_TREATMENT,
409 [ + - ]: 10 : ::getCppuType( reinterpret_cast< const sal_Int32 * >(0)),
410 : : beans::PropertyAttribute::BOUND
411 [ + - ]: 10 : | beans::PropertyAttribute::MAYBEVOID ));
412 : :
413 : : rOutProperties.push_back(
414 : : Property( "AutomaticSize",
415 : : PROP_DIAGRAM_AUTOMATIC_SIZE,
416 [ + - ]: 10 : ::getBooleanCppuType(),
417 : : beans::PropertyAttribute::BOUND
418 [ + - ]: 10 : | beans::PropertyAttribute::MAYBEDEFAULT ));
419 : 10 : }
420 : :
421 : : struct StaticDiagramWrapperPropertyArray_Initializer
422 : : {
423 : 10 : Sequence< Property >* operator()()
424 : : {
425 [ + - ][ + - ]: 10 : static Sequence< Property > aPropSeq( lcl_GetPropertySequence() );
[ + - ][ # # ]
426 : 10 : return &aPropSeq;
427 : : }
428 : :
429 : : private:
430 : 10 : uno::Sequence< Property > lcl_GetPropertySequence()
431 : : {
432 [ + - ]: 10 : ::std::vector< ::com::sun::star::beans::Property > aProperties;
433 [ + - ]: 10 : lcl_AddPropertiesToVector( aProperties );
434 [ + - ]: 10 : ::chart::LineProperties::AddPropertiesToVector( aProperties );
435 [ + - ]: 10 : ::chart::FillProperties::AddPropertiesToVector( aProperties );
436 [ + - ]: 10 : ::chart::UserDefinedProperties::AddPropertiesToVector( aProperties );
437 [ + - ]: 10 : ::chart::SceneProperties::AddPropertiesToVector( aProperties );
438 [ + - ]: 10 : WrappedStatisticProperties::addProperties( aProperties );
439 [ + - ]: 10 : WrappedSymbolProperties::addProperties( aProperties );
440 [ + - ]: 10 : WrappedDataCaptionProperties::addProperties( aProperties );
441 [ + - ]: 10 : WrappedSplineProperties::addProperties( aProperties );
442 [ + - ]: 10 : WrappedStockProperties::addProperties( aProperties );
443 [ + - ]: 10 : WrappedAutomaticPositionProperties::addProperties( aProperties );
444 : :
445 : : ::std::sort( aProperties.begin(), aProperties.end(),
446 [ + - ]: 10 : ::chart::PropertyNameLess() );
447 : :
448 [ + - ]: 10 : return ::chart::ContainerHelper::ContainerToSequence( aProperties );
449 : : }
450 : : };
451 : :
452 : : struct StaticDiagramWrapperPropertyArray : public rtl::StaticAggregate< Sequence< Property >, StaticDiagramWrapperPropertyArray_Initializer >
453 : : {
454 : : };
455 : :
456 : 86 : bool lcl_isXYChart( const Reference< chart2::XDiagram > xDiagram )
457 : : {
458 : 86 : bool bRet = false;
459 [ + - ]: 86 : Reference< chart2::XChartType > xChartType( ::chart::DiagramHelper::getChartTypeByIndex( xDiagram, 0 ) );
460 [ + - ]: 86 : if( xChartType.is() )
461 : : {
462 [ + - ][ + - ]: 86 : rtl::OUString aChartType( xChartType->getChartType() );
463 [ + - ][ - + ]: 86 : if( aChartType.equalsIgnoreAsciiCase(CHART2_SERVICE_NAME_CHARTTYPE_SCATTER) )
464 : 86 : bRet = true;
465 : : }
466 : 86 : return bRet;
467 : : }
468 : :
469 : 86 : sal_Int32 lcl_getNewAPIIndexForOldAPIIndex(
470 : : sal_Int32 nOldAPIIndex
471 : : , Reference< chart2::XDiagram > xDiagram )
472 : : {
473 : 86 : sal_Int32 nNewAPIIndex = nOldAPIIndex;
474 : :
475 [ + - ][ - + ]: 86 : if( lcl_isXYChart( xDiagram ) )
476 : : {
477 [ # # ]: 0 : if( nNewAPIIndex >= 1 )
478 : 0 : nNewAPIIndex -= 1;
479 : : }
480 : :
481 : : ::std::vector< uno::Reference< chart2::XDataSeries > > aSeriesList(
482 [ + - ]: 86 : ::chart::DiagramHelper::getDataSeriesFromDiagram( xDiagram ) );
483 [ - + ]: 86 : if( nNewAPIIndex >= static_cast<sal_Int32>(aSeriesList.size()) )
484 : 0 : nNewAPIIndex = -1;
485 : :
486 : 86 : return nNewAPIIndex;
487 : : }
488 : :
489 : 35 : OUString lcl_getDiagramType( const OUString & rTemplateServiceName )
490 : : {
491 : 35 : const OUString aPrefix("com.sun.star.chart2.template.");
492 : :
493 [ + - ]: 35 : if( rTemplateServiceName.match( aPrefix ))
494 : : {
495 : 35 : const OUString aName( rTemplateServiceName.copy( aPrefix.getLength()));
496 : :
497 : : // "Area" "StackedArea" "PercentStackedArea" "ThreeDArea"
498 : : // "StackedThreeDArea" "PercentStackedThreeDArea"
499 [ - + ]: 35 : if( aName.indexOf( "Area" ) != -1 )
500 : 0 : return rtl::OUString("com.sun.star.chart.AreaDiagram");
501 : :
502 : : // "Pie" "PieAllExploded" "ThreeDPie" "ThreeDPieAllExploded"
503 [ - + ]: 35 : if( aName.indexOf( "Pie" ) != -1 )
504 : 0 : return rtl::OUString("com.sun.star.chart.PieDiagram");
505 : :
506 : : // "Column" "StackedColumn" "PercentStackedColumn" "ThreeDColumnDeep"
507 : : // "ThreeDColumnFlat" "StackedThreeDColumnFlat"
508 : : // "PercentStackedThreeDColumnFlat" "Bar" "StackedBar"
509 : : // "PercentStackedBar" "ThreeDBarDeep" "ThreeDBarFlat"
510 : : // "StackedThreeDBarFlat" "PercentStackedThreeDBarFlat" "ColumnWithLine"
511 : : // "StackedColumnWithLine"
512 [ + + ][ - + ]: 35 : if( aName.indexOf( "Column" ) != -1 || aName.indexOf( "Bar" ) != -1 )
[ + + ]
513 : 33 : return rtl::OUString( "com.sun.star.chart.BarDiagram" );
514 : :
515 : : // "Donut" "DonutAllExploded" "ThreeDDonut" "ThreeDDonutAllExploded"
516 [ - + ]: 2 : if( aName.indexOf( "Donut" ) != -1 )
517 : 0 : return rtl::OUString( "com.sun.star.chart.DonutDiagram" );
518 : :
519 : : // "ScatterLineSymbol" "ScatterLine" "ScatterSymbol" "ThreeDScatter"
520 [ - + ]: 2 : if( aName.indexOf( "Scatter" ) != -1 )
521 : 0 : return rtl::OUString( "com.sun.star.chart.XYDiagram" );
522 : :
523 : : // "FilledNet" "StackedFilledNet" "PercentStackedFilledNet"
524 [ - + ]: 2 : if( aName.indexOf( "FilledNet" ) != -1 )
525 : 0 : return rtl::OUString( "com.sun.star.chart.FilledNetDiagram" );
526 : :
527 : : // "Net" "NetSymbol" "NetLine" "StackedNet" "StackedNetSymbol"
528 : : // "StackedNetLine" "PercentStackedNet" "PercentStackedNetSymbol"
529 : : // "PercentStackedNetLine"
530 [ - + ]: 2 : if( aName.indexOf( "Net" ) != -1 )
531 : 0 : return rtl::OUString( "com.sun.star.chart.NetDiagram" );
532 : :
533 : : // "StockLowHighClose" "StockOpenLowHighClose" "StockVolumeLowHighClose"
534 : : // "StockVolumeOpenLowHighClose"
535 [ - + ]: 2 : if( aName.indexOf( "Stock" ) != -1 )
536 : 0 : return rtl::OUString( "com.sun.star.chart.StockDiagram" );
537 : :
538 [ - + ]: 2 : if( aName.indexOf( "Bubble" ) != -1 )
539 : 0 : return rtl::OUString( "com.sun.star.chart.BubbleDiagram" );
540 : :
541 : : // Note: this must be checked after Bar, Net and Scatter
542 : :
543 : : // "Symbol" "StackedSymbol" "PercentStackedSymbol" "Line" "StackedLine"
544 : : // "PercentStackedLine" "LineSymbol" "StackedLineSymbol"
545 : : // "PercentStackedLineSymbol" "ThreeDLine" "StackedThreeDLine"
546 : : // "PercentStackedThreeDLine" "ThreeDLineDeep"
547 [ - + ][ # # ]: 2 : if( aName.indexOf( "Line" ) != -1 || aName.indexOf( "Symbol" ) != -1 )
[ + - ]
548 : 2 : return rtl::OUString( "com.sun.star.chart.LineDiagram" );
549 : :
550 [ - + ]: 35 : OSL_FAIL( "unknown template" );
551 : : }
552 : :
553 : 35 : return OUString();
554 : : }
555 : :
556 : : typedef ::comphelper::MakeMap< ::rtl::OUString, ::rtl::OUString > tMakeStringStringMap;
557 : :
558 : 0 : const tMakeStringStringMap& lcl_getChartTypeNameMap()
559 : : {
560 : : static tMakeStringStringMap g_aChartTypeNameMap =
561 : : tMakeStringStringMap
562 : : ( "com.sun.star.chart2.LineChartType", "com.sun.star.chart.LineDiagram" )
563 [ # # ][ # # ]: 0 : ( "com.sun.star.chart2.AreaChartType", "com.sun.star.chart.AreaDiagram" )
564 [ # # ]: 0 : ( "com.sun.star.chart2.ColumnChartType", "com.sun.star.chart.BarDiagram" )
565 [ # # ]: 0 : ( "com.sun.star.chart2.PieChartType", "com.sun.star.chart.PieDiagram" )
566 [ # # ]: 0 : ( "com.sun.star.chart2.DonutChartType", "com.sun.star.chart.DonutDiagram" )
567 [ # # ]: 0 : ( "com.sun.star.chart2.ScatterChartType", "com.sun.star.chart.XYDiagram" )
568 [ # # ]: 0 : ( "com.sun.star.chart2.FilledNetChartType", "com.sun.star.chart.FilledNetDiagram" )
569 [ # # ]: 0 : ( "com.sun.star.chart2.NetChartType", "com.sun.star.chart.NetDiagram" )
570 [ # # ]: 0 : ( "com.sun.star.chart2.CandleStickChartType", "com.sun.star.chart.StockDiagram" )
571 [ # # ][ # # ]: 0 : ( "com.sun.star.chart2.BubbleChartType", "com.sun.star.chart.BubbleDiagram" )
[ # # ][ # # ]
[ # # ]
572 : : ;
573 : 0 : return g_aChartTypeNameMap;
574 : : }
575 : :
576 : :
577 : 0 : OUString lcl_getOldChartTypeName( const OUString & rNewChartTypeName )
578 : : {
579 : 0 : OUString aOld(rNewChartTypeName);
580 : :
581 [ # # ]: 0 : const tMakeStringStringMap& rMap = lcl_getChartTypeNameMap();
582 [ # # ]: 0 : tMakeStringStringMap::const_iterator aIt( rMap.find( rNewChartTypeName ));
583 [ # # ]: 0 : if( aIt != rMap.end())
584 : : {
585 : 0 : aOld = aIt->second;
586 : : }
587 : 0 : return aOld;
588 : : }
589 : :
590 : : } // anonymous namespace
591 : :
592 : : // --------------------------------------------------------------------------------
593 : :
594 : : namespace chart
595 : : {
596 : : namespace wrapper
597 : : {
598 : :
599 : 86 : DiagramWrapper::DiagramWrapper(
600 : : ::boost::shared_ptr< Chart2ModelContact > spChart2ModelContact ) :
601 : : m_spChart2ModelContact( spChart2ModelContact ),
602 [ + - ][ + - ]: 86 : m_aEventListenerContainer( m_aMutex )
603 : : {
604 : 86 : }
605 : :
606 [ + - ][ + - ]: 86 : DiagramWrapper::~DiagramWrapper()
607 [ - + ]: 172 : {}
608 : :
609 : : // ____ XDiagram ____
610 : 35 : OUString SAL_CALL DiagramWrapper::getDiagramType()
611 : : throw (uno::RuntimeException)
612 : : {
613 : 35 : OUString aRet;
614 : :
615 [ + - ]: 35 : Reference< chart2::XChartDocument > xChartDoc( m_spChart2ModelContact->getChart2Document() );
616 [ + - ]: 35 : Reference< chart2::XDiagram > xDiagram( m_spChart2ModelContact->getChart2Diagram() );
617 [ + - ][ + - ]: 35 : if( xChartDoc.is() && xDiagram.is() )
[ + - ]
618 : : {
619 [ + - ]: 35 : Reference< beans::XPropertySet > xChartDocProp( xChartDoc, uno::UNO_QUERY );
620 [ + - ]: 35 : if( xChartDocProp.is() )
621 : : {
622 : 35 : uno::Reference< util::XRefreshable > xAddIn;
623 [ + - ][ + - ]: 35 : if( xChartDocProp->getPropertyValue( "AddIn" ) >>= xAddIn )
[ + - ][ + - ]
624 : : {
625 [ + - ]: 35 : uno::Reference< lang::XServiceName > xServiceName( xAddIn, uno::UNO_QUERY );
626 [ - + ]: 35 : if( xServiceName.is())
627 [ # # ][ # # ]: 35 : return xServiceName->getServiceName();
[ + - ]
628 [ + - ]: 35 : }
629 : : }
630 : :
631 [ + - ][ + - ]: 35 : Reference< lang::XMultiServiceFactory > xChartTypeManager( xChartDoc->getChartTypeManager(), uno::UNO_QUERY );
[ + - ]
632 : : DiagramHelper::tTemplateWithServiceName aTemplateAndService =
633 [ + - ]: 35 : DiagramHelper::getTemplateForDiagram( xDiagram, xChartTypeManager );
634 : :
635 [ + - ][ + - ]: 35 : aRet = lcl_getDiagramType( aTemplateAndService.second );
[ + - ]
636 : : }
637 : :
638 [ - + ]: 35 : if( aRet.isEmpty())
639 : : {
640 : : // none of the standard templates matched
641 : : // use first chart type
642 [ # # ]: 0 : Reference< chart2::XChartType > xChartType( DiagramHelper::getChartTypeByIndex( xDiagram, 0 ) );
643 [ # # ]: 0 : if( xChartType.is() )
644 : : {
645 [ # # ][ # # ]: 0 : aRet = xChartType->getChartType();
646 [ # # ]: 0 : if( !aRet.isEmpty() )
647 [ # # ]: 0 : aRet = lcl_getOldChartTypeName( aRet );
648 : : }
649 [ # # ]: 0 : if( aRet.isEmpty())
650 : 0 : aRet = "com.sun.star.chart.BarDiagram";
651 : : }
652 : :
653 : 35 : return aRet;
654 : : }
655 : :
656 : : Reference<
657 : 6 : beans::XPropertySet > SAL_CALL DiagramWrapper::getDataRowProperties( sal_Int32 nRow )
658 : : throw (lang::IndexOutOfBoundsException,
659 : : uno::RuntimeException)
660 : : {
661 [ - + ]: 6 : if( nRow < 0 )
662 : : throw lang::IndexOutOfBoundsException("DataSeries index invalid",
663 [ # # ][ # # ]: 0 : static_cast< ::cppu::OWeakObject * >( this ));
664 : :
665 : 6 : Reference< chart2::XDataSeries > xSeries;
666 : :
667 [ + - ][ + - ]: 6 : sal_Int32 nNewAPIIndex = lcl_getNewAPIIndexForOldAPIIndex( nRow, m_spChart2ModelContact->getChart2Diagram() );
668 [ - + ]: 6 : if( nNewAPIIndex < 0 )
669 : : throw lang::IndexOutOfBoundsException("DataSeries index invalid",
670 [ # # ][ # # ]: 0 : static_cast< ::cppu::OWeakObject * >( this ));
671 : :
672 : : Reference< beans::XPropertySet > xRet( new DataSeriesPointWrapper(
673 [ + - ][ + - ]: 6 : DataSeriesPointWrapper::DATA_SERIES, nNewAPIIndex, 0, m_spChart2ModelContact ) );
[ + - ][ + - ]
[ + - ]
674 : 6 : return xRet;
675 : : }
676 : :
677 : : Reference<
678 : 80 : beans::XPropertySet > SAL_CALL DiagramWrapper::getDataPointProperties( sal_Int32 nCol, sal_Int32 nRow )
679 : : throw (lang::IndexOutOfBoundsException,
680 : : uno::RuntimeException)
681 : : {
682 [ + - ][ - + ]: 80 : if( nCol < 0 || nRow < 0 )
683 : : throw lang::IndexOutOfBoundsException("DataSeries index invalid",
684 [ # # ][ # # ]: 0 : static_cast< ::cppu::OWeakObject * >( this ));
685 : :
686 : 80 : Reference< chart2::XDataSeries > xSeries;
687 : :
688 [ + - ][ + - ]: 80 : sal_Int32 nNewAPIIndex = lcl_getNewAPIIndexForOldAPIIndex( nRow, m_spChart2ModelContact->getChart2Diagram() );
689 [ - + ]: 80 : if( nNewAPIIndex < 0 )
690 : : throw lang::IndexOutOfBoundsException("DataSeries index invalid",
691 [ # # ][ # # ]: 0 : static_cast< ::cppu::OWeakObject * >( this ));
692 : :
693 : : //todo: check borders of point index
694 : :
695 : : Reference< beans::XPropertySet > xRet( new DataSeriesPointWrapper(
696 [ + - ][ + - ]: 80 : DataSeriesPointWrapper::DATA_POINT, nNewAPIIndex, nCol, m_spChart2ModelContact ) );
[ + - ][ + - ]
[ + - ]
697 : :
698 : 80 : return xRet;
699 : : }
700 : :
701 : : // ____ XShape (base of XDiagram) ____
702 : 13 : awt::Point SAL_CALL DiagramWrapper::getPosition()
703 : : throw (uno::RuntimeException)
704 : : {
705 [ + - ]: 13 : awt::Point aPosition = ToPoint( m_spChart2ModelContact->GetDiagramRectangleIncludingAxes() );
706 : 13 : return aPosition;
707 : : }
708 : :
709 : 2 : void SAL_CALL DiagramWrapper::setPosition( const awt::Point& aPosition )
710 : : throw (uno::RuntimeException)
711 : : {
712 [ + - ][ + - ]: 2 : ControllerLockGuard aCtrlLockGuard( m_spChart2ModelContact->getChartModel() );
713 [ + - ]: 2 : Reference< beans::XPropertySet > xProp( this->getInnerPropertySet() );
714 [ + - ]: 2 : if( xProp.is() )
715 : : {
716 [ + - ]: 2 : awt::Size aPageSize( m_spChart2ModelContact->GetPageSize() );
717 : :
718 : 2 : chart2::RelativePosition aRelativePosition;
719 : 2 : aRelativePosition.Anchor = drawing::Alignment_TOP_LEFT;
720 : 2 : aRelativePosition.Primary = double(aPosition.X)/double(aPageSize.Width);
721 : 2 : aRelativePosition.Secondary = double(aPosition.Y)/double(aPageSize.Height);
722 [ + - ][ + - ]: 2 : if( aRelativePosition.Primary < 0 || aRelativePosition.Secondary < 0 || aRelativePosition.Primary > 1 || aRelativePosition.Secondary > 1 )
[ - + ][ + - ]
723 : : {
724 : : OSL_FAIL("DiagramWrapper::setPosition called with a position out of range -> automatic values are taken instead" );
725 : 0 : uno::Any aEmpty;
726 [ # # ][ # # ]: 0 : xProp->setPropertyValue( "RelativePosition", aEmpty );
727 : 2 : return;
728 : : }
729 [ + - ][ + - ]: 2 : xProp->setPropertyValue( "RelativePosition", uno::makeAny(aRelativePosition) );
[ + - ]
730 [ + - ][ + - ]: 2 : xProp->setPropertyValue( "PosSizeExcludeAxes", uno::makeAny(false) );
[ + - ]
731 [ - + ][ + - ]: 2 : }
[ + - ]
732 : : }
733 : :
734 : 13 : awt::Size SAL_CALL DiagramWrapper::getSize()
735 : : throw (uno::RuntimeException)
736 : : {
737 [ + - ]: 13 : awt::Size aSize = ToSize( m_spChart2ModelContact->GetDiagramRectangleIncludingAxes() );
738 : 13 : return aSize;
739 : : }
740 : :
741 : 2 : void SAL_CALL DiagramWrapper::setSize( const awt::Size& aSize )
742 : : throw (beans::PropertyVetoException,
743 : : uno::RuntimeException)
744 : : {
745 [ + - ][ + - ]: 2 : ControllerLockGuard aCtrlLockGuard( m_spChart2ModelContact->getChartModel() );
746 [ + - ]: 2 : Reference< beans::XPropertySet > xProp( this->getInnerPropertySet() );
747 [ + - ]: 2 : if( xProp.is() )
748 : : {
749 [ + - ]: 2 : awt::Size aPageSize( m_spChart2ModelContact->GetPageSize() );
750 : :
751 : 2 : chart2::RelativeSize aRelativeSize;
752 : 2 : aRelativeSize.Primary = double(aSize.Width)/double(aPageSize.Width);
753 : 2 : aRelativeSize.Secondary = double(aSize.Height)/double(aPageSize.Height);
754 : :
755 [ - + ][ + - ]: 2 : if( aRelativeSize.Primary > 1 || aRelativeSize.Secondary > 1 )
756 : : {
757 : : OSL_FAIL("DiagramWrapper::setSize called with sizes bigger than page -> automatic values are taken instead" );
758 : 0 : uno::Any aEmpty;
759 [ # # ][ # # ]: 0 : xProp->setPropertyValue( "RelativeSize", aEmpty );
760 : 2 : return;
761 : : }
762 : :
763 [ + - ][ + - ]: 2 : xProp->setPropertyValue( "RelativeSize", uno::makeAny(aRelativeSize) );
[ + - ]
764 [ + - ][ + - ]: 2 : xProp->setPropertyValue( "PosSizeExcludeAxes", uno::makeAny(false) );
[ + - ]
765 [ - + ][ + - ]: 2 : }
[ + - ]
766 : : }
767 : :
768 : : // ____ XShapeDescriptor (base of XShape) ____
769 : 2 : OUString SAL_CALL DiagramWrapper::getShapeType()
770 : : throw (uno::RuntimeException)
771 : : {
772 : 2 : return rtl::OUString( "com.sun.star.chart.Diagram" );
773 : : }
774 : :
775 : : // ____ XDiagramPositioning ____
776 : :
777 : 0 : void SAL_CALL DiagramWrapper::setAutomaticDiagramPositioning() throw (uno::RuntimeException)
778 : : {
779 [ # # ][ # # ]: 0 : ControllerLockGuard aCtrlLockGuard( m_spChart2ModelContact->getChartModel() );
780 [ # # ][ # # ]: 0 : uno::Reference< beans::XPropertySet > xDiaProps( this->getDiagram(), uno::UNO_QUERY );
781 [ # # ]: 0 : if( xDiaProps.is() )
782 : : {
783 [ # # ][ # # ]: 0 : xDiaProps->setPropertyValue( "RelativeSize", Any() );
784 [ # # ][ # # ]: 0 : xDiaProps->setPropertyValue( "RelativePosition", Any() );
785 [ # # ]: 0 : }
786 : 0 : }
787 : 998 : ::sal_Bool SAL_CALL DiagramWrapper::isAutomaticDiagramPositioning( ) throw (uno::RuntimeException)
788 : : {
789 [ + - ][ + - ]: 998 : uno::Reference< beans::XPropertySet > xDiaProps( this->getDiagram(), uno::UNO_QUERY );
790 [ + + ]: 998 : if( xDiaProps.is() )
791 : : {
792 [ + - ][ + - ]: 990 : Any aRelativeSize( xDiaProps->getPropertyValue( "RelativeSize" ) );
793 [ + - ][ + - ]: 990 : Any aRelativePosition( xDiaProps->getPropertyValue( "RelativePosition" ) );
794 [ + - ][ + + ]: 990 : if( aRelativeSize.hasValue() && aRelativePosition.hasValue() )
[ + + ]
795 [ + + ][ + + ]: 990 : return false;
796 : : }
797 : 998 : return true;
798 : : }
799 : 8 : void SAL_CALL DiagramWrapper::setDiagramPositionExcludingAxes( const awt::Rectangle& rPositionRect ) throw (uno::RuntimeException)
800 : : {
801 [ + - ][ + - ]: 8 : ControllerLockGuard aCtrlLockGuard( m_spChart2ModelContact->getChartModel() );
802 [ + - ][ + - ]: 8 : DiagramHelper::setDiagramPositioning( m_spChart2ModelContact->getChartModel(), rPositionRect );
803 [ + - ][ + - ]: 8 : uno::Reference< beans::XPropertySet > xDiaProps( this->getDiagram(), uno::UNO_QUERY );
804 [ + - ]: 8 : if( xDiaProps.is() )
805 [ + - ][ + - ]: 8 : xDiaProps->setPropertyValue("PosSizeExcludeAxes", uno::makeAny(true) );
[ + - ][ + - ]
806 : 8 : }
807 : 336 : ::sal_Bool SAL_CALL DiagramWrapper::isExcludingDiagramPositioning() throw (uno::RuntimeException)
808 : : {
809 [ + - ][ + - ]: 336 : uno::Reference< beans::XPropertySet > xDiaProps( this->getDiagram(), uno::UNO_QUERY );
810 [ + - ]: 336 : if( xDiaProps.is() )
811 : : {
812 [ + - ][ + - ]: 336 : Any aRelativeSize( xDiaProps->getPropertyValue( "RelativeSize" ) );
813 [ + - ][ + - ]: 336 : Any aRelativePosition( xDiaProps->getPropertyValue( "RelativePosition" ) );
814 [ + - ][ + - ]: 336 : if( aRelativeSize.hasValue() && aRelativePosition.hasValue() )
[ + - ]
815 : : {
816 : 336 : sal_Bool bPosSizeExcludeAxes = false;
817 [ + - ][ + - ]: 336 : xDiaProps->getPropertyValue( "PosSizeExcludeAxes" ) >>= bPosSizeExcludeAxes;
818 : 336 : return bPosSizeExcludeAxes;
819 [ + - ][ - + ]: 336 : }
820 : : }
821 : 336 : return false;
822 : : }
823 : 17 : awt::Rectangle SAL_CALL DiagramWrapper::calculateDiagramPositionExcludingAxes( ) throw (uno::RuntimeException)
824 : : {
825 : 17 : return m_spChart2ModelContact->GetDiagramRectangleExcludingAxes();
826 : : }
827 : 9 : void SAL_CALL DiagramWrapper::setDiagramPositionIncludingAxes( const awt::Rectangle& rPositionRect ) throw (uno::RuntimeException)
828 : : {
829 [ + - ][ + - ]: 9 : ControllerLockGuard aCtrlLockGuard( m_spChart2ModelContact->getChartModel() );
830 [ + - ][ + - ]: 9 : DiagramHelper::setDiagramPositioning( m_spChart2ModelContact->getChartModel(), rPositionRect );
831 [ + - ][ + - ]: 9 : uno::Reference< beans::XPropertySet > xDiaProps( this->getDiagram(), uno::UNO_QUERY );
832 [ + - ]: 9 : if( xDiaProps.is() )
833 [ + - ][ + - ]: 9 : xDiaProps->setPropertyValue("PosSizeExcludeAxes", uno::makeAny(false) );
[ + - ][ + - ]
834 : 9 : }
835 : 0 : awt::Rectangle SAL_CALL DiagramWrapper::calculateDiagramPositionIncludingAxes( ) throw (uno::RuntimeException)
836 : : {
837 : 0 : return m_spChart2ModelContact->GetDiagramRectangleIncludingAxes();
838 : : }
839 : 0 : void SAL_CALL DiagramWrapper::setDiagramPositionIncludingAxesAndAxisTitles( const awt::Rectangle& rPositionRect ) throw (uno::RuntimeException)
840 : : {
841 [ # # ][ # # ]: 0 : ControllerLockGuard aCtrlLockGuard( m_spChart2ModelContact->getChartModel() );
842 [ # # ]: 0 : awt::Rectangle aRect( m_spChart2ModelContact->SubstractAxisTitleSizes(rPositionRect) );
843 [ # # ][ # # ]: 0 : DiagramWrapper::setDiagramPositionIncludingAxes( aRect );
844 : 0 : }
845 : 0 : ::com::sun::star::awt::Rectangle SAL_CALL DiagramWrapper::calculateDiagramPositionIncludingAxesAndAxisTitles( ) throw (::com::sun::star::uno::RuntimeException)
846 : : {
847 : 0 : return m_spChart2ModelContact->GetDiagramRectangleIncludingTitle();
848 : : }
849 : :
850 : : // ____ XAxisSupplier ____
851 : 80 : Reference< XAxis > SAL_CALL DiagramWrapper::getAxis( sal_Int32 nDimensionIndex )
852 : : throw (uno::RuntimeException)
853 : : {
854 : 80 : Reference< XAxis > xAxis;
855 [ + + ]: 80 : if(!nDimensionIndex)
856 : : {
857 [ + + ]: 38 : if( !m_xXAxis.is() )
858 [ + - ][ + - ]: 17 : m_xXAxis = new AxisWrapper( AxisWrapper::X_AXIS, m_spChart2ModelContact );
[ + - ][ + - ]
[ + - ]
859 [ + - ]: 38 : xAxis = m_xXAxis;
860 : : }
861 [ + + ]: 42 : else if(1==nDimensionIndex)
862 : : {
863 [ + + ]: 36 : if( !m_xYAxis.is() )
864 [ + - ][ + - ]: 15 : m_xYAxis = new AxisWrapper( AxisWrapper::Y_AXIS, m_spChart2ModelContact );
[ + - ][ + - ]
[ + - ]
865 [ + - ]: 36 : xAxis = m_xYAxis;
866 : : }
867 [ + - ]: 6 : else if(2==nDimensionIndex)
868 : : {
869 [ + + ]: 6 : if( !m_xZAxis.is() )
870 [ + - ][ + - ]: 2 : m_xZAxis = new AxisWrapper( AxisWrapper::Z_AXIS, m_spChart2ModelContact );
[ + - ][ + - ]
[ + - ]
871 [ + - ]: 6 : xAxis = m_xZAxis;
872 : : }
873 : 80 : return xAxis;
874 : : }
875 : :
876 : 0 : Reference< XAxis > SAL_CALL DiagramWrapper::getSecondaryAxis( sal_Int32 nDimensionIndex )
877 : : throw (uno::RuntimeException)
878 : : {
879 : 0 : Reference< XAxis > xAxis;
880 [ # # ]: 0 : if(!nDimensionIndex)
881 : : {
882 [ # # ]: 0 : if( !m_xSecondXAxis.is() )
883 [ # # ][ # # ]: 0 : m_xSecondXAxis = new AxisWrapper( AxisWrapper::SECOND_X_AXIS, m_spChart2ModelContact );
[ # # ][ # # ]
[ # # ]
884 [ # # ]: 0 : xAxis = m_xSecondXAxis;
885 : : }
886 [ # # ]: 0 : else if(1==nDimensionIndex)
887 : : {
888 [ # # ]: 0 : if( !m_xSecondYAxis.is() )
889 [ # # ][ # # ]: 0 : m_xSecondYAxis = new AxisWrapper( AxisWrapper::SECOND_Y_AXIS, m_spChart2ModelContact );
[ # # ][ # # ]
[ # # ]
890 [ # # ]: 0 : xAxis = m_xSecondYAxis;
891 : : }
892 : 0 : return xAxis;
893 : : }
894 : :
895 : : // ____ XAxisZSupplier ____
896 : 2 : Reference< drawing::XShape > SAL_CALL DiagramWrapper::getZAxisTitle()
897 : : throw (uno::RuntimeException)
898 : : {
899 : 2 : Reference< drawing::XShape > xRet;
900 [ + - ]: 2 : Reference< XAxis > xAxis( getAxis(2) );
901 [ + - ]: 2 : if( xAxis.is() )
902 [ + - ][ + - ]: 2 : xRet = Reference< drawing::XShape >( xAxis->getAxisTitle(), uno::UNO_QUERY );
[ + - ][ + - ]
903 : 2 : return xRet;
904 : : }
905 : :
906 : 2 : Reference< beans::XPropertySet > SAL_CALL DiagramWrapper::getZMainGrid()
907 : : throw (uno::RuntimeException)
908 : : {
909 : 2 : Reference< beans::XPropertySet > xRet;
910 [ + - ]: 2 : Reference< XAxis > xAxis( getAxis(2) );
911 [ + - ]: 2 : if( xAxis.is() )
912 [ + - ][ + - ]: 2 : xRet = xAxis->getMajorGrid();
[ + - ]
913 : 2 : return xRet;
914 : : }
915 : :
916 : 2 : Reference< beans::XPropertySet > SAL_CALL DiagramWrapper::getZHelpGrid()
917 : : throw (uno::RuntimeException)
918 : : {
919 : 2 : Reference< beans::XPropertySet > xRet;
920 [ + - ]: 2 : Reference< XAxis > xAxis( getAxis(2) );
921 [ + - ]: 2 : if( xAxis.is() )
922 [ + - ][ + - ]: 2 : xRet = xAxis->getMinorGrid();
[ + - ]
923 : 2 : return xRet;
924 : : }
925 : :
926 : 2 : Reference< beans::XPropertySet > SAL_CALL DiagramWrapper::getZAxis()
927 : : throw (uno::RuntimeException)
928 : : {
929 [ - + ]: 2 : if( ! m_xZAxis.is())
930 [ # # ][ # # ]: 0 : m_xZAxis = new AxisWrapper( AxisWrapper::Z_AXIS, m_spChart2ModelContact );
[ # # ]
931 : 2 : return Reference< beans::XPropertySet >( m_xZAxis, uno::UNO_QUERY );
932 : : }
933 : :
934 : :
935 : : // ____ XTwoAxisXSupplier ____
936 : 2 : Reference< beans::XPropertySet > SAL_CALL DiagramWrapper::getSecondaryXAxis()
937 : : throw (uno::RuntimeException)
938 : : {
939 [ + - ]: 2 : if( ! m_xSecondXAxis.is())
940 [ + - ][ + - ]: 2 : m_xSecondXAxis = new AxisWrapper( AxisWrapper::SECOND_X_AXIS, m_spChart2ModelContact );
[ + - ]
941 : 2 : return Reference< beans::XPropertySet >( m_xSecondXAxis, uno::UNO_QUERY );
942 : : }
943 : :
944 : :
945 : : // ____ XAxisXSupplier (base of XTwoAxisXSupplier) ____
946 : 2 : Reference< drawing::XShape > SAL_CALL DiagramWrapper::getXAxisTitle()
947 : : throw (uno::RuntimeException)
948 : : {
949 : 2 : Reference< drawing::XShape > xRet;
950 [ + - ]: 2 : Reference< XAxis > xAxis( getAxis(0) );
951 [ + - ]: 2 : if( xAxis.is() )
952 [ + - ][ + - ]: 2 : xRet = Reference< drawing::XShape >( xAxis->getAxisTitle(), uno::UNO_QUERY );
[ + - ][ + - ]
953 : 2 : return xRet;
954 : : }
955 : :
956 : 2 : Reference< beans::XPropertySet > SAL_CALL DiagramWrapper::getXAxis()
957 : : throw (uno::RuntimeException)
958 : : {
959 [ - + ]: 2 : if( ! m_xXAxis.is())
960 [ # # ][ # # ]: 0 : m_xXAxis = new AxisWrapper( AxisWrapper::X_AXIS, m_spChart2ModelContact );
[ # # ]
961 : 2 : return Reference< beans::XPropertySet >( m_xXAxis, uno::UNO_QUERY );
962 : : }
963 : :
964 : 4 : Reference< beans::XPropertySet > SAL_CALL DiagramWrapper::getXMainGrid()
965 : : throw (uno::RuntimeException)
966 : : {
967 : 4 : Reference< beans::XPropertySet > xRet;
968 [ + - ]: 4 : Reference< XAxis > xAxis( getAxis(0) );
969 [ + - ]: 4 : if( xAxis.is() )
970 [ + - ][ + - ]: 4 : xRet = xAxis->getMajorGrid();
[ + - ]
971 : 4 : return xRet;
972 : : }
973 : :
974 : 2 : Reference< beans::XPropertySet > SAL_CALL DiagramWrapper::getXHelpGrid()
975 : : throw (uno::RuntimeException)
976 : : {
977 : 2 : Reference< beans::XPropertySet > xRet;
978 [ + - ]: 2 : Reference< XAxis > xAxis( getAxis(0) );
979 [ + - ]: 2 : if( xAxis.is() )
980 [ + - ][ + - ]: 2 : xRet = xAxis->getMinorGrid();
[ + - ]
981 : 2 : return xRet;
982 : : }
983 : :
984 : :
985 : : // ____ XTwoAxisYSupplier ____
986 : 2 : Reference< beans::XPropertySet > SAL_CALL DiagramWrapper::getSecondaryYAxis()
987 : : throw (uno::RuntimeException)
988 : : {
989 [ + - ]: 2 : if( ! m_xSecondYAxis.is())
990 [ + - ][ + - ]: 2 : m_xSecondYAxis = new AxisWrapper( AxisWrapper::SECOND_Y_AXIS, m_spChart2ModelContact );
[ + - ]
991 : 2 : return Reference< beans::XPropertySet >( m_xSecondYAxis, uno::UNO_QUERY );
992 : : }
993 : :
994 : :
995 : : // ____ XAxisYSupplier (base of XTwoAxisYSupplier) ____
996 : 2 : Reference< drawing::XShape > SAL_CALL DiagramWrapper::getYAxisTitle()
997 : : throw (uno::RuntimeException)
998 : : {
999 : 2 : Reference< drawing::XShape > xRet;
1000 [ + - ]: 2 : Reference< XAxis > xAxis( getAxis(1) );
1001 [ + - ]: 2 : if( xAxis.is() )
1002 [ + - ][ + - ]: 2 : xRet = Reference< drawing::XShape >( xAxis->getAxisTitle(), uno::UNO_QUERY );
[ + - ][ + - ]
1003 : 2 : return xRet;
1004 : : }
1005 : :
1006 : 4 : Reference< beans::XPropertySet > SAL_CALL DiagramWrapper::getYAxis()
1007 : : throw (uno::RuntimeException)
1008 : : {
1009 [ + + ]: 4 : if( ! m_xYAxis.is())
1010 [ + - ][ + - ]: 2 : m_xYAxis = new AxisWrapper( AxisWrapper::Y_AXIS, m_spChart2ModelContact );
[ + - ]
1011 : 4 : return Reference< beans::XPropertySet >( m_xYAxis, uno::UNO_QUERY );
1012 : : }
1013 : :
1014 : 2 : Reference< beans::XPropertySet > SAL_CALL DiagramWrapper::getYMainGrid()
1015 : : throw (uno::RuntimeException)
1016 : : {
1017 : 2 : Reference< beans::XPropertySet > xRet;
1018 [ + - ]: 2 : Reference< XAxis > xAxis( getAxis(1) );
1019 [ + - ]: 2 : if( xAxis.is() )
1020 [ + - ][ + - ]: 2 : xRet = xAxis->getMajorGrid();
[ + - ]
1021 : 2 : return xRet;
1022 : : }
1023 : :
1024 : 2 : Reference< beans::XPropertySet > SAL_CALL DiagramWrapper::getYHelpGrid()
1025 : : throw (uno::RuntimeException)
1026 : : {
1027 : 2 : Reference< beans::XPropertySet > xRet;
1028 [ + - ]: 2 : Reference< XAxis > xAxis( getAxis(1) );
1029 [ + - ]: 2 : if( xAxis.is() )
1030 [ + - ][ + - ]: 2 : xRet = xAxis->getMinorGrid();
[ + - ]
1031 : 2 : return xRet;
1032 : : }
1033 : :
1034 : : // ____ XSecondAxisTitleSupplier ____
1035 : 0 : Reference< drawing::XShape > SAL_CALL DiagramWrapper::getSecondXAxisTitle()
1036 : : throw (uno::RuntimeException)
1037 : : {
1038 : 0 : Reference< drawing::XShape > xRet;
1039 [ # # ]: 0 : Reference< XAxis > xAxis( getSecondaryAxis(0) );
1040 [ # # ]: 0 : if( xAxis.is() )
1041 [ # # ][ # # ]: 0 : xRet = Reference< drawing::XShape >( xAxis->getAxisTitle(), uno::UNO_QUERY );
[ # # ][ # # ]
1042 : 0 : return xRet;
1043 : : }
1044 : :
1045 : 0 : Reference< drawing::XShape > SAL_CALL DiagramWrapper::getSecondYAxisTitle()
1046 : : throw (uno::RuntimeException)
1047 : : {
1048 : 0 : Reference< drawing::XShape > xRet;
1049 [ # # ]: 0 : Reference< XAxis > xAxis( getSecondaryAxis(1) );
1050 [ # # ]: 0 : if( xAxis.is() )
1051 [ # # ][ # # ]: 0 : xRet = Reference< drawing::XShape >( xAxis->getAxisTitle(), uno::UNO_QUERY );
[ # # ][ # # ]
1052 : 0 : return xRet;
1053 : : }
1054 : :
1055 : : // ____ XStatisticDisplay ____
1056 : : Reference<
1057 : 2 : beans::XPropertySet > SAL_CALL DiagramWrapper::getUpBar()
1058 : : throw (uno::RuntimeException)
1059 : : {
1060 [ + - ]: 2 : if( !m_xUpBarWrapper.is() )
1061 : : {
1062 [ + - ][ + - ]: 2 : m_xUpBarWrapper = new UpDownBarWrapper( true, m_spChart2ModelContact );
[ + - ]
1063 : : }
1064 : 2 : return m_xUpBarWrapper;
1065 : : }
1066 : :
1067 : : Reference<
1068 : 2 : beans::XPropertySet > SAL_CALL DiagramWrapper::getDownBar()
1069 : : throw (uno::RuntimeException)
1070 : : {
1071 [ + - ]: 2 : if( !m_xDownBarWrapper.is() )
1072 : : {
1073 [ + - ][ + - ]: 2 : m_xDownBarWrapper = new UpDownBarWrapper( false, m_spChart2ModelContact );
[ + - ]
1074 : : }
1075 : 2 : return m_xDownBarWrapper;
1076 : : }
1077 : :
1078 : : Reference<
1079 : 2 : beans::XPropertySet > SAL_CALL DiagramWrapper::getMinMaxLine()
1080 : : throw (uno::RuntimeException)
1081 : : {
1082 [ + - ]: 2 : if( !m_xMinMaxLineWrapper.is() )
1083 : : {
1084 [ + - ][ + - ]: 2 : m_xMinMaxLineWrapper = new MinMaxLineWrapper( m_spChart2ModelContact );
[ + - ]
1085 : : }
1086 : 2 : return m_xMinMaxLineWrapper;
1087 : : }
1088 : :
1089 : : // ____ X3DDisplay ____
1090 : 28 : Reference< beans::XPropertySet > SAL_CALL DiagramWrapper::getWall()
1091 : : throw (uno::RuntimeException)
1092 : : {
1093 [ + + ]: 28 : if( !m_xWall.is() )
1094 : : {
1095 [ + - ][ + - ]: 15 : m_xWall = new WallFloorWrapper( true, m_spChart2ModelContact );
[ + - ]
1096 : : }
1097 : 28 : return m_xWall;
1098 : : }
1099 : :
1100 : : Reference<
1101 : 24 : beans::XPropertySet > SAL_CALL DiagramWrapper::getFloor()
1102 : : throw (uno::RuntimeException)
1103 : : {
1104 [ + + ]: 24 : if( !m_xFloor.is() )
1105 : : {
1106 [ + - ][ + - ]: 13 : m_xFloor = new WallFloorWrapper( false, m_spChart2ModelContact );
[ + - ]
1107 : : }
1108 : 24 : return m_xFloor;
1109 : : }
1110 : :
1111 : : // ____ X3DDefaultSetter ____
1112 : 0 : void SAL_CALL DiagramWrapper::set3DSettingsToDefault()
1113 : : throw (uno::RuntimeException)
1114 : : {
1115 [ # # ][ # # ]: 0 : Reference< X3DDefaultSetter > x3DDefaultSetter( m_spChart2ModelContact->getChart2Diagram(), uno::UNO_QUERY );
1116 [ # # ]: 0 : if( x3DDefaultSetter.is() )
1117 [ # # ][ # # ]: 0 : x3DDefaultSetter->set3DSettingsToDefault();
1118 : 0 : }
1119 : :
1120 : 0 : void SAL_CALL DiagramWrapper::setDefaultRotation()
1121 : : throw (uno::RuntimeException)
1122 : : {
1123 [ # # ][ # # ]: 0 : Reference< X3DDefaultSetter > x3DDefaultSetter( m_spChart2ModelContact->getChart2Diagram(), uno::UNO_QUERY );
1124 [ # # ]: 0 : if( x3DDefaultSetter.is() )
1125 [ # # ][ # # ]: 0 : x3DDefaultSetter->setDefaultRotation();
1126 : 0 : }
1127 : :
1128 : 0 : void SAL_CALL DiagramWrapper::setDefaultIllumination()
1129 : : throw (uno::RuntimeException)
1130 : : {
1131 [ # # ][ # # ]: 0 : Reference< X3DDefaultSetter > x3DDefaultSetter( m_spChart2ModelContact->getChart2Diagram(), uno::UNO_QUERY );
1132 [ # # ]: 0 : if( x3DDefaultSetter.is() )
1133 [ # # ][ # # ]: 0 : x3DDefaultSetter->setDefaultIllumination();
1134 : 0 : }
1135 : :
1136 : : // ____ XComponent ____
1137 : 54 : void SAL_CALL DiagramWrapper::dispose()
1138 : : throw (uno::RuntimeException)
1139 : : {
1140 [ + - ][ + - ]: 54 : m_aEventListenerContainer.disposeAndClear( lang::EventObject( static_cast< ::cppu::OWeakObject* >( this )));
[ + - ][ + - ]
1141 : :
1142 [ + - ][ + - ]: 54 : MutexGuard aGuard( GetMutex());
1143 : :
1144 [ + - ]: 54 : DisposeHelper::DisposeAndClear( m_xXAxis );
1145 [ + - ]: 54 : DisposeHelper::DisposeAndClear( m_xYAxis );
1146 [ + - ]: 54 : DisposeHelper::DisposeAndClear( m_xZAxis );
1147 [ + - ]: 54 : DisposeHelper::DisposeAndClear( m_xSecondXAxis );
1148 [ + - ]: 54 : DisposeHelper::DisposeAndClear( m_xSecondYAxis );
1149 [ + - ]: 54 : DisposeHelper::DisposeAndClear( m_xWall );
1150 [ + - ]: 54 : DisposeHelper::DisposeAndClear( m_xFloor );
1151 [ + - ]: 54 : DisposeHelper::DisposeAndClear( m_xMinMaxLineWrapper );
1152 [ + - ]: 54 : DisposeHelper::DisposeAndClear( m_xUpBarWrapper );
1153 [ + - ]: 54 : DisposeHelper::DisposeAndClear( m_xDownBarWrapper );
1154 : :
1155 [ + - ][ + - ]: 54 : clearWrappedPropertySet();
1156 : 54 : }
1157 : :
1158 : 0 : void SAL_CALL DiagramWrapper::addEventListener(
1159 : : const Reference< lang::XEventListener >& xListener )
1160 : : throw (uno::RuntimeException)
1161 : : {
1162 : 0 : m_aEventListenerContainer.addInterface( xListener );
1163 : 0 : }
1164 : :
1165 : 0 : void SAL_CALL DiagramWrapper::removeEventListener(
1166 : : const Reference< lang::XEventListener >& aListener )
1167 : : throw (uno::RuntimeException)
1168 : : {
1169 : 0 : m_aEventListenerContainer.removeInterface( aListener );
1170 : 0 : }
1171 : :
1172 : : //-----------------------------------------------------------------------------------------------------------------
1173 : :
1174 : : //PROP_DIAGRAM_DATAROW_SOURCE
1175 : : class WrappedDataRowSourceProperty : public WrappedProperty
1176 : : {
1177 : : public:
1178 : : WrappedDataRowSourceProperty( ::boost::shared_ptr< Chart2ModelContact > spChart2ModelContact );
1179 : : virtual ~WrappedDataRowSourceProperty();
1180 : :
1181 : : virtual void setPropertyValue( const ::com::sun::star::uno::Any& rOuterValue, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& xInnerPropertySet ) const
1182 : : throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
1183 : :
1184 : : virtual ::com::sun::star::uno::Any getPropertyValue( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& xInnerPropertySet ) const
1185 : : throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
1186 : :
1187 : : virtual ::com::sun::star::uno::Any getPropertyDefault( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyState >& xInnerPropertyState ) const
1188 : : throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
1189 : :
1190 : : private: //member
1191 : : ::boost::shared_ptr< Chart2ModelContact > m_spChart2ModelContact;
1192 : : mutable Any m_aOuterValue;
1193 : : };
1194 : :
1195 : 33 : WrappedDataRowSourceProperty::WrappedDataRowSourceProperty( ::boost::shared_ptr< Chart2ModelContact > spChart2ModelContact )
1196 : : : WrappedProperty("DataRowSource",OUString())
1197 : : , m_spChart2ModelContact( spChart2ModelContact )
1198 [ + - ][ + - ]: 33 : , m_aOuterValue()
1199 : : {
1200 [ + - ][ + - ]: 33 : m_aOuterValue = WrappedDataRowSourceProperty::getPropertyDefault( 0 );
1201 : 33 : }
1202 : :
1203 [ + - ]: 33 : WrappedDataRowSourceProperty::~WrappedDataRowSourceProperty()
1204 : : {
1205 [ - + ]: 66 : }
1206 : :
1207 : 14 : void WrappedDataRowSourceProperty::setPropertyValue( const Any& rOuterValue, const Reference< beans::XPropertySet >& /*xInnerPropertySet*/ ) const
1208 : : throw (beans::UnknownPropertyException, beans::PropertyVetoException, lang::IllegalArgumentException, lang::WrappedTargetException, uno::RuntimeException)
1209 : : {
1210 : 14 : ::com::sun::star::chart::ChartDataRowSource eChartDataRowSource = ::com::sun::star::chart::ChartDataRowSource_ROWS;
1211 [ + - ][ - + ]: 14 : if( ! (rOuterValue >>= eChartDataRowSource) )
1212 : : {
1213 : 0 : sal_Int32 nNew = ::com::sun::star::chart::ChartDataRowSource_ROWS;
1214 [ # # ]: 0 : if( !(rOuterValue >>= nNew) )
1215 [ # # ][ # # ]: 0 : throw lang::IllegalArgumentException( "Property DataRowSource requires ::com::sun::star::chart::ChartDataRowSource value", 0, 0 );
1216 : : else
1217 : 0 : eChartDataRowSource = ::com::sun::star::chart::ChartDataRowSource(nNew);
1218 : : }
1219 : :
1220 : 14 : m_aOuterValue = rOuterValue;
1221 : :
1222 : 14 : bool bNewUseColumns = eChartDataRowSource == ::com::sun::star::chart::ChartDataRowSource_COLUMNS;
1223 : :
1224 : 14 : ::rtl::OUString aRangeString;
1225 : 14 : bool bUseColumns = true;
1226 : 14 : bool bFirstCellAsLabel = true;
1227 : 14 : bool bHasCategories = true;
1228 [ + - ]: 14 : uno::Sequence< sal_Int32 > aSequenceMapping;
1229 : :
1230 [ + - + - ]: 28 : if( DataSourceHelper::detectRangeSegmentation(
1231 : : m_spChart2ModelContact->getChartModel(), aRangeString, aSequenceMapping, bUseColumns
1232 [ + - ]: 28 : , bFirstCellAsLabel, bHasCategories ) )
1233 : : {
1234 [ + + ]: 14 : if( bUseColumns != bNewUseColumns )
1235 : : {
1236 [ + - ]: 2 : aSequenceMapping.realloc(0);
1237 : : DataSourceHelper::setRangeSegmentation(
1238 [ + - ][ + - ]: 2 : m_spChart2ModelContact->getChartModel(), aSequenceMapping, bNewUseColumns , bHasCategories, bFirstCellAsLabel );
1239 : : }
1240 [ + - ]: 14 : }
1241 : 14 : }
1242 : :
1243 : 28 : Any WrappedDataRowSourceProperty::getPropertyValue( const Reference< beans::XPropertySet >& /*xInnerPropertySet*/ ) const
1244 : : throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
1245 : : {
1246 : 28 : ::rtl::OUString aRangeString;
1247 : 28 : bool bUseColumns = true;
1248 : 28 : bool bFirstCellAsLabel = true;
1249 : 28 : bool bHasCategories = true;
1250 [ + - ]: 28 : uno::Sequence< sal_Int32 > aSequenceMapping;
1251 : :
1252 [ + - + - ]: 56 : if( DataSourceHelper::detectRangeSegmentation(
1253 : : m_spChart2ModelContact->getChartModel(), aRangeString, aSequenceMapping, bUseColumns
1254 [ + - ]: 56 : , bFirstCellAsLabel, bHasCategories ) )
1255 : : {
1256 : 28 : ::com::sun::star::chart::ChartDataRowSource eChartDataRowSource = ::com::sun::star::chart::ChartDataRowSource_ROWS;
1257 [ + + ]: 28 : if(bUseColumns)
1258 : 26 : eChartDataRowSource = ::com::sun::star::chart::ChartDataRowSource_COLUMNS;
1259 : :
1260 [ + - ]: 28 : m_aOuterValue <<= eChartDataRowSource;
1261 : : }
1262 : :
1263 [ + - ]: 28 : return m_aOuterValue;
1264 : : }
1265 : :
1266 : 51 : Any WrappedDataRowSourceProperty::getPropertyDefault( const Reference< beans::XPropertyState >& /*xInnerPropertyState*/ ) const
1267 : : throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
1268 : : {
1269 : 51 : Any aRet;
1270 [ + - ]: 51 : aRet <<= ::com::sun::star::chart::ChartDataRowSource_COLUMNS;
1271 : 51 : return aRet;
1272 : : }
1273 : :
1274 : : //-----------------------------------------------------------------------------------------------------------------
1275 : :
1276 : : //PROP_DIAGRAM_STACKED
1277 : : //PROP_DIAGRAM_DEEP
1278 : : //PROP_DIAGRAM_PERCENT_STACKED
1279 : : class WrappedStackingProperty : public WrappedProperty
1280 : : {
1281 : : public:
1282 : : WrappedStackingProperty( StackMode eStackMode, ::boost::shared_ptr< Chart2ModelContact > spChart2ModelContact );
1283 : : virtual ~WrappedStackingProperty();
1284 : :
1285 : : virtual void setPropertyValue( const ::com::sun::star::uno::Any& rOuterValue, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& xInnerPropertySet ) const
1286 : : throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
1287 : :
1288 : : virtual ::com::sun::star::uno::Any getPropertyValue( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& xInnerPropertySet ) const
1289 : : throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
1290 : :
1291 : : virtual ::com::sun::star::uno::Any getPropertyDefault( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyState >& xInnerPropertyState ) const
1292 : : throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
1293 : :
1294 : : protected: //methods
1295 : : bool detectInnerValue( StackMode& eInnerStackMode ) const;
1296 : :
1297 : : private: //member
1298 : : ::boost::shared_ptr< Chart2ModelContact > m_spChart2ModelContact;
1299 : : const StackMode m_eStackMode;
1300 : : mutable Any m_aOuterValue;
1301 : : };
1302 : :
1303 : 99 : WrappedStackingProperty::WrappedStackingProperty( StackMode eStackMode, ::boost::shared_ptr< Chart2ModelContact > spChart2ModelContact )
1304 : : : WrappedProperty(OUString(),OUString())
1305 : : , m_spChart2ModelContact( spChart2ModelContact )
1306 : : , m_eStackMode( eStackMode )
1307 [ + - ][ + - ]: 99 : , m_aOuterValue()
1308 : : {
1309 [ + + + - ]: 99 : switch( m_eStackMode )
1310 : : {
1311 : : case StackMode_Y_STACKED:
1312 : 33 : m_aOuterName = "Stacked";
1313 : 33 : break;
1314 : : case StackMode_Y_STACKED_PERCENT:
1315 : 33 : m_aOuterName = "Percent";
1316 : 33 : break;
1317 : : case StackMode_Z_STACKED:
1318 : 33 : m_aOuterName = "Deep";
1319 : 33 : break;
1320 : : default:
1321 : : OSL_FAIL( "unexpected stack mode" );
1322 : 0 : break;
1323 : : }
1324 : 99 : }
1325 : :
1326 [ + - ]: 99 : WrappedStackingProperty::~WrappedStackingProperty()
1327 : : {
1328 [ - + ]: 198 : }
1329 : :
1330 : 144 : bool WrappedStackingProperty::detectInnerValue( StackMode& eStackMode ) const
1331 : : {
1332 : 144 : bool bHasDetectableInnerValue = false;
1333 : 144 : bool bIsAmbiguous = false;
1334 : : eStackMode = DiagramHelper::getStackMode( m_spChart2ModelContact->getChart2Diagram()
1335 [ + - ][ + - ]: 144 : , bHasDetectableInnerValue, bIsAmbiguous );
1336 : 144 : return bHasDetectableInnerValue;
1337 : : }
1338 : :
1339 : 18 : void WrappedStackingProperty::setPropertyValue( const Any& rOuterValue, const Reference< beans::XPropertySet >& /*xInnerPropertySet*/ ) const
1340 : : throw (beans::UnknownPropertyException, beans::PropertyVetoException, lang::IllegalArgumentException, lang::WrappedTargetException, uno::RuntimeException)
1341 : : {
1342 : 18 : sal_Bool bNewValue = false;
1343 [ - + ]: 18 : if( ! (rOuterValue >>= bNewValue) )
1344 [ # # ][ # # ]: 0 : throw lang::IllegalArgumentException( "Stacking Properties require boolean values", 0, 0 );
1345 : :
1346 : : StackMode eInnerStackMode;
1347 [ + - ]: 18 : bool bHasDetectableInnerValue = detectInnerValue( eInnerStackMode );
1348 : :
1349 [ + + ]: 18 : if( !bHasDetectableInnerValue )
1350 : : {
1351 : 6 : m_aOuterValue = rOuterValue;
1352 : : return;
1353 : : }
1354 : :
1355 [ + + ][ + - ]: 12 : if( bNewValue && eInnerStackMode == m_eStackMode )
1356 : : return;
1357 [ + + ][ + + ]: 12 : if( !bNewValue && eInnerStackMode != m_eStackMode )
1358 : : return;
1359 : :
1360 [ + - ]: 6 : Reference< chart2::XDiagram > xDiagram( m_spChart2ModelContact->getChart2Diagram() );
1361 [ + - ]: 6 : if( xDiagram.is() )
1362 : : {
1363 [ + + ]: 6 : StackMode eNewStackMode = bNewValue ? m_eStackMode : StackMode_NONE;
1364 [ + - ]: 6 : DiagramHelper::setStackMode( xDiagram, eNewStackMode );
1365 : 18 : }
1366 : : }
1367 : :
1368 : 126 : Any WrappedStackingProperty::getPropertyValue( const Reference< beans::XPropertySet >& /*xInnerPropertySet*/ ) const
1369 : : throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
1370 : : {
1371 : : StackMode eInnerStackMode;
1372 [ + - ][ + + ]: 126 : if( detectInnerValue( eInnerStackMode ) )
1373 : : {
1374 : 108 : sal_Bool bValue = (eInnerStackMode == m_eStackMode);
1375 : 108 : Any aAny;
1376 [ + - ]: 108 : aAny <<= bValue;
1377 : 108 : return aAny;
1378 : : }
1379 : 126 : return m_aOuterValue;
1380 : : }
1381 : :
1382 : 54 : Any WrappedStackingProperty::getPropertyDefault( const Reference< beans::XPropertyState >& /*xInnerPropertyState*/ ) const
1383 : : throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
1384 : : {
1385 : 54 : Any aRet;
1386 [ + - ]: 54 : aRet <<= sal_Bool( sal_False );
1387 : 54 : return aRet;
1388 : : }
1389 : :
1390 : : //-----------------------------------------------------------------------------------------------------------------
1391 : :
1392 : : //PROP_DIAGRAM_THREE_D
1393 : : class WrappedDim3DProperty : public WrappedProperty
1394 : : {
1395 : : public:
1396 : : WrappedDim3DProperty( ::boost::shared_ptr< Chart2ModelContact > spChart2ModelContact );
1397 : : virtual ~WrappedDim3DProperty();
1398 : :
1399 : : virtual void setPropertyValue( const ::com::sun::star::uno::Any& rOuterValue, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& xInnerPropertySet ) const
1400 : : throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
1401 : :
1402 : : virtual ::com::sun::star::uno::Any getPropertyValue( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& xInnerPropertySet ) const
1403 : : throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
1404 : :
1405 : : virtual ::com::sun::star::uno::Any getPropertyDefault( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyState >& xInnerPropertyState ) const
1406 : : throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
1407 : :
1408 : : private: //member
1409 : : ::boost::shared_ptr< Chart2ModelContact > m_spChart2ModelContact;
1410 : : mutable Any m_aOuterValue;
1411 : : };
1412 : :
1413 : 33 : WrappedDim3DProperty::WrappedDim3DProperty( ::boost::shared_ptr< Chart2ModelContact > spChart2ModelContact )
1414 : : : WrappedProperty("Dim3D",OUString())
1415 : : , m_spChart2ModelContact( spChart2ModelContact )
1416 [ + - ][ + - ]: 33 : , m_aOuterValue()
1417 : : {
1418 [ + - ][ + - ]: 33 : m_aOuterValue = WrappedDim3DProperty::getPropertyDefault( 0 );
1419 : 33 : }
1420 : :
1421 [ + - ]: 33 : WrappedDim3DProperty::~WrappedDim3DProperty()
1422 : : {
1423 [ - + ]: 66 : }
1424 : :
1425 : 20 : void WrappedDim3DProperty::setPropertyValue( const Any& rOuterValue, const Reference< beans::XPropertySet >& /*xInnerPropertySet*/ ) const
1426 : : throw (beans::UnknownPropertyException, beans::PropertyVetoException, lang::IllegalArgumentException, lang::WrappedTargetException, uno::RuntimeException)
1427 : : {
1428 : 20 : sal_Bool bNew3D = false;
1429 [ - + ]: 20 : if( ! (rOuterValue >>= bNew3D) )
1430 [ # # ][ # # ]: 0 : throw lang::IllegalArgumentException( "Property Dim3D requires boolean value", 0, 0 );
1431 : :
1432 : 20 : m_aOuterValue = rOuterValue;
1433 : :
1434 [ + - ]: 20 : Reference< chart2::XDiagram > xDiagram( m_spChart2ModelContact->getChart2Diagram() );
1435 [ - + ]: 20 : if( !xDiagram.is() )
1436 : 20 : return;
1437 : :
1438 [ + - ]: 20 : sal_Bool bOld3D = DiagramHelper::getDimension( xDiagram ) == 3;
1439 [ + + ]: 20 : if( bOld3D != bNew3D )
1440 [ + + ][ + - ]: 20 : DiagramHelper::setDimension( xDiagram, bNew3D ? 3 : 2 );
[ + - ]
1441 : : }
1442 : :
1443 : 37 : Any WrappedDim3DProperty::getPropertyValue( const Reference< beans::XPropertySet >& /*xInnerPropertySet*/ ) const
1444 : : throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
1445 : : {
1446 [ + - ]: 37 : Reference< chart2::XDiagram > xDiagram( m_spChart2ModelContact->getChart2Diagram() );
1447 [ + - ]: 37 : if( xDiagram.is() )
1448 : : {
1449 [ + - ]: 37 : sal_Bool b3D = DiagramHelper::getDimension( xDiagram ) == 3;
1450 [ + - ]: 37 : m_aOuterValue <<= b3D;
1451 : : }
1452 : 37 : return m_aOuterValue;
1453 : : }
1454 : :
1455 : 51 : Any WrappedDim3DProperty::getPropertyDefault( const Reference< beans::XPropertyState >& /*xInnerPropertyState*/ ) const
1456 : : throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
1457 : : {
1458 : 51 : Any aRet;
1459 [ + - ]: 51 : aRet <<= sal_Bool( sal_False );
1460 : 51 : return aRet;
1461 : : }
1462 : :
1463 : : //-----------------------------------------------------------------------------------------------------------------
1464 : :
1465 : : //PROP_DIAGRAM_VERTICAL
1466 : : class WrappedVerticalProperty : public WrappedProperty
1467 : : {
1468 : : public:
1469 : : WrappedVerticalProperty( ::boost::shared_ptr< Chart2ModelContact > spChart2ModelContact );
1470 : : virtual ~WrappedVerticalProperty();
1471 : :
1472 : : virtual void setPropertyValue( const ::com::sun::star::uno::Any& rOuterValue, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& xInnerPropertySet ) const
1473 : : throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
1474 : :
1475 : : virtual ::com::sun::star::uno::Any getPropertyValue( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& xInnerPropertySet ) const
1476 : : throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
1477 : :
1478 : : virtual ::com::sun::star::uno::Any getPropertyDefault( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyState >& xInnerPropertyState ) const
1479 : : throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
1480 : :
1481 : : private: //member
1482 : : ::boost::shared_ptr< Chart2ModelContact > m_spChart2ModelContact;
1483 : : mutable Any m_aOuterValue;
1484 : : };
1485 : :
1486 : 33 : WrappedVerticalProperty::WrappedVerticalProperty( ::boost::shared_ptr< Chart2ModelContact > spChart2ModelContact )
1487 : : : WrappedProperty("Vertical",OUString())
1488 : : , m_spChart2ModelContact( spChart2ModelContact )
1489 [ + - ][ + - ]: 33 : , m_aOuterValue()
1490 : : {
1491 [ + - ][ + - ]: 33 : m_aOuterValue = WrappedVerticalProperty::getPropertyDefault( 0 );
1492 : 33 : }
1493 : :
1494 [ + - ]: 33 : WrappedVerticalProperty::~WrappedVerticalProperty()
1495 : : {
1496 [ - + ]: 66 : }
1497 : :
1498 : 10 : void WrappedVerticalProperty::setPropertyValue( const Any& rOuterValue, const Reference< beans::XPropertySet >& /*xInnerPropertySet*/ ) const
1499 : : throw (beans::UnknownPropertyException, beans::PropertyVetoException, lang::IllegalArgumentException, lang::WrappedTargetException, uno::RuntimeException)
1500 : : {
1501 : 10 : sal_Bool bNewVertical = false;
1502 [ - + ]: 10 : if( ! (rOuterValue >>= bNewVertical) )
1503 [ # # ][ # # ]: 0 : throw lang::IllegalArgumentException( "Property Vertical requires boolean value", 0, 0 );
1504 : :
1505 : 10 : m_aOuterValue = rOuterValue;
1506 : :
1507 [ + - ]: 10 : Reference< chart2::XDiagram > xDiagram( m_spChart2ModelContact->getChart2Diagram() );
1508 [ - + ]: 10 : if( !xDiagram.is() )
1509 : 10 : return;
1510 : :
1511 : 10 : bool bFound = false;
1512 : 10 : bool bAmbiguous = false;
1513 [ + - ]: 10 : sal_Bool bOldVertical = DiagramHelper::getVertical( xDiagram, bFound, bAmbiguous );
1514 [ + - ][ + + ]: 10 : if( bFound && ( bOldVertical != bNewVertical || bAmbiguous ) )
[ - + ]
1515 [ + - ][ + - ]: 10 : DiagramHelper::setVertical( xDiagram, bNewVertical );
1516 : : }
1517 : :
1518 : 22 : Any WrappedVerticalProperty::getPropertyValue( const Reference< beans::XPropertySet >& /*xInnerPropertySet*/ ) const
1519 : : throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
1520 : : {
1521 : 22 : bool bFound = false;
1522 : 22 : bool bAmbiguous = false;
1523 [ + - ]: 22 : Reference< chart2::XDiagram > xDiagram( m_spChart2ModelContact->getChart2Diagram() );
1524 [ + - ]: 22 : if( xDiagram.is() )
1525 : : {
1526 [ + - ]: 22 : sal_Bool bVertical = DiagramHelper::getVertical( xDiagram, bFound, bAmbiguous );
1527 [ + - ]: 22 : if( bFound )
1528 [ + - ]: 22 : m_aOuterValue <<= bVertical;
1529 : : }
1530 : 22 : return m_aOuterValue;
1531 : : }
1532 : :
1533 : 51 : Any WrappedVerticalProperty::getPropertyDefault( const Reference< beans::XPropertyState >& /*xInnerPropertyState*/ ) const
1534 : : throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
1535 : : {
1536 : 51 : Any aRet;
1537 [ + - ]: 51 : aRet <<= sal_Bool( sal_False );
1538 : 51 : return aRet;
1539 : : }
1540 : :
1541 : : //-----------------------------------------------------------------------------------------------------------------
1542 : :
1543 : : //PROP_DIAGRAM_NUMBER_OF_LINES
1544 : : class WrappedNumberOfLinesProperty : public WrappedProperty
1545 : : {
1546 : : public:
1547 : : WrappedNumberOfLinesProperty( ::boost::shared_ptr< Chart2ModelContact > spChart2ModelContact );
1548 : : virtual ~WrappedNumberOfLinesProperty();
1549 : :
1550 : : virtual void setPropertyValue( const ::com::sun::star::uno::Any& rOuterValue, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& xInnerPropertySet ) const
1551 : : throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
1552 : :
1553 : : virtual ::com::sun::star::uno::Any getPropertyValue( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& xInnerPropertySet ) const
1554 : : throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
1555 : :
1556 : : virtual ::com::sun::star::uno::Any getPropertyDefault( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyState >& xInnerPropertyState ) const
1557 : : throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
1558 : :
1559 : : protected: //methods
1560 : : bool detectInnerValue( uno::Any& rInnerValue ) const;
1561 : :
1562 : : private: //member
1563 : : ::boost::shared_ptr< Chart2ModelContact > m_spChart2ModelContact;
1564 : : mutable Any m_aOuterValue;
1565 : : };
1566 : :
1567 : 33 : WrappedNumberOfLinesProperty::WrappedNumberOfLinesProperty( ::boost::shared_ptr< Chart2ModelContact > spChart2ModelContact )
1568 : : : WrappedProperty("NumberOfLines",OUString())
1569 : : , m_spChart2ModelContact( spChart2ModelContact )
1570 [ + - ][ + - ]: 33 : , m_aOuterValue( this->getPropertyDefault(0) )
[ + - ][ + - ]
1571 : : {
1572 : 33 : }
1573 : :
1574 [ + - ]: 33 : WrappedNumberOfLinesProperty::~WrappedNumberOfLinesProperty()
1575 : : {
1576 [ - + ]: 66 : }
1577 : :
1578 : 28 : bool WrappedNumberOfLinesProperty::detectInnerValue( uno::Any& rInnerValue ) const
1579 : : {
1580 : 28 : sal_Int32 nNumberOfLines = 0;
1581 : 28 : bool bHasDetectableInnerValue = false;
1582 [ + - ]: 28 : Reference< chart2::XDiagram > xDiagram( m_spChart2ModelContact->getChart2Diagram() );
1583 [ + - ]: 28 : uno::Reference< chart2::XChartDocument > xChartDoc( m_spChart2ModelContact->getChart2Document() );
1584 [ + - ][ + - ]: 28 : if( xDiagram.is() && xChartDoc.is() )
[ + - ]
1585 : : {
1586 : : ::std::vector< uno::Reference< chart2::XDataSeries > > aSeriesVector(
1587 [ + - ]: 28 : DiagramHelper::getDataSeriesFromDiagram( xDiagram ) );
1588 [ + + ]: 28 : if( aSeriesVector.size() > 0 )
1589 : : {
1590 [ + - ][ + - ]: 22 : Reference< lang::XMultiServiceFactory > xFact( xChartDoc->getChartTypeManager(), uno::UNO_QUERY );
[ + - ]
1591 : : DiagramHelper::tTemplateWithServiceName aTemplateAndService =
1592 [ + - ]: 22 : DiagramHelper::getTemplateForDiagram( xDiagram, xFact );
1593 [ - + ]: 22 : if( aTemplateAndService.second == "com.sun.star.chart2.template.ColumnWithLine" )
1594 : : {
1595 : : try
1596 : : {
1597 [ # # ]: 0 : uno::Reference< beans::XPropertySet > xProp( aTemplateAndService.first, uno::UNO_QUERY );
1598 [ # # ][ # # ]: 0 : xProp->getPropertyValue( m_aOuterName ) >>= nNumberOfLines;
1599 [ # # ]: 0 : bHasDetectableInnerValue = true;
1600 : : }
1601 [ # # ]: 0 : catch( const uno::Exception & ex )
1602 : : {
1603 : : ASSERT_EXCEPTION( ex );
1604 : : }
1605 [ + - ]: 22 : }
1606 : 28 : }
1607 : : }
1608 [ - + ]: 28 : if(bHasDetectableInnerValue)
1609 [ # # ]: 0 : rInnerValue = uno::makeAny(nNumberOfLines);
1610 : 28 : return bHasDetectableInnerValue;
1611 : : }
1612 : :
1613 : 8 : void WrappedNumberOfLinesProperty::setPropertyValue( const Any& rOuterValue, const Reference< beans::XPropertySet >& /*xInnerPropertySet*/ ) const
1614 : : throw (beans::UnknownPropertyException, beans::PropertyVetoException, lang::IllegalArgumentException, lang::WrappedTargetException, uno::RuntimeException)
1615 : : {
1616 : : sal_Int32 nNewValue;
1617 [ - + ]: 8 : if( ! (rOuterValue >>= nNewValue) )
1618 [ # # ][ # # ]: 0 : throw lang::IllegalArgumentException( "property NumberOfLines requires sal_Int32 value", 0, 0 );
1619 : :
1620 : 8 : m_aOuterValue = rOuterValue;
1621 : :
1622 [ + - ]: 8 : uno::Reference< chart2::XChartDocument > xChartDoc( m_spChart2ModelContact->getChart2Document() );
1623 [ + - ]: 8 : Reference< chart2::XDiagram > xDiagram( m_spChart2ModelContact->getChart2Diagram() );
1624 [ + - ]: 8 : sal_Int32 nDimension = ::chart::DiagramHelper::getDimension( xDiagram );
1625 [ + - ][ + - ]: 8 : if( xChartDoc.is() && xDiagram.is() && nDimension == 2 )
[ + - ][ + - ]
1626 : : {
1627 [ + - ][ + - ]: 8 : Reference< lang::XMultiServiceFactory > xFact( xChartDoc->getChartTypeManager(), uno::UNO_QUERY );
[ + - ]
1628 : : DiagramHelper::tTemplateWithServiceName aTemplateAndService =
1629 [ + - ]: 8 : DiagramHelper::getTemplateForDiagram( xDiagram, xFact );
1630 : :
1631 [ + - ]: 8 : uno::Reference< chart2::XChartTypeTemplate > xTemplate(0);
1632 [ - + ]: 8 : if( aTemplateAndService.second == "com.sun.star.chart2.template.ColumnWithLine" )
1633 : : {
1634 [ # # ]: 0 : if( nNewValue != 0 )
1635 : : {
1636 [ # # ]: 0 : xTemplate.set( aTemplateAndService.first );
1637 : : try
1638 : : {
1639 : 0 : sal_Int32 nOldValue = 0;
1640 [ # # ]: 0 : uno::Reference< beans::XPropertySet > xProp( xTemplate, uno::UNO_QUERY );
1641 [ # # ][ # # ]: 0 : xProp->getPropertyValue( m_aOuterName ) >>= nOldValue;
1642 [ # # ]: 0 : if( nOldValue == nNewValue )
1643 [ # # ][ # # ]: 0 : return;
1644 : : }
1645 [ # # ]: 0 : catch( const uno::Exception & ex )
1646 : : {
1647 : : ASSERT_EXCEPTION( ex );
1648 : : }
1649 : : }
1650 : : else
1651 : : {
1652 [ # # ][ # # ]: 0 : xTemplate.set( xFact->createInstance("com.sun.star.chart2.template.Column"), uno::UNO_QUERY );
[ # # ]
1653 : : }
1654 : : }
1655 [ + + ]: 8 : else if( aTemplateAndService.second == "com.sun.star.chart2.template.Column" )
1656 : : {
1657 [ + - ]: 6 : if( nNewValue == 0 )
1658 : : return;
1659 [ # # ][ # # ]: 0 : xTemplate.set( xFact->createInstance( "com.sun.star.chart2.template.ColumnWithLine" ), uno::UNO_QUERY );
[ # # ]
1660 : : }
1661 : :
1662 [ - + ]: 2 : if(xTemplate.is())
1663 : : {
1664 : : try
1665 : : {
1666 : : // locked controllers
1667 [ # # ][ # # ]: 0 : ControllerLockGuard aCtrlLockGuard( m_spChart2ModelContact->getChartModel() );
1668 [ # # ]: 0 : uno::Reference< beans::XPropertySet > xProp( xTemplate, uno::UNO_QUERY );
1669 [ # # ][ # # ]: 0 : xProp->setPropertyValue( "NumberOfLines", uno::makeAny(nNewValue) );
[ # # ]
1670 [ # # ][ # # ]: 2 : xTemplate->changeDiagram( xDiagram );
[ # # ][ # # ]
1671 : : }
1672 [ # # ]: 0 : catch( const uno::Exception & ex )
1673 : : {
1674 : : ASSERT_EXCEPTION( ex );
1675 : : }
1676 [ + + ][ + - ]: 8 : }
[ + + ][ + + ]
1677 [ + + ][ + + ]: 8 : }
1678 : : }
1679 : :
1680 : 28 : Any WrappedNumberOfLinesProperty::getPropertyValue( const Reference< beans::XPropertySet >& /*xInnerPropertySet*/ ) const
1681 : : throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
1682 : : {
1683 : 28 : Any aRet;
1684 [ + - ][ + - ]: 28 : if( !detectInnerValue( aRet ) )
1685 : 28 : aRet = m_aOuterValue;
1686 : 28 : return aRet;
1687 : : }
1688 : :
1689 : 51 : Any WrappedNumberOfLinesProperty::getPropertyDefault( const Reference< beans::XPropertyState >& /*xInnerPropertyState*/ ) const
1690 : : throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
1691 : : {
1692 : 51 : Any aRet;
1693 [ + - ]: 51 : aRet <<= sal_Int32( 0 );
1694 : 51 : return aRet;
1695 : : }
1696 : :
1697 : : //-----------------------------------------------------------------------------------------------------------------
1698 : :
1699 : : //PROP_DIAGRAM_ATTRIBUTED_DATA_POINTS
1700 : : class WrappedAttributedDataPointsProperty : public WrappedProperty
1701 : : {
1702 : : public:
1703 : : WrappedAttributedDataPointsProperty( ::boost::shared_ptr< Chart2ModelContact > spChart2ModelContact );
1704 : : virtual ~WrappedAttributedDataPointsProperty();
1705 : :
1706 : : virtual void setPropertyValue( const ::com::sun::star::uno::Any& rOuterValue, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& xInnerPropertySet ) const
1707 : : throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
1708 : :
1709 : : virtual ::com::sun::star::uno::Any getPropertyValue( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& xInnerPropertySet ) const
1710 : : throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
1711 : :
1712 : : virtual ::com::sun::star::uno::Any getPropertyDefault( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyState >& xInnerPropertyState ) const
1713 : : throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
1714 : :
1715 : : private: //member
1716 : : ::boost::shared_ptr< Chart2ModelContact > m_spChart2ModelContact;
1717 : : mutable Any m_aOuterValue;
1718 : : };
1719 : :
1720 : 33 : WrappedAttributedDataPointsProperty::WrappedAttributedDataPointsProperty( ::boost::shared_ptr< Chart2ModelContact > spChart2ModelContact )
1721 : : : WrappedProperty("AttributedDataPoints",OUString())
1722 : : , m_spChart2ModelContact( spChart2ModelContact )
1723 [ + - ][ + - ]: 33 : , m_aOuterValue()
1724 : : {
1725 [ + - ][ + - ]: 33 : m_aOuterValue = WrappedAttributedDataPointsProperty::getPropertyDefault( 0 );
1726 : 33 : }
1727 : :
1728 [ + - ]: 33 : WrappedAttributedDataPointsProperty::~WrappedAttributedDataPointsProperty()
1729 : : {
1730 [ - + ]: 66 : }
1731 : :
1732 : 0 : void WrappedAttributedDataPointsProperty::setPropertyValue( const Any& rOuterValue, const Reference< beans::XPropertySet >& /*xInnerPropertySet*/ ) const
1733 : : throw (beans::UnknownPropertyException, beans::PropertyVetoException, lang::IllegalArgumentException, lang::WrappedTargetException, uno::RuntimeException)
1734 : : {
1735 [ # # ]: 0 : uno::Sequence< uno::Sequence< sal_Int32 > > aNewValue;
1736 [ # # ][ # # ]: 0 : if( ! (rOuterValue >>= aNewValue) )
1737 [ # # ][ # # ]: 0 : throw lang::IllegalArgumentException( "Property AttributedDataPoints requires value of type uno::Sequence< uno::Sequence< sal_Int32 > >", 0, 0 );
1738 : :
1739 : 0 : m_aOuterValue = rOuterValue;
1740 : :
1741 [ # # ]: 0 : Reference< chart2::XDiagram > xDiagram( m_spChart2ModelContact->getChart2Diagram() );
1742 [ # # ]: 0 : Reference< beans::XPropertySet > xDiaProp( xDiagram, uno::UNO_QUERY );
1743 : :
1744 [ # # ][ # # ]: 0 : if( xDiagram.is() && xDiaProp.is())
[ # # ]
1745 : : {
1746 : : ::std::vector< Reference< chart2::XDataSeries > > aSeriesVector(
1747 [ # # ]: 0 : ::chart::DiagramHelper::getDataSeriesFromDiagram( xDiagram ) );
1748 : :
1749 [ # # ]: 0 : uno::Sequence< uno::Sequence< sal_Int32 > > aResult( aSeriesVector.size() );
1750 : :
1751 : : ::std::vector< Reference< chart2::XDataSeries > >::const_iterator aIt =
1752 [ # # ]: 0 : aSeriesVector.begin();
1753 : 0 : sal_Int32 i = 0;
1754 [ # # ][ # # ]: 0 : for( ; aIt != aSeriesVector.end(); ++aIt, ++i )
1755 : : {
1756 [ # # ]: 0 : Reference< beans::XPropertySet > xProp( *aIt, uno::UNO_QUERY );
1757 [ # # ]: 0 : if( xProp.is())
1758 : : {
1759 : 0 : uno::Any aVal;
1760 [ # # ]: 0 : if( i < aNewValue.getLength() )
1761 [ # # ][ # # ]: 0 : aVal <<= aNewValue[i];
1762 : : else
1763 : : {
1764 : : //set empty sequence
1765 [ # # ]: 0 : uno::Sequence< sal_Int32 > aSeq;
1766 [ # # ][ # # ]: 0 : aVal <<= aSeq;
1767 : : }
1768 [ # # ][ # # ]: 0 : xProp->setPropertyValue( "AttributedDataPoints", aVal );
1769 : : }
1770 [ # # ]: 0 : }
1771 [ # # ]: 0 : }
1772 : 0 : }
1773 : :
1774 : 0 : Any WrappedAttributedDataPointsProperty::getPropertyValue( const Reference< beans::XPropertySet >& /*xInnerPropertySet*/ ) const
1775 : : throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
1776 : : {
1777 [ # # ]: 0 : Reference< chart2::XDiagram > xDiagram( m_spChart2ModelContact->getChart2Diagram() );
1778 [ # # ]: 0 : Reference< beans::XPropertySet > xDiaProp( xDiagram, uno::UNO_QUERY );
1779 : :
1780 [ # # ][ # # ]: 0 : if( xDiagram.is() && xDiaProp.is())
[ # # ]
1781 : : {
1782 : : ::std::vector< Reference< chart2::XDataSeries > > aSeriesVector(
1783 [ # # ]: 0 : ::chart::DiagramHelper::getDataSeriesFromDiagram( xDiagram ) );
1784 : :
1785 [ # # ]: 0 : uno::Sequence< uno::Sequence< sal_Int32 > > aResult( aSeriesVector.size() );
1786 : :
1787 : : ::std::vector< Reference< chart2::XDataSeries > >::const_iterator aIt =
1788 [ # # ]: 0 : aSeriesVector.begin();
1789 : 0 : sal_Int32 i = 0;
1790 [ # # ][ # # ]: 0 : for( ; aIt != aSeriesVector.end(); ++aIt, ++i )
1791 : : {
1792 [ # # ]: 0 : Reference< beans::XPropertySet > xProp( *aIt, uno::UNO_QUERY );
1793 [ # # ]: 0 : if( xProp.is())
1794 : : {
1795 : : uno::Any aVal(
1796 [ # # ][ # # ]: 0 : xProp->getPropertyValue("AttributedDataPoints"));
1797 [ # # ]: 0 : uno::Sequence< sal_Int32 > aSeq;
1798 [ # # ][ # # ]: 0 : if( aVal >>= aSeq )
1799 [ # # ][ # # ]: 0 : aResult[ i ] = aSeq;
[ # # ]
1800 : : }
1801 : 0 : }
1802 [ # # ][ # # ]: 0 : m_aOuterValue <<= aResult;
1803 : : }
1804 : 0 : return m_aOuterValue;
1805 : : }
1806 : :
1807 : 33 : Any WrappedAttributedDataPointsProperty::getPropertyDefault( const Reference< beans::XPropertyState >& /*xInnerPropertyState*/ ) const
1808 : : throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
1809 : : {
1810 : 33 : Any aRet;
1811 [ + - ]: 33 : uno::Sequence< uno::Sequence< sal_Int32 > > aSeq;
1812 [ + - ]: 33 : aRet <<= aSeq;
1813 [ + - ]: 33 : return aRet;
1814 : : }
1815 : :
1816 : : //-----------------------------------------------------------------------------------------------------------------
1817 : :
1818 : : //PROP_DIAGRAM_SOLIDTYPE
1819 : : class WrappedSolidTypeProperty : public WrappedProperty
1820 : : {
1821 : : public:
1822 : : WrappedSolidTypeProperty( ::boost::shared_ptr< Chart2ModelContact > spChart2ModelContact );
1823 : : virtual ~WrappedSolidTypeProperty();
1824 : :
1825 : : virtual void setPropertyValue( const ::com::sun::star::uno::Any& rOuterValue, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& xInnerPropertySet ) const
1826 : : throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
1827 : :
1828 : : virtual ::com::sun::star::uno::Any getPropertyValue( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& xInnerPropertySet ) const
1829 : : throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
1830 : :
1831 : : virtual ::com::sun::star::uno::Any getPropertyDefault( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyState >& xInnerPropertyState ) const
1832 : : throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
1833 : :
1834 : : private: //member
1835 : : ::boost::shared_ptr< Chart2ModelContact > m_spChart2ModelContact;
1836 : : mutable Any m_aOuterValue;
1837 : : };
1838 : :
1839 : 33 : WrappedSolidTypeProperty::WrappedSolidTypeProperty( ::boost::shared_ptr< Chart2ModelContact > spChart2ModelContact )
1840 : : : WrappedProperty( "SolidType", OUString() )
1841 : : , m_spChart2ModelContact( spChart2ModelContact )
1842 [ + - ][ + - ]: 33 : , m_aOuterValue()
1843 : : {
1844 [ + - ][ + - ]: 33 : m_aOuterValue = WrappedSolidTypeProperty::getPropertyDefault( 0 );
1845 : 33 : }
1846 : :
1847 [ + - ]: 33 : WrappedSolidTypeProperty::~WrappedSolidTypeProperty()
1848 : : {
1849 [ - + ]: 66 : }
1850 : :
1851 : 2 : void WrappedSolidTypeProperty::setPropertyValue( const Any& rOuterValue, const Reference< beans::XPropertySet >& /*xInnerPropertySet*/ ) const
1852 : : throw (beans::UnknownPropertyException, beans::PropertyVetoException, lang::IllegalArgumentException, lang::WrappedTargetException, uno::RuntimeException)
1853 : : {
1854 : 2 : sal_Int32 nNewSolidType = ::com::sun::star::chart::ChartSolidType::RECTANGULAR_SOLID;
1855 [ - + ]: 2 : if( ! (rOuterValue >>= nNewSolidType) )
1856 [ # # ][ # # ]: 0 : throw lang::IllegalArgumentException( "Property SolidType requires integer value", 0, 0 );
1857 : :
1858 : 2 : m_aOuterValue = rOuterValue;
1859 : :
1860 [ + - ]: 2 : Reference< chart2::XDiagram > xDiagram( m_spChart2ModelContact->getChart2Diagram() );
1861 [ - + ]: 2 : if( !xDiagram.is() )
1862 : 2 : return;
1863 : :
1864 : 2 : bool bFound = false;
1865 : 2 : bool bAmbiguous = false;
1866 [ + - ]: 2 : sal_Int32 nOldSolidType = DiagramHelper::getGeometry3D( xDiagram, bFound, bAmbiguous );
1867 [ + - ][ - + ]: 2 : if( bFound && ( nOldSolidType != nNewSolidType || bAmbiguous ) )
[ # # ]
1868 [ + - ][ + - ]: 2 : DiagramHelper::setGeometry3D( xDiagram, nNewSolidType );
1869 : : }
1870 : :
1871 : 22 : Any WrappedSolidTypeProperty::getPropertyValue( const Reference< beans::XPropertySet >& /*xInnerPropertySet*/ ) const
1872 : : throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
1873 : : {
1874 : 22 : bool bFound = false;
1875 : 22 : bool bAmbiguous = false;
1876 [ + - ]: 22 : Reference< chart2::XDiagram > xDiagram( m_spChart2ModelContact->getChart2Diagram() );
1877 [ + - ]: 22 : if( xDiagram.is() )
1878 : : {
1879 [ + - ]: 22 : sal_Int32 nGeometry = DiagramHelper::getGeometry3D( xDiagram, bFound, bAmbiguous );
1880 [ + - ]: 22 : if( bFound )
1881 [ + - ]: 22 : m_aOuterValue <<= nGeometry;
1882 : : }
1883 : 22 : return m_aOuterValue;
1884 : : }
1885 : :
1886 : 51 : Any WrappedSolidTypeProperty::getPropertyDefault( const Reference< beans::XPropertyState >& /*xInnerPropertyState*/ ) const
1887 : : throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
1888 : : {
1889 : 51 : return uno::makeAny( ::com::sun::star::chart::ChartSolidType::RECTANGULAR_SOLID );
1890 : : }
1891 : :
1892 : : //-----------------------------------------------------------------------------------------------------------------
1893 : :
1894 : : class WrappedAutomaticSizeProperty : public WrappedProperty
1895 : : {
1896 : : public:
1897 : : WrappedAutomaticSizeProperty();
1898 : : virtual ~WrappedAutomaticSizeProperty();
1899 : :
1900 : : virtual void setPropertyValue( const ::com::sun::star::uno::Any& rOuterValue, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& xInnerPropertySet ) const
1901 : : throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
1902 : :
1903 : : virtual ::com::sun::star::uno::Any getPropertyValue( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& xInnerPropertySet ) const
1904 : : throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
1905 : :
1906 : : virtual ::com::sun::star::uno::Any getPropertyDefault( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyState >& xInnerPropertyState ) const
1907 : : throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
1908 : : };
1909 : :
1910 : 33 : WrappedAutomaticSizeProperty::WrappedAutomaticSizeProperty()
1911 [ + - ]: 33 : : WrappedProperty( "AutomaticSize", OUString() )
1912 : : {
1913 : 33 : }
1914 : :
1915 : 33 : WrappedAutomaticSizeProperty::~WrappedAutomaticSizeProperty()
1916 : : {
1917 [ - + ]: 66 : }
1918 : :
1919 : 0 : void WrappedAutomaticSizeProperty::setPropertyValue( const Any& rOuterValue, const Reference< beans::XPropertySet >& xInnerPropertySet ) const
1920 : : throw (beans::UnknownPropertyException, beans::PropertyVetoException, lang::IllegalArgumentException, lang::WrappedTargetException, uno::RuntimeException)
1921 : : {
1922 [ # # ]: 0 : if( xInnerPropertySet.is() )
1923 : : {
1924 : 0 : bool bNewValue = true;
1925 [ # # ]: 0 : if( ! (rOuterValue >>= bNewValue) )
1926 [ # # ][ # # ]: 0 : throw lang::IllegalArgumentException( "Property AutomaticSize requires value of type boolean", 0, 0 );
1927 : :
1928 : : try
1929 : : {
1930 [ # # ]: 0 : if( bNewValue )
1931 : : {
1932 [ # # ][ # # ]: 0 : Any aRelativeSize( xInnerPropertySet->getPropertyValue( "RelativeSize" ) );
1933 [ # # ]: 0 : if( aRelativeSize.hasValue() )
1934 [ # # ][ # # ]: 0 : xInnerPropertySet->setPropertyValue( "RelativeSize", Any() );
[ # # ]
1935 : : }
1936 : : }
1937 [ # # ]: 0 : catch( const uno::Exception & ex )
1938 : : {
1939 : : ASSERT_EXCEPTION( ex );
1940 : : }
1941 : : }
1942 : 0 : }
1943 : :
1944 : 36 : Any WrappedAutomaticSizeProperty::getPropertyValue( const Reference< beans::XPropertySet >& xInnerPropertySet ) const
1945 : : throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
1946 : : {
1947 [ + - ]: 36 : Any aRet( getPropertyDefault( Reference< beans::XPropertyState >( xInnerPropertySet, uno::UNO_QUERY ) ) );
1948 [ + - ]: 36 : if( xInnerPropertySet.is() )
1949 : : {
1950 [ + - ][ + - ]: 36 : Any aRelativeSize( xInnerPropertySet->getPropertyValue( "RelativeSize" ) );
1951 [ + - ]: 36 : if( !aRelativeSize.hasValue() )
1952 [ + - ]: 36 : aRet <<= true;
1953 : : }
1954 : 36 : return aRet;
1955 : : }
1956 : :
1957 : 54 : Any WrappedAutomaticSizeProperty::getPropertyDefault( const Reference< beans::XPropertyState >& /*xInnerPropertyState*/ ) const
1958 : : throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
1959 : : {
1960 : 54 : Any aRet;
1961 [ + - ]: 54 : aRet <<= false;
1962 : 54 : return aRet;
1963 : : }
1964 : :
1965 : : //-----------------------------------------------------------------------------------------------------------------
1966 : :
1967 : : //PROP_DIAGRAM_INCLUDE_HIDDEN_CELLS
1968 : : class WrappedIncludeHiddenCellsProperty : public WrappedProperty
1969 : : {
1970 : : public:
1971 : : WrappedIncludeHiddenCellsProperty( ::boost::shared_ptr< Chart2ModelContact > spChart2ModelContact );
1972 : : virtual ~WrappedIncludeHiddenCellsProperty();
1973 : :
1974 : : virtual void setPropertyValue( const ::com::sun::star::uno::Any& rOuterValue, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& xInnerPropertySet ) const
1975 : : throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
1976 : :
1977 : : private: //member
1978 : : ::boost::shared_ptr< Chart2ModelContact > m_spChart2ModelContact;
1979 : : };
1980 : :
1981 : 33 : WrappedIncludeHiddenCellsProperty::WrappedIncludeHiddenCellsProperty( ::boost::shared_ptr< Chart2ModelContact > spChart2ModelContact )
1982 : : : WrappedProperty("IncludeHiddenCells","IncludeHiddenCells")
1983 [ + - ][ + - ]: 33 : , m_spChart2ModelContact( spChart2ModelContact )
1984 : : {
1985 : 33 : }
1986 : :
1987 [ + - ]: 33 : WrappedIncludeHiddenCellsProperty::~WrappedIncludeHiddenCellsProperty()
1988 : : {
1989 [ - + ]: 66 : }
1990 : :
1991 : 6 : void WrappedIncludeHiddenCellsProperty::setPropertyValue( const Any& rOuterValue, const Reference< beans::XPropertySet >& /*xInnerPropertySet*/ ) const
1992 : : throw (beans::UnknownPropertyException, beans::PropertyVetoException, lang::IllegalArgumentException, lang::WrappedTargetException, uno::RuntimeException)
1993 : : {
1994 : 6 : sal_Bool bNewValue = false;
1995 [ - + ]: 6 : if( ! (rOuterValue >>= bNewValue) )
1996 [ # # ][ # # ]: 0 : throw lang::IllegalArgumentException( "Property Dim3D requires boolean value", 0, 0 );
1997 : :
1998 [ + - ][ + - ]: 6 : ChartModelHelper::setIncludeHiddenCells( bNewValue, m_spChart2ModelContact->getChartModel() );
1999 : 6 : }
2000 : :
2001 : : //-----------------------------------------------------------------------------------------------------------------
2002 : :
2003 : : // ____ XDiagramProvider ____
2004 : 1379 : Reference< chart2::XDiagram > SAL_CALL DiagramWrapper::getDiagram()
2005 : : throw (uno::RuntimeException)
2006 : : {
2007 : 1379 : return m_spChart2ModelContact->getChart2Diagram();
2008 : : }
2009 : :
2010 : 0 : void SAL_CALL DiagramWrapper::setDiagram(
2011 : : const Reference< chart2::XDiagram >& /*xDiagram*/ )
2012 : : throw (uno::RuntimeException)
2013 : : {
2014 : : //@todo: remove this method from interface
2015 : : OSL_FAIL("DiagramWrapper::setDiagram is not implemented, should be removed and not be called" );
2016 : 0 : }
2017 : :
2018 : : // ================================================================================
2019 : :
2020 : 2025 : Reference< beans::XPropertySet > DiagramWrapper::getInnerPropertySet()
2021 : : {
2022 [ + - ]: 2025 : return Reference< beans::XPropertySet >( m_spChart2ModelContact->getChart2Diagram(), uno::UNO_QUERY );
2023 : : }
2024 : :
2025 : 33 : const Sequence< beans::Property >& DiagramWrapper::getPropertySequence()
2026 : : {
2027 : 33 : return *StaticDiagramWrapperPropertyArray::get();
2028 : : }
2029 : :
2030 : 33 : const std::vector< WrappedProperty* > DiagramWrapper::createWrappedProperties()
2031 : : {
2032 : 33 : ::std::vector< ::chart::WrappedProperty* > aWrappedProperties;
2033 : :
2034 [ + - ][ + - ]: 33 : WrappedAxisAndGridExistenceProperties::addWrappedProperties( aWrappedProperties, m_spChart2ModelContact );
[ + - ]
2035 [ + - ][ + - ]: 33 : WrappedAxisTitleExistenceProperties::addWrappedProperties( aWrappedProperties, m_spChart2ModelContact );
[ + - ]
2036 [ + - ][ + - ]: 33 : WrappedAxisLabelExistenceProperties::addWrappedProperties( aWrappedProperties, m_spChart2ModelContact );
[ + - ]
2037 [ + - ][ + - ]: 33 : WrappedSceneProperty::addWrappedProperties( aWrappedProperties, m_spChart2ModelContact );
[ + - ]
2038 [ + - ]: 33 : WrappedIgnoreProperties::addIgnoreFillProperties( aWrappedProperties );
2039 [ + - ]: 33 : WrappedIgnoreProperties::addIgnoreLineProperties( aWrappedProperties );
2040 [ + - ][ + - ]: 33 : WrappedStatisticProperties::addWrappedPropertiesForDiagram( aWrappedProperties, m_spChart2ModelContact );
[ + - ]
2041 [ + - ][ + - ]: 33 : WrappedSymbolProperties::addWrappedPropertiesForDiagram( aWrappedProperties, m_spChart2ModelContact );
[ + - ]
2042 [ + - ][ + - ]: 33 : WrappedDataCaptionProperties::addWrappedPropertiesForDiagram( aWrappedProperties, m_spChart2ModelContact );
[ + - ]
2043 [ + - ][ + - ]: 33 : WrappedSplineProperties::addWrappedProperties( aWrappedProperties, m_spChart2ModelContact );
[ + - ]
2044 [ + - ][ + - ]: 33 : WrappedStockProperties::addWrappedProperties( aWrappedProperties, m_spChart2ModelContact );
[ + - ]
2045 [ + - ]: 33 : WrappedAutomaticPositionProperties::addWrappedProperties( aWrappedProperties );
2046 : :
2047 [ + - ][ + - ]: 33 : aWrappedProperties.push_back( new WrappedDataRowSourceProperty( m_spChart2ModelContact ) );
[ + - ][ + - ]
[ + - ]
2048 [ + - ][ + - ]: 33 : aWrappedProperties.push_back( new WrappedStackingProperty( StackMode_Y_STACKED,m_spChart2ModelContact ) );
[ + - ][ + - ]
[ + - ]
2049 [ + - ][ + - ]: 33 : aWrappedProperties.push_back( new WrappedStackingProperty( StackMode_Y_STACKED_PERCENT, m_spChart2ModelContact ) );
[ + - ][ + - ]
[ + - ]
2050 [ + - ][ + - ]: 33 : aWrappedProperties.push_back( new WrappedStackingProperty( StackMode_Z_STACKED, m_spChart2ModelContact ) );
[ + - ][ + - ]
[ + - ]
2051 [ + - ][ + - ]: 33 : aWrappedProperties.push_back( new WrappedDim3DProperty( m_spChart2ModelContact ) );
[ + - ][ + - ]
[ + - ]
2052 [ + - ][ + - ]: 33 : aWrappedProperties.push_back( new WrappedVerticalProperty( m_spChart2ModelContact ) );
[ + - ][ + - ]
[ + - ]
2053 [ + - ][ + - ]: 33 : aWrappedProperties.push_back( new WrappedNumberOfLinesProperty( m_spChart2ModelContact ) );
[ + - ][ + - ]
[ + - ]
2054 [ + - ][ + - ]: 33 : aWrappedProperties.push_back( new WrappedAttributedDataPointsProperty( m_spChart2ModelContact ) );
[ + - ][ + - ]
[ + - ]
2055 [ + - ][ + - ]: 33 : aWrappedProperties.push_back( new WrappedProperty( "StackedBarsConnected", "ConnectBars" ) );
[ + - ]
2056 [ + - ][ + - ]: 33 : aWrappedProperties.push_back( new WrappedSolidTypeProperty( m_spChart2ModelContact ) );
[ + - ][ + - ]
[ + - ]
2057 [ + - ][ + - ]: 33 : aWrappedProperties.push_back( new WrappedAutomaticSizeProperty() );
[ + - ]
2058 [ + - ][ + - ]: 33 : aWrappedProperties.push_back( new WrappedIncludeHiddenCellsProperty( m_spChart2ModelContact ) );
[ + - ][ + - ]
[ + - ]
2059 : :
2060 : 33 : return aWrappedProperties;
2061 : : }
2062 : :
2063 : : // ================================================================================
2064 : :
2065 : 2 : uno::Sequence< OUString > DiagramWrapper::getSupportedServiceNames_Static()
2066 : : {
2067 : 2 : uno::Sequence< OUString > aServices( 8 );
2068 [ + - ]: 2 : aServices[ 0 ] = "com.sun.star.chart.Diagram";
2069 [ + - ]: 2 : aServices[ 1 ] = "com.sun.star.xml.UserDefinedAttributeSupplier";
2070 [ + - ]: 2 : aServices[ 2 ] = "com.sun.star.chart.StackableDiagram";
2071 [ + - ]: 2 : aServices[ 3 ] = "com.sun.star.chart.ChartAxisXSupplier";
2072 [ + - ]: 2 : aServices[ 4 ] = "com.sun.star.chart.ChartAxisYSupplier";
2073 [ + - ]: 2 : aServices[ 5 ] = "com.sun.star.chart.ChartAxisZSupplier";
2074 [ + - ]: 2 : aServices[ 6 ] = "com.sun.star.chart.ChartTwoAxisXSupplier";
2075 [ + - ]: 2 : aServices[ 7 ] = "com.sun.star.chart.ChartTwoAxisYSupplier";
2076 : :
2077 : 2 : return aServices;
2078 : : }
2079 : :
2080 : : // implement XServiceInfo methods basing upon getSupportedServiceNames_Static
2081 [ # # ][ # # ]: 2 : APPHELPER_XSERVICEINFO_IMPL( DiagramWrapper, lcl_aServiceName );
[ # # ][ # # ]
[ # # ]
2082 : :
2083 : : } // namespace wrapper
2084 [ + - ][ + - ]: 48 : } // namespace chart
2085 : :
2086 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|