1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: DiagramWrapper.cxx,v $
10 * $Revision: 1.17.32.3 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 // MARKER(update_precomp.py): autogen include statement, do not remove
32 #include "precompiled_chart2.hxx"
33 #include "DiagramWrapper.hxx"
35 #include "servicenames_charttypes.hxx"
36 #include "TitleWrapper.hxx"
37 #include "DataSeriesPointWrapper.hxx"
38 #include "AxisWrapper.hxx"
39 #include "AxisHelper.hxx"
40 #include "Chart2ModelContact.hxx"
41 #include "PositionAndSizeHelper.hxx"
42 #include "TitleHelper.hxx"
43 #include "GridWrapper.hxx"
44 #include "WallFloorWrapper.hxx"
45 #include "MinMaxLineWrapper.hxx"
46 #include "UpDownBarWrapper.hxx"
47 #include "DiagramHelper.hxx"
48 #include "DataSourceHelper.hxx"
49 #include "ChartModelHelper.hxx"
50 #include "WrappedIgnoreProperty.hxx"
51 #include "WrappedAxisAndGridExistenceProperties.hxx"
52 #include "WrappedStatisticProperties.hxx"
53 #include "WrappedSymbolProperties.hxx"
54 #include "WrappedDataCaptionProperties.hxx"
55 #include "WrappedSplineProperties.hxx"
56 #include "WrappedStockProperties.hxx"
57 #include "WrappedSceneProperty.hxx"
58 #include "RelativePositionHelper.hxx"
59 #include "ContainerHelper.hxx"
60 #include "ControllerLockGuard.hxx"
61 #include "ModifyListenerHelper.hxx"
62 #include "DisposeHelper.hxx"
63 #include <comphelper/InlineContainer.hxx>
64 #include "WrappedAutomaticPositionProperties.hxx"
66 #include <com/sun/star/beans/PropertyAttribute.hpp>
67 #include <com/sun/star/chart2/XTitled.hpp>
68 #include <com/sun/star/chart/ChartDataRowSource.hpp>
69 #include <com/sun/star/chart2/RelativeSize.hpp>
70 #include <com/sun/star/chart2/RelativePosition.hpp>
71 #include <com/sun/star/chart/ChartSolidType.hpp>
73 #include "LineProperties.hxx"
74 #include "FillProperties.hxx"
75 #include "UserDefinedProperties.hxx"
76 #include "SceneProperties.hxx"
80 #include <rtl/ustrbuf.hxx>
81 // header for define DBG_ERROR
82 #include <tools/debug.hxx>
83 #include <com/sun/star/lang/XServiceName.hpp>
84 #include <com/sun/star/util/XRefreshable.hpp>
86 using namespace ::com::sun::star
;
87 using namespace ::chart::wrapper
;
89 using ::com::sun::star::uno::Reference
;
90 using ::com::sun::star::uno::Any
;
91 using ::com::sun::star::uno::Sequence
;
92 using ::com::sun::star::beans::Property
;
93 using ::osl::MutexGuard
;
94 using ::rtl::OUString
;
98 static const OUString
lcl_aServiceName(
99 RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.chart.Diagram" ));
103 PROP_DIAGRAM_ATTRIBUTED_DATA_POINTS
,
104 PROP_DIAGRAM_PERCENT_STACKED
,
105 PROP_DIAGRAM_STACKED
,
106 PROP_DIAGRAM_THREE_D
,
107 PROP_DIAGRAM_SOLIDTYPE
,
109 PROP_DIAGRAM_VERTICAL
,
110 PROP_DIAGRAM_NUMBER_OF_LINES
,
111 PROP_DIAGRAM_STACKED_BARS_CONNECTED
,
112 PROP_DIAGRAM_DATAROW_SOURCE
,
114 PROP_DIAGRAM_GROUP_BARS_PER_AXIS
,
115 PROP_DIAGRAM_INCLUDE_HIDDEN_CELLS
,
117 PROP_DIAGRAM_SORT_BY_X_VALUES
,
119 PROP_DIAGRAM_STARTING_ANGLE
,
121 PROP_DIAGRAM_RIGHT_ANGLED_AXES
,
122 PROP_DIAGRAM_PERSPECTIVE
,
123 PROP_DIAGRAM_ROTATION_HORIZONTAL
,
124 PROP_DIAGRAM_ROTATION_VERTICAL
,
126 PROP_DIAGRAM_MISSING_VALUE_TREATMENT
,
128 PROP_DIAGRAM_HAS_X_AXIS
,
129 PROP_DIAGRAM_HAS_X_AXIS_DESCR
,
130 PROP_DIAGRAM_HAS_X_AXIS_TITLE
,
131 PROP_DIAGRAM_HAS_X_AXIS_GRID
,
132 PROP_DIAGRAM_HAS_X_AXIS_HELP_GRID
,
134 PROP_DIAGRAM_HAS_Y_AXIS
,
135 PROP_DIAGRAM_HAS_Y_AXIS_DESCR
,
136 PROP_DIAGRAM_HAS_Y_AXIS_TITLE
,
137 PROP_DIAGRAM_HAS_Y_AXIS_GRID
,
138 PROP_DIAGRAM_HAS_Y_AXIS_HELP_GRID
,
140 PROP_DIAGRAM_HAS_Z_AXIS
,
141 PROP_DIAGRAM_HAS_Z_AXIS_DESCR
,
142 PROP_DIAGRAM_HAS_Z_AXIS_TITLE
,
143 PROP_DIAGRAM_HAS_Z_AXIS_GRID
,
144 PROP_DIAGRAM_HAS_Z_AXIS_HELP_GRID
,
146 PROP_DIAGRAM_HAS_SECOND_X_AXIS
,
147 PROP_DIAGRAM_HAS_SECOND_X_AXIS_DESCR
,
149 PROP_DIAGRAM_HAS_SECOND_Y_AXIS
,
150 PROP_DIAGRAM_HAS_SECOND_Y_AXIS_DESCR
,
152 PROP_DIAGRAM_HAS_SECOND_X_AXIS_TITLE
,
153 PROP_DIAGRAM_HAS_SECOND_Y_AXIS_TITLE
,
155 PROP_DIAGRAM_AUTOMATIC_SIZE
158 void lcl_AddPropertiesToVector(
159 ::std::vector
< Property
> & rOutProperties
)
161 rOutProperties
.push_back(
162 Property( C2U( "AttributedDataPoints" ),
163 PROP_DIAGRAM_ATTRIBUTED_DATA_POINTS
,
164 ::getCppuType( reinterpret_cast< const uno::Sequence
< uno::Sequence
< sal_Int32
> > * >(0)),
165 beans::PropertyAttribute::BOUND
166 | beans::PropertyAttribute::MAYBEVOID
));
168 // see com.sun.star.chart.StackableDiagram
169 rOutProperties
.push_back(
170 Property( C2U( "Percent" ),
171 PROP_DIAGRAM_PERCENT_STACKED
,
172 ::getBooleanCppuType(),
173 beans::PropertyAttribute::BOUND
174 | beans::PropertyAttribute::MAYBEDEFAULT
));
175 rOutProperties
.push_back(
176 Property( C2U( "Stacked" ),
177 PROP_DIAGRAM_STACKED
,
178 ::getBooleanCppuType(),
179 beans::PropertyAttribute::BOUND
180 | beans::PropertyAttribute::MAYBEDEFAULT
));
182 rOutProperties
.push_back(
183 Property( C2U( "Dim3D" ),
184 PROP_DIAGRAM_THREE_D
,
185 ::getBooleanCppuType(),
186 beans::PropertyAttribute::BOUND
187 | beans::PropertyAttribute::MAYBEDEFAULT
));
189 // see com.sun.star.chart.Chart3DBarProperties
190 rOutProperties
.push_back(
191 Property( C2U( "SolidType" ),
192 PROP_DIAGRAM_SOLIDTYPE
,
193 ::getCppuType( reinterpret_cast< sal_Int32
* >(0)),
194 beans::PropertyAttribute::BOUND
195 | beans::PropertyAttribute::MAYBEDEFAULT
));
197 // see com.sun.star.chart.BarDiagram
198 rOutProperties
.push_back(
199 Property( C2U( "Deep" ),
201 ::getBooleanCppuType(),
202 beans::PropertyAttribute::BOUND
203 | beans::PropertyAttribute::MAYBEDEFAULT
));
204 rOutProperties
.push_back(
205 Property( C2U( "Vertical" ),
206 PROP_DIAGRAM_VERTICAL
,
207 ::getBooleanCppuType(),
208 beans::PropertyAttribute::BOUND
209 | beans::PropertyAttribute::MAYBEDEFAULT
));
210 rOutProperties
.push_back(
211 Property( C2U( "NumberOfLines" ),
212 PROP_DIAGRAM_NUMBER_OF_LINES
,
213 ::getCppuType( reinterpret_cast< const sal_Int32
* >(0)),
214 beans::PropertyAttribute::BOUND
215 | beans::PropertyAttribute::MAYBEDEFAULT
));
216 rOutProperties
.push_back(
217 Property( C2U( "StackedBarsConnected" ),
218 PROP_DIAGRAM_STACKED_BARS_CONNECTED
,
219 ::getBooleanCppuType(),
220 beans::PropertyAttribute::BOUND
221 | beans::PropertyAttribute::MAYBEDEFAULT
));
223 rOutProperties
.push_back(
224 Property( C2U( "DataRowSource" ),
225 PROP_DIAGRAM_DATAROW_SOURCE
,
226 ::getCppuType( reinterpret_cast< const ::com::sun::star::chart::ChartDataRowSource
* >(0)),
227 beans::PropertyAttribute::BOUND
228 | beans::PropertyAttribute::MAYBEDEFAULT
));
230 rOutProperties
.push_back(
231 Property( C2U( "GroupBarsPerAxis" ),
232 PROP_DIAGRAM_GROUP_BARS_PER_AXIS
,
233 ::getBooleanCppuType(),
234 beans::PropertyAttribute::BOUND
235 | beans::PropertyAttribute::MAYBEDEFAULT
));
237 rOutProperties
.push_back(
238 Property( C2U( "IncludeHiddenCells" ),
239 PROP_DIAGRAM_INCLUDE_HIDDEN_CELLS
,
240 ::getBooleanCppuType(),
241 beans::PropertyAttribute::BOUND
242 | beans::PropertyAttribute::MAYBEDEFAULT
));
245 rOutProperties
.push_back(
246 Property( C2U( "SortByXValues" ),
247 PROP_DIAGRAM_SORT_BY_X_VALUES
,
248 ::getBooleanCppuType(),
249 beans::PropertyAttribute::BOUND
250 | beans::PropertyAttribute::MAYBEDEFAULT
));
252 //for pie and donut charts
253 rOutProperties
.push_back(
254 Property( C2U( "StartingAngle" ),
255 PROP_DIAGRAM_STARTING_ANGLE
,
256 ::getCppuType( reinterpret_cast< const sal_Int32
* >(0) ),
257 beans::PropertyAttribute::BOUND
258 | beans::PropertyAttribute::MAYBEDEFAULT
));
261 rOutProperties
.push_back(
262 Property( C2U("RightAngledAxes"),
263 PROP_DIAGRAM_RIGHT_ANGLED_AXES
,
264 ::getBooleanCppuType(),
265 beans::PropertyAttribute::BOUND
266 | beans::PropertyAttribute::MAYBEDEFAULT
));
268 rOutProperties
.push_back(
269 Property( C2U("Perspective"),
270 PROP_DIAGRAM_PERSPECTIVE
,
271 ::getCppuType( reinterpret_cast< const sal_Int32
* >(0)),
272 beans::PropertyAttribute::MAYBEVOID
));
274 rOutProperties
.push_back(
275 Property( C2U("RotationHorizontal"),
276 PROP_DIAGRAM_ROTATION_HORIZONTAL
,
277 ::getCppuType( reinterpret_cast< const sal_Int32
* >(0)),
278 beans::PropertyAttribute::MAYBEVOID
));
280 rOutProperties
.push_back(
281 Property( C2U("RotationVertical"),
282 PROP_DIAGRAM_ROTATION_VERTICAL
,
283 ::getCppuType( reinterpret_cast< const sal_Int32
* >(0)),
284 beans::PropertyAttribute::MAYBEVOID
));
287 rOutProperties
.push_back(
288 Property( C2U( "HasXAxis" ),
289 PROP_DIAGRAM_HAS_X_AXIS
,
290 ::getBooleanCppuType(),
291 beans::PropertyAttribute::BOUND
292 | beans::PropertyAttribute::MAYBEDEFAULT
));
293 rOutProperties
.push_back(
294 Property( C2U( "HasXAxisDescription" ),
295 PROP_DIAGRAM_HAS_X_AXIS_DESCR
,
296 ::getBooleanCppuType(),
297 beans::PropertyAttribute::BOUND
298 | beans::PropertyAttribute::MAYBEDEFAULT
));
299 rOutProperties
.push_back(
300 Property( C2U( "HasXAxisTitle" ),
301 PROP_DIAGRAM_HAS_X_AXIS_TITLE
,
302 ::getBooleanCppuType(),
303 beans::PropertyAttribute::BOUND
304 | beans::PropertyAttribute::MAYBEDEFAULT
));
305 rOutProperties
.push_back(
306 Property( C2U( "HasXAxisGrid" ),
307 PROP_DIAGRAM_HAS_X_AXIS_GRID
,
308 ::getBooleanCppuType(),
309 beans::PropertyAttribute::BOUND
310 | beans::PropertyAttribute::MAYBEDEFAULT
));
311 rOutProperties
.push_back(
312 Property( C2U( "HasXAxisHelpGrid" ),
313 PROP_DIAGRAM_HAS_X_AXIS_HELP_GRID
,
314 ::getBooleanCppuType(),
315 beans::PropertyAttribute::BOUND
316 | beans::PropertyAttribute::MAYBEDEFAULT
));
319 rOutProperties
.push_back(
320 Property( C2U( "HasYAxis" ),
321 PROP_DIAGRAM_HAS_Y_AXIS
,
322 ::getBooleanCppuType(),
323 beans::PropertyAttribute::BOUND
324 | beans::PropertyAttribute::MAYBEDEFAULT
));
325 rOutProperties
.push_back(
326 Property( C2U( "HasYAxisDescription" ),
327 PROP_DIAGRAM_HAS_Y_AXIS_DESCR
,
328 ::getBooleanCppuType(),
329 beans::PropertyAttribute::BOUND
330 | beans::PropertyAttribute::MAYBEDEFAULT
));
331 rOutProperties
.push_back(
332 Property( C2U( "HasYAxisTitle" ),
333 PROP_DIAGRAM_HAS_Y_AXIS_TITLE
,
334 ::getBooleanCppuType(),
335 beans::PropertyAttribute::BOUND
336 | beans::PropertyAttribute::MAYBEDEFAULT
));
337 rOutProperties
.push_back(
338 Property( C2U( "HasYAxisGrid" ),
339 PROP_DIAGRAM_HAS_Y_AXIS_GRID
,
340 ::getBooleanCppuType(),
341 beans::PropertyAttribute::BOUND
342 | beans::PropertyAttribute::MAYBEDEFAULT
));
343 rOutProperties
.push_back(
344 Property( C2U( "HasYAxisHelpGrid" ),
345 PROP_DIAGRAM_HAS_Y_AXIS_HELP_GRID
,
346 ::getBooleanCppuType(),
347 beans::PropertyAttribute::BOUND
348 | beans::PropertyAttribute::MAYBEDEFAULT
));
351 rOutProperties
.push_back(
352 Property( C2U( "HasZAxis" ),
353 PROP_DIAGRAM_HAS_Z_AXIS
,
354 ::getBooleanCppuType(),
355 beans::PropertyAttribute::BOUND
356 | beans::PropertyAttribute::MAYBEDEFAULT
));
357 rOutProperties
.push_back(
358 Property( C2U( "HasZAxisDescription" ),
359 PROP_DIAGRAM_HAS_Z_AXIS_DESCR
,
360 ::getBooleanCppuType(),
361 beans::PropertyAttribute::BOUND
362 | beans::PropertyAttribute::MAYBEDEFAULT
));
363 rOutProperties
.push_back(
364 Property( C2U( "HasZAxisTitle" ),
365 PROP_DIAGRAM_HAS_Z_AXIS_TITLE
,
366 ::getBooleanCppuType(),
367 beans::PropertyAttribute::BOUND
368 | beans::PropertyAttribute::MAYBEDEFAULT
));
369 rOutProperties
.push_back(
370 Property( C2U( "HasZAxisGrid" ),
371 PROP_DIAGRAM_HAS_Z_AXIS_GRID
,
372 ::getBooleanCppuType(),
373 beans::PropertyAttribute::BOUND
374 | beans::PropertyAttribute::MAYBEDEFAULT
));
375 rOutProperties
.push_back(
376 Property( C2U( "HasZAxisHelpGrid" ),
377 PROP_DIAGRAM_HAS_Z_AXIS_HELP_GRID
,
378 ::getBooleanCppuType(),
379 beans::PropertyAttribute::BOUND
380 | beans::PropertyAttribute::MAYBEDEFAULT
));
383 rOutProperties
.push_back(
384 Property( C2U( "HasSecondaryXAxis" ),
385 PROP_DIAGRAM_HAS_SECOND_X_AXIS
,
386 ::getBooleanCppuType(),
387 beans::PropertyAttribute::BOUND
388 | beans::PropertyAttribute::MAYBEDEFAULT
));
389 rOutProperties
.push_back(
390 Property( C2U( "HasSecondaryXAxisDescription" ),
391 PROP_DIAGRAM_HAS_SECOND_X_AXIS_DESCR
,
392 ::getBooleanCppuType(),
393 beans::PropertyAttribute::BOUND
394 | beans::PropertyAttribute::MAYBEDEFAULT
));
397 rOutProperties
.push_back(
398 Property( C2U( "HasSecondaryYAxis" ),
399 PROP_DIAGRAM_HAS_SECOND_Y_AXIS
,
400 ::getBooleanCppuType(),
401 beans::PropertyAttribute::BOUND
402 | beans::PropertyAttribute::MAYBEDEFAULT
));
403 rOutProperties
.push_back(
404 Property( C2U( "HasSecondaryYAxisDescription" ),
405 PROP_DIAGRAM_HAS_SECOND_Y_AXIS_DESCR
,
406 ::getBooleanCppuType(),
407 beans::PropertyAttribute::BOUND
408 | beans::PropertyAttribute::MAYBEDEFAULT
));
410 // XSecondAxisTitleSupplier
411 rOutProperties
.push_back(
412 Property( C2U( "HasSecondaryXAxisTitle" ),
413 PROP_DIAGRAM_HAS_SECOND_X_AXIS_TITLE
,
414 ::getBooleanCppuType(),
415 beans::PropertyAttribute::BOUND
416 | beans::PropertyAttribute::MAYBEDEFAULT
));
417 rOutProperties
.push_back(
418 Property( C2U( "HasSecondaryYAxisTitle" ),
419 PROP_DIAGRAM_HAS_SECOND_Y_AXIS_TITLE
,
420 ::getBooleanCppuType(),
421 beans::PropertyAttribute::BOUND
422 | beans::PropertyAttribute::MAYBEDEFAULT
));
424 rOutProperties
.push_back(
425 Property( C2U( "MissingValueTreatment" ),
426 PROP_DIAGRAM_MISSING_VALUE_TREATMENT
,
427 ::getCppuType( reinterpret_cast< const sal_Int32
* >(0)),
428 beans::PropertyAttribute::BOUND
429 | beans::PropertyAttribute::MAYBEVOID
));
431 rOutProperties
.push_back(
432 Property( C2U( "AutomaticSize" ),
433 PROP_DIAGRAM_AUTOMATIC_SIZE
,
434 ::getBooleanCppuType(),
435 beans::PropertyAttribute::BOUND
436 | beans::PropertyAttribute::MAYBEDEFAULT
));
439 const uno::Sequence
< Property
> & lcl_GetPropertySequence()
441 static uno::Sequence
< Property
> aPropSeq
;
444 MutexGuard
aGuard( ::osl::Mutex::getGlobalMutex() );
445 if( 0 == aPropSeq
.getLength() )
448 ::std::vector
< ::com::sun::star::beans::Property
> aProperties
;
449 lcl_AddPropertiesToVector( aProperties
);
450 ::chart::LineProperties::AddPropertiesToVector( aProperties
);
451 ::chart::FillProperties::AddPropertiesToVector( aProperties
);
452 ::chart::UserDefinedProperties::AddPropertiesToVector( aProperties
);
453 ::chart::SceneProperties::AddPropertiesToVector( aProperties
);
454 WrappedStatisticProperties::addProperties( aProperties
);
455 WrappedSymbolProperties::addProperties( aProperties
);
456 WrappedDataCaptionProperties::addProperties( aProperties
);
457 WrappedSplineProperties::addProperties( aProperties
);
458 WrappedStockProperties::addProperties( aProperties
);
459 WrappedAutomaticPositionProperties::addProperties( aProperties
);
461 // and sort them for access via bsearch
462 ::std::sort( aProperties
.begin(), aProperties
.end(),
463 ::chart::PropertyNameLess() );
465 // transfer result to static Sequence
466 aPropSeq
= ::chart::ContainerHelper::ContainerToSequence( aProperties
);
472 bool lcl_isXYChart( const Reference
< chart2::XDiagram
> xDiagram
)
475 Reference
< chart2::XChartType
> xChartType( ::chart::DiagramHelper::getChartTypeByIndex( xDiagram
, 0 ) );
476 if( xChartType
.is() )
478 rtl::OUString
aChartType( xChartType
->getChartType() );
479 if( aChartType
.equalsIgnoreAsciiCase(CHART2_SERVICE_NAME_CHARTTYPE_SCATTER
) )
485 sal_Int32
lcl_getNewAPIIndexForOldAPIIndex(
486 sal_Int32 nOldAPIIndex
487 , Reference
< chart2::XDiagram
> xDiagram
)
489 sal_Int32 nNewAPIIndex
= nOldAPIIndex
;
491 if( lcl_isXYChart( xDiagram
) )
493 if( nNewAPIIndex
>= 1 )
497 ::std::vector
< uno::Reference
< chart2::XDataSeries
> > aSeriesList(
498 ::chart::DiagramHelper::getDataSeriesFromDiagram( xDiagram
) );
499 if( nNewAPIIndex
>= static_cast<sal_Int32
>(aSeriesList
.size()) )
505 typedef ::std::map
< OUString
, OUString
> tChartTypeMap
;
507 OUString
lcl_getDiagramType( const OUString
& rTemplateServiceName
)
509 const OUString
aPrefix( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.chart2.template."));
511 if( rTemplateServiceName
.match( aPrefix
))
513 const OUString
aName( rTemplateServiceName
.copy( aPrefix
.getLength()));
515 // "Area" "StackedArea" "PercentStackedArea" "ThreeDArea"
516 // "StackedThreeDArea" "PercentStackedThreeDArea"
517 if( aName
.indexOf( C2U("Area") ) != -1 )
518 return C2U( "com.sun.star.chart.AreaDiagram" );
520 // "Pie" "PieAllExploded" "ThreeDPie" "ThreeDPieAllExploded"
521 if( aName
.indexOf( C2U("Pie") ) != -1 )
522 return C2U( "com.sun.star.chart.PieDiagram" );
524 // "Column" "StackedColumn" "PercentStackedColumn" "ThreeDColumnDeep"
525 // "ThreeDColumnFlat" "StackedThreeDColumnFlat"
526 // "PercentStackedThreeDColumnFlat" "Bar" "StackedBar"
527 // "PercentStackedBar" "ThreeDBarDeep" "ThreeDBarFlat"
528 // "StackedThreeDBarFlat" "PercentStackedThreeDBarFlat" "ColumnWithLine"
529 // "StackedColumnWithLine"
530 if( aName
.indexOf( C2U("Column") ) != -1 || aName
.indexOf( C2U("Bar") ) != -1 )
531 return C2U( "com.sun.star.chart.BarDiagram" );
533 // "Donut" "DonutAllExploded" "ThreeDDonut" "ThreeDDonutAllExploded"
534 if( aName
.indexOf( C2U("Donut") ) != -1 )
535 return C2U( "com.sun.star.chart.DonutDiagram" );
537 // "ScatterLineSymbol" "ScatterLine" "ScatterSymbol" "ThreeDScatter"
538 if( aName
.indexOf( C2U("Scatter") ) != -1 )
539 return C2U( "com.sun.star.chart.XYDiagram" );
541 // "FilledNet" "StackedFilledNet" "PercentStackedFilledNet"
542 if( aName
.indexOf( C2U("FilledNet") ) != -1 )
543 return C2U( "com.sun.star.chart.FilledNetDiagram" );
545 // "Net" "NetSymbol" "NetLine" "StackedNet" "StackedNetSymbol"
546 // "StackedNetLine" "PercentStackedNet" "PercentStackedNetSymbol"
547 // "PercentStackedNetLine"
548 if( aName
.indexOf( C2U("Net") ) != -1 )
549 return C2U( "com.sun.star.chart.NetDiagram" );
551 // "StockLowHighClose" "StockOpenLowHighClose" "StockVolumeLowHighClose"
552 // "StockVolumeOpenLowHighClose"
553 if( aName
.indexOf( C2U("Stock") ) != -1 )
554 return C2U( "com.sun.star.chart.StockDiagram" );
556 if( aName
.indexOf( C2U("Bubble") ) != -1 )
557 return C2U( "com.sun.star.chart.BubbleDiagram" );
559 // Note: this must be checked after Bar, Net and Scatter
561 // "Symbol" "StackedSymbol" "PercentStackedSymbol" "Line" "StackedLine"
562 // "PercentStackedLine" "LineSymbol" "StackedLineSymbol"
563 // "PercentStackedLineSymbol" "ThreeDLine" "StackedThreeDLine"
564 // "PercentStackedThreeDLine" "ThreeDLineDeep"
565 if( aName
.indexOf( C2U("Line") ) != -1 || aName
.indexOf( C2U("Symbol") ) != -1 )
566 return C2U( "com.sun.star.chart.LineDiagram" );
568 OSL_ENSURE( false, "unknown template" );
574 typedef ::comphelper::MakeMap
< ::rtl::OUString
, ::rtl::OUString
> tMakeStringStringMap
;
576 const tMakeStringStringMap
& lcl_getChartTypeNameMap()
578 static tMakeStringStringMap g_aChartTypeNameMap
=
580 ( ::rtl::OUString::createFromAscii( "com.sun.star.chart2.LineChartType" )
581 , ::rtl::OUString::createFromAscii( "com.sun.star.chart.LineDiagram" ) )
583 ( ::rtl::OUString::createFromAscii( "com.sun.star.chart2.AreaChartType" )
584 , ::rtl::OUString::createFromAscii( "com.sun.star.chart.AreaDiagram" ) )
586 ( ::rtl::OUString::createFromAscii( "com.sun.star.chart2.ColumnChartType" )
587 , ::rtl::OUString::createFromAscii( "com.sun.star.chart.BarDiagram" ) )
589 ( ::rtl::OUString::createFromAscii( "com.sun.star.chart2.PieChartType" )
590 , ::rtl::OUString::createFromAscii( "com.sun.star.chart.PieDiagram" ) )
592 ( ::rtl::OUString::createFromAscii( "com.sun.star.chart2.DonutChartType" )
593 , ::rtl::OUString::createFromAscii( "com.sun.star.chart.DonutDiagram" ) )
595 ( ::rtl::OUString::createFromAscii( "com.sun.star.chart2.ScatterChartType" )
596 , ::rtl::OUString::createFromAscii( "com.sun.star.chart.XYDiagram" ) )
598 ( ::rtl::OUString::createFromAscii( "com.sun.star.chart2.FilledNetChartType" )
599 , ::rtl::OUString::createFromAscii( "com.sun.star.chart.FilledNetDiagram" ) )
601 ( ::rtl::OUString::createFromAscii( "com.sun.star.chart2.NetChartType" )
602 , ::rtl::OUString::createFromAscii( "com.sun.star.chart.NetDiagram" ) )
604 ( ::rtl::OUString::createFromAscii( "com.sun.star.chart2.CandleStickChartType" )
605 , ::rtl::OUString::createFromAscii( "com.sun.star.chart.StockDiagram" ) )
607 ( ::rtl::OUString::createFromAscii( "com.sun.star.chart2.BubbleChartType" )
608 , ::rtl::OUString::createFromAscii( "com.sun.star.chart.BubbleDiagram" ) )
611 return g_aChartTypeNameMap
;
615 OUString
lcl_getOldChartTypeName( const OUString
& rNewChartTypeName
)
617 OUString
aOld(rNewChartTypeName
);
619 const tMakeStringStringMap
& rMap
= lcl_getChartTypeNameMap();
620 tMakeStringStringMap::const_iterator
aIt( rMap
.find( rNewChartTypeName
));
621 if( aIt
!= rMap
.end())
628 } // anonymous namespace
630 // --------------------------------------------------------------------------------
637 DiagramWrapper::DiagramWrapper(
638 ::boost::shared_ptr
< Chart2ModelContact
> spChart2ModelContact
) :
639 m_spChart2ModelContact( spChart2ModelContact
),
640 m_aEventListenerContainer( m_aMutex
)
644 DiagramWrapper::~DiagramWrapper()
647 // ____ XDiagram ____
648 OUString SAL_CALL
DiagramWrapper::getDiagramType()
649 throw (uno::RuntimeException
)
653 Reference
< chart2::XChartDocument
> xChartDoc( m_spChart2ModelContact
->getChart2Document() );
654 Reference
< chart2::XDiagram
> xDiagram( m_spChart2ModelContact
->getChart2Diagram() );
655 if( xChartDoc
.is() && xDiagram
.is() )
657 Reference
< beans::XPropertySet
> xChartDocProp( xChartDoc
, uno::UNO_QUERY
);
658 if( xChartDocProp
.is() )
660 uno::Reference
< util::XRefreshable
> xAddIn
;
661 if( xChartDocProp
->getPropertyValue( C2U( "AddIn" ) ) >>= xAddIn
)
663 uno::Reference
< lang::XServiceName
> xServiceName( xAddIn
, uno::UNO_QUERY
);
664 if( xServiceName
.is())
665 return xServiceName
->getServiceName();
669 Reference
< lang::XMultiServiceFactory
> xChartTypeManager( xChartDoc
->getChartTypeManager(), uno::UNO_QUERY
);
670 DiagramHelper::tTemplateWithServiceName aTemplateAndService
=
671 DiagramHelper::getTemplateForDiagram( xDiagram
, xChartTypeManager
);
673 aRet
= lcl_getDiagramType( aTemplateAndService
.second
);
676 if( !aRet
.getLength())
678 // none of the standard templates matched
679 // use first chart type
680 Reference
< chart2::XChartType
> xChartType( DiagramHelper::getChartTypeByIndex( xDiagram
, 0 ) );
681 if( xChartType
.is() )
683 aRet
= xChartType
->getChartType();
684 if( aRet
.getLength() )
685 aRet
= lcl_getOldChartTypeName( aRet
);
687 if( !aRet
.getLength())
688 aRet
= C2U( "com.sun.star.chart.BarDiagram" );
695 beans::XPropertySet
> SAL_CALL
DiagramWrapper::getDataRowProperties( sal_Int32 nRow
)
696 throw (lang::IndexOutOfBoundsException
,
697 uno::RuntimeException
)
700 throw lang::IndexOutOfBoundsException(
701 C2U( "DataSeries index invalid" ), static_cast< ::cppu::OWeakObject
* >( this ));
703 Reference
< chart2::XDataSeries
> xSeries
;
705 sal_Int32 nNewAPIIndex
= lcl_getNewAPIIndexForOldAPIIndex( nRow
, m_spChart2ModelContact
->getChart2Diagram() );
706 if( nNewAPIIndex
< 0 )
707 throw lang::IndexOutOfBoundsException(
708 C2U( "DataSeries index invalid" ), static_cast< ::cppu::OWeakObject
* >( this ));
710 Reference
< beans::XPropertySet
> xRet( new DataSeriesPointWrapper(
711 DataSeriesPointWrapper::DATA_SERIES
, nNewAPIIndex
, 0, m_spChart2ModelContact
) );
716 beans::XPropertySet
> SAL_CALL
DiagramWrapper::getDataPointProperties( sal_Int32 nCol
, sal_Int32 nRow
)
717 throw (lang::IndexOutOfBoundsException
,
718 uno::RuntimeException
)
720 if( nCol
< 0 || nRow
< 0 )
721 throw lang::IndexOutOfBoundsException(
722 C2U( "DataSeries index invalid" ), static_cast< ::cppu::OWeakObject
* >( this ));
724 Reference
< chart2::XDataSeries
> xSeries
;
726 sal_Int32 nNewAPIIndex
= lcl_getNewAPIIndexForOldAPIIndex( nRow
, m_spChart2ModelContact
->getChart2Diagram() );
727 if( nNewAPIIndex
< 0 )
728 throw lang::IndexOutOfBoundsException(
729 C2U( "DataSeries index invalid" ), static_cast< ::cppu::OWeakObject
* >( this ));
731 //todo: check borders of point index
733 Reference
< beans::XPropertySet
> xRet( new DataSeriesPointWrapper(
734 DataSeriesPointWrapper::DATA_POINT
, nNewAPIIndex
, nCol
, m_spChart2ModelContact
) );
739 // ____ XShape (base of XDiagram) ____
740 awt::Point SAL_CALL
DiagramWrapper::getPosition()
741 throw (uno::RuntimeException
)
743 awt::Point aPosition
;
745 Reference
< beans::XPropertySet
> xProp( this->getInnerPropertySet() );
749 chart2::RelativePosition aRelativePosition
;
750 uno::Any
aAPosition( xProp
->getPropertyValue( C2U( "RelativePosition" ) ) );
751 if( aAPosition
>>= aRelativePosition
)
753 awt::Size
aPageSize( m_spChart2ModelContact
->GetPageSize() );
754 aPosition
.X
= static_cast<sal_Int32
>(aRelativePosition
.Primary
*aPageSize
.Width
);
755 aPosition
.Y
= static_cast<sal_Int32
>(aRelativePosition
.Secondary
*aPageSize
.Height
);
757 aPosition
= RelativePositionHelper::getUpperLeftCornerOfAnchoredObject(
758 aPosition
, DiagramWrapper::getSize(), aRelativePosition
.Anchor
);
763 aPosition
= m_spChart2ModelContact
->GetDiagramPositionInclusive();
769 void SAL_CALL
DiagramWrapper::setPosition( const awt::Point
& aPosition
)
770 throw (uno::RuntimeException
)
772 Reference
< beans::XPropertySet
> xProp( this->getInnerPropertySet() );
775 if( aPosition
.X
< 0 || aPosition
.Y
< 0 )
777 if( !TitleHelper::getTitle( TitleHelper::X_AXIS_TITLE
, m_spChart2ModelContact
->getChartModel() ).is() &&
778 !TitleHelper::getTitle( TitleHelper::Y_AXIS_TITLE
, m_spChart2ModelContact
->getChartModel() ).is() )
780 DBG_ERROR("DiagramWrapper::setPosition called with negative position -> automatic values are taken instead" );
782 xProp
->setPropertyValue( C2U( "RelativePosition" ), aEmpty
);
785 //else: The saved didagram size does include the axis title sizes thus the position and size could be negative
788 awt::Size
aPageSize( m_spChart2ModelContact
->GetPageSize() );
790 chart2::RelativePosition aRelativePosition
;
791 aRelativePosition
.Anchor
= drawing::Alignment_TOP_LEFT
;
792 aRelativePosition
.Primary
= double(aPosition
.X
)/double(aPageSize
.Width
);
793 aRelativePosition
.Secondary
= double(aPosition
.Y
)/double(aPageSize
.Height
);
794 xProp
->setPropertyValue( C2U( "RelativePosition" ), uno::makeAny(aRelativePosition
) );
798 awt::Size SAL_CALL
DiagramWrapper::getSize()
799 throw (uno::RuntimeException
)
803 Reference
< beans::XPropertySet
> xProp( this->getInnerPropertySet() );
807 chart2::RelativeSize aRelativeSize
;
808 uno::Any
aASize( xProp
->getPropertyValue( C2U( "RelativeSize" ) ) );
809 if(aASize
>>=aRelativeSize
)
811 awt::Size
aPageSize( m_spChart2ModelContact
->GetPageSize() );
812 aSize
.Width
= static_cast<sal_Int32
>(aRelativeSize
.Primary
*aPageSize
.Width
);
813 aSize
.Height
= static_cast<sal_Int32
>(aRelativeSize
.Secondary
*aPageSize
.Height
);
817 aSize
= m_spChart2ModelContact
->GetDiagramSizeInclusive();
823 void SAL_CALL
DiagramWrapper::setSize( const awt::Size
& aSize
)
824 throw (beans::PropertyVetoException
,
825 uno::RuntimeException
)
827 Reference
< beans::XPropertySet
> xProp( this->getInnerPropertySet() );
830 awt::Size
aPageSize( m_spChart2ModelContact
->GetPageSize() );
832 chart2::RelativeSize aRelativeSize
;
833 aRelativeSize
.Primary
= double(aSize
.Width
)/double(aPageSize
.Width
);
834 aRelativeSize
.Secondary
= double(aSize
.Height
)/double(aPageSize
.Height
);
836 if( aRelativeSize
.Primary
> 1 || aRelativeSize
.Secondary
> 1 )
838 if( !TitleHelper::getTitle( TitleHelper::X_AXIS_TITLE
, m_spChart2ModelContact
->getChartModel() ).is() &&
839 !TitleHelper::getTitle( TitleHelper::Y_AXIS_TITLE
, m_spChart2ModelContact
->getChartModel() ).is() )
841 DBG_ERROR("DiagramWrapper::setSize called with sizes bigger than page -> automatic values are taken instead" );
843 xProp
->setPropertyValue( C2U( "RelativeSize" ), aEmpty
);
846 //else: The saved didagram size does include the axis title sizes thus the position and size could be out of range
849 xProp
->setPropertyValue( C2U( "RelativeSize" ), uno::makeAny(aRelativeSize
) );
853 // ____ XShapeDescriptor (base of XShape) ____
854 OUString SAL_CALL
DiagramWrapper::getShapeType()
855 throw (uno::RuntimeException
)
857 return C2U( "com.sun.star.chart.Diagram" );
860 // ____ XAxisZSupplier ____
862 drawing::XShape
> SAL_CALL
DiagramWrapper::getZAxisTitle()
863 throw (uno::RuntimeException
)
865 if( !m_xZAxisTitle
.is() )
867 m_xZAxisTitle
= new TitleWrapper( TitleHelper::Z_AXIS_TITLE
, m_spChart2ModelContact
);
869 return m_xZAxisTitle
;
873 beans::XPropertySet
> SAL_CALL
DiagramWrapper::getZMainGrid()
874 throw (uno::RuntimeException
)
876 if( ! m_xZMainGrid
.is())
878 m_xZMainGrid
= new GridWrapper( GridWrapper::Z_MAIN_GRID
, m_spChart2ModelContact
);
884 beans::XPropertySet
> SAL_CALL
DiagramWrapper::getZHelpGrid()
885 throw (uno::RuntimeException
)
887 if( !m_xZHelpGrid
.is() )
889 m_xZHelpGrid
= new GridWrapper( GridWrapper::Z_SUB_GRID
, m_spChart2ModelContact
);
895 beans::XPropertySet
> SAL_CALL
DiagramWrapper::getZAxis()
896 throw (uno::RuntimeException
)
900 m_xZAxis
= new AxisWrapper( AxisWrapper::Z_AXIS
, m_spChart2ModelContact
);
906 // ____ XTwoAxisXSupplier ____
908 beans::XPropertySet
> SAL_CALL
DiagramWrapper::getSecondaryXAxis()
909 throw (uno::RuntimeException
)
911 if( ! m_xSecondXAxis
.is())
913 m_xSecondXAxis
= new AxisWrapper( AxisWrapper::SECOND_X_AXIS
, m_spChart2ModelContact
);
915 return m_xSecondXAxis
;
919 // ____ XAxisXSupplier (base of XTwoAxisXSupplier) ____
921 drawing::XShape
> SAL_CALL
DiagramWrapper::getXAxisTitle()
922 throw (uno::RuntimeException
)
925 if( !m_xXAxisTitle
.is() )
927 m_xXAxisTitle
= new TitleWrapper( TitleHelper::X_AXIS_TITLE
, m_spChart2ModelContact
);
929 return m_xXAxisTitle
;
933 beans::XPropertySet
> SAL_CALL
DiagramWrapper::getXAxis()
934 throw (uno::RuntimeException
)
938 m_xXAxis
= new AxisWrapper( AxisWrapper::X_AXIS
, m_spChart2ModelContact
);
945 beans::XPropertySet
> SAL_CALL
DiagramWrapper::getXMainGrid()
946 throw (uno::RuntimeException
)
948 if( ! m_xXMainGrid
.is())
950 m_xXMainGrid
= new GridWrapper( GridWrapper::X_MAIN_GRID
, m_spChart2ModelContact
);
957 beans::XPropertySet
> SAL_CALL
DiagramWrapper::getXHelpGrid()
958 throw (uno::RuntimeException
)
960 if( ! m_xXHelpGrid
.is())
962 m_xXHelpGrid
= new GridWrapper( GridWrapper::X_SUB_GRID
, m_spChart2ModelContact
);
968 // ____ XTwoAxisYSupplier ____
970 beans::XPropertySet
> SAL_CALL
DiagramWrapper::getSecondaryYAxis()
971 throw (uno::RuntimeException
)
973 if( ! m_xSecondYAxis
.is())
975 m_xSecondYAxis
= new AxisWrapper( AxisWrapper::SECOND_Y_AXIS
, m_spChart2ModelContact
);
977 return m_xSecondYAxis
;
981 // ____ XAxisYSupplier (base of XTwoAxisYSupplier) ____
983 drawing::XShape
> SAL_CALL
DiagramWrapper::getYAxisTitle()
984 throw (uno::RuntimeException
)
986 if( !m_xYAxisTitle
.is() )
988 m_xYAxisTitle
= new TitleWrapper( TitleHelper::Y_AXIS_TITLE
, m_spChart2ModelContact
);
990 return m_xYAxisTitle
;
994 beans::XPropertySet
> SAL_CALL
DiagramWrapper::getYAxis()
995 throw (uno::RuntimeException
)
999 m_xYAxis
= new AxisWrapper( AxisWrapper::Y_AXIS
, m_spChart2ModelContact
);
1005 beans::XPropertySet
> SAL_CALL
DiagramWrapper::getYHelpGrid()
1006 throw (uno::RuntimeException
)
1008 if( ! m_xYHelpGrid
.is())
1010 m_xYHelpGrid
= new GridWrapper( GridWrapper::Y_SUB_GRID
, m_spChart2ModelContact
);
1012 return m_xYHelpGrid
;
1016 beans::XPropertySet
> SAL_CALL
DiagramWrapper::getYMainGrid()
1017 throw (uno::RuntimeException
)
1019 if( ! m_xYMainGrid
.is())
1021 m_xYMainGrid
= new GridWrapper( GridWrapper::Y_MAIN_GRID
, m_spChart2ModelContact
);
1023 return m_xYMainGrid
;
1026 // ____ XSecondAxisTitleSupplier ____
1028 drawing::XShape
> SAL_CALL
DiagramWrapper::getSecondXAxisTitle()
1029 throw (uno::RuntimeException
)
1031 if( !m_xSecondXAxisTitle
.is() )
1033 m_xSecondXAxisTitle
= new TitleWrapper( TitleHelper::SECONDARY_X_AXIS_TITLE
, m_spChart2ModelContact
);
1035 return m_xSecondXAxisTitle
;
1039 drawing::XShape
> SAL_CALL
DiagramWrapper::getSecondYAxisTitle()
1040 throw (uno::RuntimeException
)
1042 if( !m_xSecondYAxisTitle
.is() )
1044 m_xSecondYAxisTitle
= new TitleWrapper( TitleHelper::SECONDARY_Y_AXIS_TITLE
, m_spChart2ModelContact
);
1046 return m_xSecondYAxisTitle
;
1049 // ____ XStatisticDisplay ____
1051 beans::XPropertySet
> SAL_CALL
DiagramWrapper::getUpBar()
1052 throw (uno::RuntimeException
)
1054 if( !m_xUpBarWrapper
.is() )
1056 m_xUpBarWrapper
= new UpDownBarWrapper( true, m_spChart2ModelContact
);
1058 return m_xUpBarWrapper
;
1062 beans::XPropertySet
> SAL_CALL
DiagramWrapper::getDownBar()
1063 throw (uno::RuntimeException
)
1065 if( !m_xDownBarWrapper
.is() )
1067 m_xDownBarWrapper
= new UpDownBarWrapper( false, m_spChart2ModelContact
);
1069 return m_xDownBarWrapper
;
1073 beans::XPropertySet
> SAL_CALL
DiagramWrapper::getMinMaxLine()
1074 throw (uno::RuntimeException
)
1076 if( !m_xMinMaxLineWrapper
.is() )
1078 m_xMinMaxLineWrapper
= new MinMaxLineWrapper( m_spChart2ModelContact
);
1080 return m_xMinMaxLineWrapper
;
1083 // ____ X3DDisplay ____
1084 Reference
< beans::XPropertySet
> SAL_CALL
DiagramWrapper::getWall()
1085 throw (uno::RuntimeException
)
1089 m_xWall
= new WallFloorWrapper( true, m_spChart2ModelContact
);
1095 beans::XPropertySet
> SAL_CALL
DiagramWrapper::getFloor()
1096 throw (uno::RuntimeException
)
1098 if( !m_xFloor
.is() )
1100 m_xFloor
= new WallFloorWrapper( false, m_spChart2ModelContact
);
1105 // ____ X3DDefaultSetter ____
1106 void SAL_CALL
DiagramWrapper::set3DSettingsToDefault()
1107 throw (uno::RuntimeException
)
1109 Reference
< X3DDefaultSetter
> x3DDefaultSetter( m_spChart2ModelContact
->getChart2Diagram(), uno::UNO_QUERY
);
1110 if( x3DDefaultSetter
.is() )
1111 x3DDefaultSetter
->set3DSettingsToDefault();
1114 void SAL_CALL
DiagramWrapper::setDefaultRotation()
1115 throw (uno::RuntimeException
)
1117 Reference
< X3DDefaultSetter
> x3DDefaultSetter( m_spChart2ModelContact
->getChart2Diagram(), uno::UNO_QUERY
);
1118 if( x3DDefaultSetter
.is() )
1119 x3DDefaultSetter
->setDefaultRotation();
1122 void SAL_CALL
DiagramWrapper::setDefaultIllumination()
1123 throw (uno::RuntimeException
)
1125 Reference
< X3DDefaultSetter
> x3DDefaultSetter( m_spChart2ModelContact
->getChart2Diagram(), uno::UNO_QUERY
);
1126 if( x3DDefaultSetter
.is() )
1127 x3DDefaultSetter
->setDefaultIllumination();
1130 // ____ XComponent ____
1131 void SAL_CALL
DiagramWrapper::dispose()
1132 throw (uno::RuntimeException
)
1134 m_aEventListenerContainer
.disposeAndClear( lang::EventObject( static_cast< ::cppu::OWeakObject
* >( this )));
1137 MutexGuard
aGuard( GetMutex());
1139 DisposeHelper::DisposeAndClear( m_xXAxisTitle
);
1140 DisposeHelper::DisposeAndClear( m_xYAxisTitle
);
1141 DisposeHelper::DisposeAndClear( m_xZAxisTitle
);
1142 DisposeHelper::DisposeAndClear( m_xSecondXAxisTitle
);
1143 DisposeHelper::DisposeAndClear( m_xSecondYAxisTitle
);
1144 DisposeHelper::DisposeAndClear( m_xXAxis
);
1145 DisposeHelper::DisposeAndClear( m_xYAxis
);
1146 DisposeHelper::DisposeAndClear( m_xZAxis
);
1147 DisposeHelper::DisposeAndClear( m_xSecondXAxis
);
1148 DisposeHelper::DisposeAndClear( m_xSecondYAxis
);
1149 DisposeHelper::DisposeAndClear( m_xXMainGrid
);
1150 DisposeHelper::DisposeAndClear( m_xYMainGrid
);
1151 DisposeHelper::DisposeAndClear( m_xZMainGrid
);
1152 DisposeHelper::DisposeAndClear( m_xXHelpGrid
);
1153 DisposeHelper::DisposeAndClear( m_xYHelpGrid
);
1154 DisposeHelper::DisposeAndClear( m_xZHelpGrid
);
1155 DisposeHelper::DisposeAndClear( m_xWall
);
1156 DisposeHelper::DisposeAndClear( m_xFloor
);
1157 DisposeHelper::DisposeAndClear( m_xMinMaxLineWrapper
);
1158 DisposeHelper::DisposeAndClear( m_xUpBarWrapper
);
1159 DisposeHelper::DisposeAndClear( m_xDownBarWrapper
);
1161 clearWrappedPropertySet();
1165 void SAL_CALL
DiagramWrapper::addEventListener(
1166 const Reference
< lang::XEventListener
>& xListener
)
1167 throw (uno::RuntimeException
)
1169 m_aEventListenerContainer
.addInterface( xListener
);
1172 void SAL_CALL
DiagramWrapper::removeEventListener(
1173 const Reference
< lang::XEventListener
>& aListener
)
1174 throw (uno::RuntimeException
)
1176 m_aEventListenerContainer
.removeInterface( aListener
);
1179 // ____ XEventListener ____
1180 // void SAL_CALL DiagramWrapper::disposing( const lang::EventObject& Source )
1181 // throw (uno::RuntimeException)
1185 //-----------------------------------------------------------------------------------------------------------------
1186 //-----------------------------------------------------------------------------------------------------------------
1187 //-----------------------------------------------------------------------------------------------------------------
1189 //PROP_DIAGRAM_DATAROW_SOURCE
1190 class WrappedDataRowSourceProperty
: public WrappedProperty
1193 WrappedDataRowSourceProperty( ::boost::shared_ptr
< Chart2ModelContact
> spChart2ModelContact
);
1194 virtual ~WrappedDataRowSourceProperty();
1196 virtual void setPropertyValue( const ::com::sun::star::uno::Any
& rOuterValue
, const ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertySet
>& xInnerPropertySet
) const
1197 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
);
1199 virtual ::com::sun::star::uno::Any
getPropertyValue( const ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertySet
>& xInnerPropertySet
) const
1200 throw (::com::sun::star::beans::UnknownPropertyException
, ::com::sun::star::lang::WrappedTargetException
, ::com::sun::star::uno::RuntimeException
);
1202 virtual ::com::sun::star::uno::Any
getPropertyDefault( const ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertyState
>& xInnerPropertyState
) const
1203 throw (::com::sun::star::beans::UnknownPropertyException
, ::com::sun::star::lang::WrappedTargetException
, ::com::sun::star::uno::RuntimeException
);
1206 ::boost::shared_ptr
< Chart2ModelContact
> m_spChart2ModelContact
;
1207 mutable Any m_aOuterValue
;
1210 WrappedDataRowSourceProperty::WrappedDataRowSourceProperty( ::boost::shared_ptr
< Chart2ModelContact
> spChart2ModelContact
)
1211 : WrappedProperty(C2U("DataRowSource"),OUString())
1212 , m_spChart2ModelContact( spChart2ModelContact
)
1215 m_aOuterValue
= WrappedDataRowSourceProperty::getPropertyDefault( 0 );
1218 WrappedDataRowSourceProperty::~WrappedDataRowSourceProperty()
1222 void WrappedDataRowSourceProperty::setPropertyValue( const Any
& rOuterValue
, const Reference
< beans::XPropertySet
>& /*xInnerPropertySet*/ ) const
1223 throw (beans::UnknownPropertyException
, beans::PropertyVetoException
, lang::IllegalArgumentException
, lang::WrappedTargetException
, uno::RuntimeException
)
1225 ::com::sun::star::chart::ChartDataRowSource eChartDataRowSource
= ::com::sun::star::chart::ChartDataRowSource_ROWS
;
1226 if( ! (rOuterValue
>>= eChartDataRowSource
) )
1227 throw lang::IllegalArgumentException( C2U("Property DataRowSource requires ::com::sun::star::chart::ChartDataRowSource value"), 0, 0 );
1229 m_aOuterValue
= rOuterValue
;
1231 bool bNewUseColumns
= eChartDataRowSource
== ::com::sun::star::chart::ChartDataRowSource_COLUMNS
;
1233 ::rtl::OUString aRangeString
;
1234 bool bUseColumns
= true;
1235 bool bFirstCellAsLabel
= true;
1236 bool bHasCategories
= true;
1237 uno::Sequence
< sal_Int32
> aSequenceMapping
;
1239 if( DataSourceHelper::detectRangeSegmentation(
1240 m_spChart2ModelContact
->getChartModel(), aRangeString
, aSequenceMapping
, bUseColumns
1241 , bFirstCellAsLabel
, bHasCategories
) )
1243 if( bUseColumns
!= bNewUseColumns
)
1245 aSequenceMapping
.realloc(0);
1246 DataSourceHelper::setRangeSegmentation(
1247 m_spChart2ModelContact
->getChartModel(), aSequenceMapping
, bNewUseColumns
, bHasCategories
, bFirstCellAsLabel
);
1252 Any
WrappedDataRowSourceProperty::getPropertyValue( const Reference
< beans::XPropertySet
>& /*xInnerPropertySet*/ ) const
1253 throw (beans::UnknownPropertyException
, lang::WrappedTargetException
, uno::RuntimeException
)
1255 ::rtl::OUString aRangeString
;
1256 bool bUseColumns
= true;
1257 bool bFirstCellAsLabel
= true;
1258 bool bHasCategories
= true;
1259 uno::Sequence
< sal_Int32
> aSequenceMapping
;
1261 if( DataSourceHelper::detectRangeSegmentation(
1262 m_spChart2ModelContact
->getChartModel(), aRangeString
, aSequenceMapping
, bUseColumns
1263 , bFirstCellAsLabel
, bHasCategories
) )
1265 ::com::sun::star::chart::ChartDataRowSource eChartDataRowSource
= ::com::sun::star::chart::ChartDataRowSource_ROWS
;
1267 eChartDataRowSource
= ::com::sun::star::chart::ChartDataRowSource_COLUMNS
;
1269 m_aOuterValue
<<= eChartDataRowSource
;
1272 return m_aOuterValue
;
1275 Any
WrappedDataRowSourceProperty::getPropertyDefault( const Reference
< beans::XPropertyState
>& /*xInnerPropertyState*/ ) const
1276 throw (beans::UnknownPropertyException
, lang::WrappedTargetException
, uno::RuntimeException
)
1279 aRet
<<= ::com::sun::star::chart::ChartDataRowSource_COLUMNS
;
1283 //-----------------------------------------------------------------------------------------------------------------
1284 //-----------------------------------------------------------------------------------------------------------------
1285 //-----------------------------------------------------------------------------------------------------------------
1288 //PROP_DIAGRAM_STACKED
1290 //PROP_DIAGRAM_PERCENT_STACKED
1291 class WrappedStackingProperty
: public WrappedProperty
1294 WrappedStackingProperty( StackMode eStackMode
, ::boost::shared_ptr
< Chart2ModelContact
> spChart2ModelContact
);
1295 virtual ~WrappedStackingProperty();
1297 virtual void setPropertyValue( const ::com::sun::star::uno::Any
& rOuterValue
, const ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertySet
>& xInnerPropertySet
) const
1298 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
);
1300 virtual ::com::sun::star::uno::Any
getPropertyValue( const ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertySet
>& xInnerPropertySet
) const
1301 throw (::com::sun::star::beans::UnknownPropertyException
, ::com::sun::star::lang::WrappedTargetException
, ::com::sun::star::uno::RuntimeException
);
1303 virtual ::com::sun::star::uno::Any
getPropertyDefault( const ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertyState
>& xInnerPropertyState
) const
1304 throw (::com::sun::star::beans::UnknownPropertyException
, ::com::sun::star::lang::WrappedTargetException
, ::com::sun::star::uno::RuntimeException
);
1306 protected: //methods
1307 bool detectInnerValue( StackMode
& eInnerStackMode
) const;
1310 ::boost::shared_ptr
< Chart2ModelContact
> m_spChart2ModelContact
;
1311 const StackMode m_eStackMode
;
1312 mutable Any m_aOuterValue
;
1315 WrappedStackingProperty::WrappedStackingProperty( StackMode eStackMode
, ::boost::shared_ptr
< Chart2ModelContact
> spChart2ModelContact
)
1316 : WrappedProperty(OUString(),OUString())
1317 , m_spChart2ModelContact( spChart2ModelContact
)
1318 , m_eStackMode( eStackMode
)
1321 switch( m_eStackMode
)
1323 case StackMode_Y_STACKED
:
1324 m_aOuterName
= C2U( "Stacked" );
1326 case StackMode_Y_STACKED_PERCENT
:
1327 m_aOuterName
= C2U( "Percent" );
1329 case StackMode_Z_STACKED
:
1330 m_aOuterName
= C2U( "Deep" );
1333 OSL_ENSURE( false, "unexpected stack mode" );
1338 WrappedStackingProperty::~WrappedStackingProperty()
1342 bool WrappedStackingProperty::detectInnerValue( StackMode
& eStackMode
) const
1344 bool bHasDetectableInnerValue
= false;
1345 bool bIsAmbiguous
= false;
1346 eStackMode
= DiagramHelper::getStackMode( m_spChart2ModelContact
->getChart2Diagram()
1347 , bHasDetectableInnerValue
, bIsAmbiguous
);
1348 return bHasDetectableInnerValue
;
1351 void WrappedStackingProperty::setPropertyValue( const Any
& rOuterValue
, const Reference
< beans::XPropertySet
>& /*xInnerPropertySet*/ ) const
1352 throw (beans::UnknownPropertyException
, beans::PropertyVetoException
, lang::IllegalArgumentException
, lang::WrappedTargetException
, uno::RuntimeException
)
1354 sal_Bool bNewValue
= false;
1355 if( ! (rOuterValue
>>= bNewValue
) )
1356 throw lang::IllegalArgumentException( C2U("Stacking Properties require boolean values"), 0, 0 );
1358 StackMode eInnerStackMode
;
1359 bool bHasDetectableInnerValue
= detectInnerValue( eInnerStackMode
);
1361 if( !bHasDetectableInnerValue
)
1363 m_aOuterValue
= rOuterValue
;
1367 if( bNewValue
&& eInnerStackMode
== m_eStackMode
)
1369 if( !bNewValue
&& eInnerStackMode
!= m_eStackMode
)
1372 Reference
< chart2::XDiagram
> xDiagram( m_spChart2ModelContact
->getChart2Diagram() );
1375 StackMode eNewStackMode
= bNewValue
? m_eStackMode
: StackMode_NONE
;
1376 DiagramHelper::setStackMode( xDiagram
, eNewStackMode
);
1380 Any
WrappedStackingProperty::getPropertyValue( const Reference
< beans::XPropertySet
>& /*xInnerPropertySet*/ ) const
1381 throw (beans::UnknownPropertyException
, lang::WrappedTargetException
, uno::RuntimeException
)
1383 StackMode eInnerStackMode
;
1384 if( detectInnerValue( eInnerStackMode
) )
1386 sal_Bool bValue
= (eInnerStackMode
== m_eStackMode
);
1391 return m_aOuterValue
;
1394 Any
WrappedStackingProperty::getPropertyDefault( const Reference
< beans::XPropertyState
>& /*xInnerPropertyState*/ ) const
1395 throw (beans::UnknownPropertyException
, lang::WrappedTargetException
, uno::RuntimeException
)
1398 aRet
<<= sal_Bool( sal_False
);
1402 //-----------------------------------------------------------------------------------------------------------------
1403 //-----------------------------------------------------------------------------------------------------------------
1404 //-----------------------------------------------------------------------------------------------------------------
1406 //PROP_DIAGRAM_THREE_D
1407 class WrappedDim3DProperty
: public WrappedProperty
1410 WrappedDim3DProperty( ::boost::shared_ptr
< Chart2ModelContact
> spChart2ModelContact
);
1411 virtual ~WrappedDim3DProperty();
1413 virtual void setPropertyValue( const ::com::sun::star::uno::Any
& rOuterValue
, const ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertySet
>& xInnerPropertySet
) const
1414 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
);
1416 virtual ::com::sun::star::uno::Any
getPropertyValue( const ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertySet
>& xInnerPropertySet
) const
1417 throw (::com::sun::star::beans::UnknownPropertyException
, ::com::sun::star::lang::WrappedTargetException
, ::com::sun::star::uno::RuntimeException
);
1419 virtual ::com::sun::star::uno::Any
getPropertyDefault( const ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertyState
>& xInnerPropertyState
) const
1420 throw (::com::sun::star::beans::UnknownPropertyException
, ::com::sun::star::lang::WrappedTargetException
, ::com::sun::star::uno::RuntimeException
);
1423 ::boost::shared_ptr
< Chart2ModelContact
> m_spChart2ModelContact
;
1424 mutable Any m_aOuterValue
;
1427 WrappedDim3DProperty::WrappedDim3DProperty( ::boost::shared_ptr
< Chart2ModelContact
> spChart2ModelContact
)
1428 : WrappedProperty(C2U("Dim3D"),OUString())
1429 , m_spChart2ModelContact( spChart2ModelContact
)
1432 m_aOuterValue
= WrappedDim3DProperty::getPropertyDefault( 0 );
1435 WrappedDim3DProperty::~WrappedDim3DProperty()
1439 void WrappedDim3DProperty::setPropertyValue( const Any
& rOuterValue
, const Reference
< beans::XPropertySet
>& /*xInnerPropertySet*/ ) const
1440 throw (beans::UnknownPropertyException
, beans::PropertyVetoException
, lang::IllegalArgumentException
, lang::WrappedTargetException
, uno::RuntimeException
)
1442 sal_Bool bNew3D
= false;
1443 if( ! (rOuterValue
>>= bNew3D
) )
1444 throw lang::IllegalArgumentException( C2U("Property Dim3D requires boolean value"), 0, 0 );
1446 m_aOuterValue
= rOuterValue
;
1448 Reference
< chart2::XDiagram
> xDiagram( m_spChart2ModelContact
->getChart2Diagram() );
1449 if( !xDiagram
.is() )
1452 sal_Bool bOld3D
= DiagramHelper::getDimension( xDiagram
) == 3;
1453 if( bOld3D
!= bNew3D
)
1454 DiagramHelper::setDimension( xDiagram
, bNew3D
? 3 : 2 );
1457 Any
WrappedDim3DProperty::getPropertyValue( const Reference
< beans::XPropertySet
>& /*xInnerPropertySet*/ ) const
1458 throw (beans::UnknownPropertyException
, lang::WrappedTargetException
, uno::RuntimeException
)
1460 Reference
< chart2::XDiagram
> xDiagram( m_spChart2ModelContact
->getChart2Diagram() );
1463 sal_Bool b3D
= DiagramHelper::getDimension( xDiagram
) == 3;
1464 m_aOuterValue
<<= b3D
;
1466 return m_aOuterValue
;
1469 Any
WrappedDim3DProperty::getPropertyDefault( const Reference
< beans::XPropertyState
>& /*xInnerPropertyState*/ ) const
1470 throw (beans::UnknownPropertyException
, lang::WrappedTargetException
, uno::RuntimeException
)
1473 aRet
<<= sal_Bool( sal_False
);
1477 //-----------------------------------------------------------------------------------------------------------------
1478 //-----------------------------------------------------------------------------------------------------------------
1479 //-----------------------------------------------------------------------------------------------------------------
1481 //PROP_DIAGRAM_VERTICAL
1482 class WrappedVerticalProperty
: public WrappedProperty
1485 WrappedVerticalProperty( ::boost::shared_ptr
< Chart2ModelContact
> spChart2ModelContact
);
1486 virtual ~WrappedVerticalProperty();
1488 virtual void setPropertyValue( const ::com::sun::star::uno::Any
& rOuterValue
, const ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertySet
>& xInnerPropertySet
) const
1489 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
);
1491 virtual ::com::sun::star::uno::Any
getPropertyValue( const ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertySet
>& xInnerPropertySet
) const
1492 throw (::com::sun::star::beans::UnknownPropertyException
, ::com::sun::star::lang::WrappedTargetException
, ::com::sun::star::uno::RuntimeException
);
1494 virtual ::com::sun::star::uno::Any
getPropertyDefault( const ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertyState
>& xInnerPropertyState
) const
1495 throw (::com::sun::star::beans::UnknownPropertyException
, ::com::sun::star::lang::WrappedTargetException
, ::com::sun::star::uno::RuntimeException
);
1498 ::boost::shared_ptr
< Chart2ModelContact
> m_spChart2ModelContact
;
1499 mutable Any m_aOuterValue
;
1502 WrappedVerticalProperty::WrappedVerticalProperty( ::boost::shared_ptr
< Chart2ModelContact
> spChart2ModelContact
)
1503 : WrappedProperty(C2U("Vertical"),OUString())
1504 , m_spChart2ModelContact( spChart2ModelContact
)
1507 m_aOuterValue
= WrappedVerticalProperty::getPropertyDefault( 0 );
1510 WrappedVerticalProperty::~WrappedVerticalProperty()
1514 void WrappedVerticalProperty::setPropertyValue( const Any
& rOuterValue
, const Reference
< beans::XPropertySet
>& /*xInnerPropertySet*/ ) const
1515 throw (beans::UnknownPropertyException
, beans::PropertyVetoException
, lang::IllegalArgumentException
, lang::WrappedTargetException
, uno::RuntimeException
)
1517 sal_Bool bNewVertical
= false;
1518 if( ! (rOuterValue
>>= bNewVertical
) )
1519 throw lang::IllegalArgumentException( C2U("Property Vertical requires boolean value"), 0, 0 );
1521 m_aOuterValue
= rOuterValue
;
1523 Reference
< chart2::XDiagram
> xDiagram( m_spChart2ModelContact
->getChart2Diagram() );
1524 if( !xDiagram
.is() )
1527 bool bFound
= false;
1528 bool bAmbiguous
= false;
1529 sal_Bool bOldVertical
= DiagramHelper::getVertical( xDiagram
, bFound
, bAmbiguous
);
1530 if( bFound
&& ( bOldVertical
!= bNewVertical
|| bAmbiguous
) )
1531 DiagramHelper::setVertical( xDiagram
, bNewVertical
);
1534 Any
WrappedVerticalProperty::getPropertyValue( const Reference
< beans::XPropertySet
>& /*xInnerPropertySet*/ ) const
1535 throw (beans::UnknownPropertyException
, lang::WrappedTargetException
, uno::RuntimeException
)
1537 bool bFound
= false;
1538 bool bAmbiguous
= false;
1539 Reference
< chart2::XDiagram
> xDiagram( m_spChart2ModelContact
->getChart2Diagram() );
1542 sal_Bool bVertical
= DiagramHelper::getVertical( xDiagram
, bFound
, bAmbiguous
);
1544 m_aOuterValue
<<= bVertical
;
1546 return m_aOuterValue
;
1549 Any
WrappedVerticalProperty::getPropertyDefault( const Reference
< beans::XPropertyState
>& /*xInnerPropertyState*/ ) const
1550 throw (beans::UnknownPropertyException
, lang::WrappedTargetException
, uno::RuntimeException
)
1553 aRet
<<= sal_Bool( sal_False
);
1557 //-----------------------------------------------------------------------------------------------------------------
1558 //-----------------------------------------------------------------------------------------------------------------
1559 //-----------------------------------------------------------------------------------------------------------------
1561 //PROP_DIAGRAM_NUMBER_OF_LINES
1562 class WrappedNumberOfLinesProperty
: public WrappedProperty
1565 WrappedNumberOfLinesProperty( ::boost::shared_ptr
< Chart2ModelContact
> spChart2ModelContact
);
1566 virtual ~WrappedNumberOfLinesProperty();
1568 virtual void setPropertyValue( const ::com::sun::star::uno::Any
& rOuterValue
, const ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertySet
>& xInnerPropertySet
) const
1569 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
);
1571 virtual ::com::sun::star::uno::Any
getPropertyValue( const ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertySet
>& xInnerPropertySet
) const
1572 throw (::com::sun::star::beans::UnknownPropertyException
, ::com::sun::star::lang::WrappedTargetException
, ::com::sun::star::uno::RuntimeException
);
1574 virtual ::com::sun::star::uno::Any
getPropertyDefault( const ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertyState
>& xInnerPropertyState
) const
1575 throw (::com::sun::star::beans::UnknownPropertyException
, ::com::sun::star::lang::WrappedTargetException
, ::com::sun::star::uno::RuntimeException
);
1577 protected: //methods
1578 bool detectInnerValue( uno::Any
& rInnerValue
) const;
1581 ::boost::shared_ptr
< Chart2ModelContact
> m_spChart2ModelContact
;
1582 mutable Any m_aOuterValue
;
1585 WrappedNumberOfLinesProperty::WrappedNumberOfLinesProperty( ::boost::shared_ptr
< Chart2ModelContact
> spChart2ModelContact
)
1586 : WrappedProperty(C2U("NumberOfLines"),OUString())
1587 , m_spChart2ModelContact( spChart2ModelContact
)
1588 , m_aOuterValue( this->getPropertyDefault(0) )
1592 WrappedNumberOfLinesProperty::~WrappedNumberOfLinesProperty()
1596 bool WrappedNumberOfLinesProperty::detectInnerValue( uno::Any
& rInnerValue
) const
1598 sal_Int32 nNumberOfLines
= 0;
1599 bool bHasDetectableInnerValue
= false;
1600 Reference
< chart2::XDiagram
> xDiagram( m_spChart2ModelContact
->getChart2Diagram() );
1601 uno::Reference
< chart2::XChartDocument
> xChartDoc( m_spChart2ModelContact
->getChart2Document() );
1602 if( xDiagram
.is() && xChartDoc
.is() )
1604 ::std::vector
< uno::Reference
< chart2::XDataSeries
> > aSeriesVector(
1605 DiagramHelper::getDataSeriesFromDiagram( xDiagram
) );
1606 if( aSeriesVector
.size() > 0 )
1608 Reference
< lang::XMultiServiceFactory
> xFact( xChartDoc
->getChartTypeManager(), uno::UNO_QUERY
);
1609 DiagramHelper::tTemplateWithServiceName aTemplateAndService
=
1610 DiagramHelper::getTemplateForDiagram( xDiagram
, xFact
);
1611 if( aTemplateAndService
.second
.equals( C2U( "com.sun.star.chart2.template.ColumnWithLine" ) ) )
1615 uno::Reference
< beans::XPropertySet
> xProp( aTemplateAndService
.first
, uno::UNO_QUERY
);
1616 xProp
->getPropertyValue( m_aOuterName
) >>= nNumberOfLines
;
1617 bHasDetectableInnerValue
= true;
1619 catch( uno::Exception
& ex
)
1621 ASSERT_EXCEPTION( ex
);
1626 if(bHasDetectableInnerValue
)
1627 rInnerValue
= uno::makeAny(nNumberOfLines
);
1628 return bHasDetectableInnerValue
;
1631 void WrappedNumberOfLinesProperty::setPropertyValue( const Any
& rOuterValue
, const Reference
< beans::XPropertySet
>& /*xInnerPropertySet*/ ) const
1632 throw (beans::UnknownPropertyException
, beans::PropertyVetoException
, lang::IllegalArgumentException
, lang::WrappedTargetException
, uno::RuntimeException
)
1634 sal_Int32 nNewValue
;
1635 if( ! (rOuterValue
>>= nNewValue
) )
1636 throw lang::IllegalArgumentException( C2U("property NumberOfLines requires sal_Int32 value"), 0, 0 );
1638 m_aOuterValue
= rOuterValue
;
1640 uno::Reference
< chart2::XChartDocument
> xChartDoc( m_spChart2ModelContact
->getChart2Document() );
1641 Reference
< chart2::XDiagram
> xDiagram( m_spChart2ModelContact
->getChart2Diagram() );
1642 sal_Int32 nDimension
= ::chart::DiagramHelper::getDimension( xDiagram
);
1643 if( xChartDoc
.is() && xDiagram
.is() && nDimension
== 2 )
1645 Reference
< lang::XMultiServiceFactory
> xFact( xChartDoc
->getChartTypeManager(), uno::UNO_QUERY
);
1646 DiagramHelper::tTemplateWithServiceName aTemplateAndService
=
1647 DiagramHelper::getTemplateForDiagram( xDiagram
, xFact
);
1649 uno::Reference
< chart2::XChartTypeTemplate
> xTemplate(0);
1650 if( aTemplateAndService
.second
.equals( C2U( "com.sun.star.chart2.template.ColumnWithLine" ) ) )
1652 if( nNewValue
!= 0 )
1654 xTemplate
.set( aTemplateAndService
.first
);
1657 sal_Int32 nOldValue
= 0;
1658 uno::Reference
< beans::XPropertySet
> xProp( xTemplate
, uno::UNO_QUERY
);
1659 xProp
->getPropertyValue( m_aOuterName
) >>= nOldValue
;
1660 if( nOldValue
== nNewValue
)
1663 catch( uno::Exception
& ex
)
1665 ASSERT_EXCEPTION( ex
);
1670 xTemplate
.set( xFact
->createInstance( C2U( "com.sun.star.chart2.template.Column" ) ), uno::UNO_QUERY
);
1673 else if( aTemplateAndService
.second
.equals( C2U( "com.sun.star.chart2.template.Column" ) ) )
1675 if( nNewValue
== 0 )
1677 xTemplate
.set( xFact
->createInstance( C2U( "com.sun.star.chart2.template.ColumnWithLine" ) ), uno::UNO_QUERY
);
1684 // /-- locked controllers
1685 ControllerLockGuard
aCtrlLockGuard( m_spChart2ModelContact
->getChartModel() );
1686 uno::Reference
< beans::XPropertySet
> xProp( xTemplate
, uno::UNO_QUERY
);
1687 xProp
->setPropertyValue( C2U( "NumberOfLines" ), uno::makeAny(nNewValue
) );
1688 xTemplate
->changeDiagram( xDiagram
);
1689 // \-- locked controllers
1691 catch( uno::Exception
& ex
)
1693 ASSERT_EXCEPTION( ex
);
1699 Any
WrappedNumberOfLinesProperty::getPropertyValue( const Reference
< beans::XPropertySet
>& /*xInnerPropertySet*/ ) const
1700 throw (beans::UnknownPropertyException
, lang::WrappedTargetException
, uno::RuntimeException
)
1703 if( !detectInnerValue( aRet
) )
1704 aRet
= m_aOuterValue
;
1708 Any
WrappedNumberOfLinesProperty::getPropertyDefault( const Reference
< beans::XPropertyState
>& /*xInnerPropertyState*/ ) const
1709 throw (beans::UnknownPropertyException
, lang::WrappedTargetException
, uno::RuntimeException
)
1712 aRet
<<= sal_Int32( 0 );
1716 //-----------------------------------------------------------------------------------------------------------------
1717 //-----------------------------------------------------------------------------------------------------------------
1718 //-----------------------------------------------------------------------------------------------------------------
1720 //PROP_DIAGRAM_ATTRIBUTED_DATA_POINTS
1721 class WrappedAttributedDataPointsProperty
: public WrappedProperty
1724 WrappedAttributedDataPointsProperty( ::boost::shared_ptr
< Chart2ModelContact
> spChart2ModelContact
);
1725 virtual ~WrappedAttributedDataPointsProperty();
1727 virtual void setPropertyValue( const ::com::sun::star::uno::Any
& rOuterValue
, const ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertySet
>& xInnerPropertySet
) const
1728 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
);
1730 virtual ::com::sun::star::uno::Any
getPropertyValue( const ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertySet
>& xInnerPropertySet
) const
1731 throw (::com::sun::star::beans::UnknownPropertyException
, ::com::sun::star::lang::WrappedTargetException
, ::com::sun::star::uno::RuntimeException
);
1733 virtual ::com::sun::star::uno::Any
getPropertyDefault( const ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertyState
>& xInnerPropertyState
) const
1734 throw (::com::sun::star::beans::UnknownPropertyException
, ::com::sun::star::lang::WrappedTargetException
, ::com::sun::star::uno::RuntimeException
);
1737 ::boost::shared_ptr
< Chart2ModelContact
> m_spChart2ModelContact
;
1738 mutable Any m_aOuterValue
;
1741 WrappedAttributedDataPointsProperty::WrappedAttributedDataPointsProperty( ::boost::shared_ptr
< Chart2ModelContact
> spChart2ModelContact
)
1742 : WrappedProperty(C2U("AttributedDataPoints"),OUString())
1743 , m_spChart2ModelContact( spChart2ModelContact
)
1746 m_aOuterValue
= WrappedAttributedDataPointsProperty::getPropertyDefault( 0 );
1749 WrappedAttributedDataPointsProperty::~WrappedAttributedDataPointsProperty()
1753 void WrappedAttributedDataPointsProperty::setPropertyValue( const Any
& rOuterValue
, const Reference
< beans::XPropertySet
>& /*xInnerPropertySet*/ ) const
1754 throw (beans::UnknownPropertyException
, beans::PropertyVetoException
, lang::IllegalArgumentException
, lang::WrappedTargetException
, uno::RuntimeException
)
1756 uno::Sequence
< uno::Sequence
< sal_Int32
> > aNewValue
;
1757 if( ! (rOuterValue
>>= aNewValue
) )
1758 throw lang::IllegalArgumentException( C2U("Property AttributedDataPoints requires value of type uno::Sequence< uno::Sequence< sal_Int32 > >"), 0, 0 );
1760 m_aOuterValue
= rOuterValue
;
1762 Reference
< chart2::XDiagram
> xDiagram( m_spChart2ModelContact
->getChart2Diagram() );
1763 Reference
< beans::XPropertySet
> xDiaProp( xDiagram
, uno::UNO_QUERY
);
1765 if( xDiagram
.is() && xDiaProp
.is())
1767 ::std::vector
< Reference
< chart2::XDataSeries
> > aSeriesVector(
1768 ::chart::DiagramHelper::getDataSeriesFromDiagram( xDiagram
) );
1770 uno::Sequence
< uno::Sequence
< sal_Int32
> > aResult( aSeriesVector
.size() );
1772 ::std::vector
< Reference
< chart2::XDataSeries
> >::const_iterator aIt
=
1773 aSeriesVector
.begin();
1775 for( ; aIt
!= aSeriesVector
.end(); ++aIt
, ++i
)
1777 Reference
< beans::XPropertySet
> xProp( *aIt
, uno::UNO_QUERY
);
1781 if( i
< aNewValue
.getLength() )
1782 aVal
<<= aNewValue
[i
];
1785 //set empty sequence
1786 uno::Sequence
< sal_Int32
> aSeq
;
1789 xProp
->setPropertyValue( C2U( "AttributedDataPoints" ), aVal
);
1795 Any
WrappedAttributedDataPointsProperty::getPropertyValue( const Reference
< beans::XPropertySet
>& /*xInnerPropertySet*/ ) const
1796 throw (beans::UnknownPropertyException
, lang::WrappedTargetException
, uno::RuntimeException
)
1798 Reference
< chart2::XDiagram
> xDiagram( m_spChart2ModelContact
->getChart2Diagram() );
1799 Reference
< beans::XPropertySet
> xDiaProp( xDiagram
, uno::UNO_QUERY
);
1801 if( xDiagram
.is() && xDiaProp
.is())
1803 ::std::vector
< Reference
< chart2::XDataSeries
> > aSeriesVector(
1804 ::chart::DiagramHelper::getDataSeriesFromDiagram( xDiagram
) );
1806 uno::Sequence
< uno::Sequence
< sal_Int32
> > aResult( aSeriesVector
.size() );
1808 ::std::vector
< Reference
< chart2::XDataSeries
> >::const_iterator aIt
=
1809 aSeriesVector
.begin();
1811 for( ; aIt
!= aSeriesVector
.end(); ++aIt
, ++i
)
1813 Reference
< beans::XPropertySet
> xProp( *aIt
, uno::UNO_QUERY
);
1817 xProp
->getPropertyValue( C2U( "AttributedDataPoints" )));
1818 uno::Sequence
< sal_Int32
> aSeq
;
1820 aResult
[ i
] = aSeq
;
1823 m_aOuterValue
<<= aResult
;
1825 return m_aOuterValue
;
1828 Any
WrappedAttributedDataPointsProperty::getPropertyDefault( const Reference
< beans::XPropertyState
>& /*xInnerPropertyState*/ ) const
1829 throw (beans::UnknownPropertyException
, lang::WrappedTargetException
, uno::RuntimeException
)
1832 uno::Sequence
< uno::Sequence
< sal_Int32
> > aSeq
;
1837 //-----------------------------------------------------------------------------------------------------------------
1838 //-----------------------------------------------------------------------------------------------------------------
1839 //-----------------------------------------------------------------------------------------------------------------
1841 //PROP_DIAGRAM_SOLIDTYPE
1842 class WrappedSolidTypeProperty
: public WrappedProperty
1845 WrappedSolidTypeProperty( ::boost::shared_ptr
< Chart2ModelContact
> spChart2ModelContact
);
1846 virtual ~WrappedSolidTypeProperty();
1848 virtual void setPropertyValue( const ::com::sun::star::uno::Any
& rOuterValue
, const ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertySet
>& xInnerPropertySet
) const
1849 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
);
1851 virtual ::com::sun::star::uno::Any
getPropertyValue( const ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertySet
>& xInnerPropertySet
) const
1852 throw (::com::sun::star::beans::UnknownPropertyException
, ::com::sun::star::lang::WrappedTargetException
, ::com::sun::star::uno::RuntimeException
);
1854 virtual ::com::sun::star::uno::Any
getPropertyDefault( const ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertyState
>& xInnerPropertyState
) const
1855 throw (::com::sun::star::beans::UnknownPropertyException
, ::com::sun::star::lang::WrappedTargetException
, ::com::sun::star::uno::RuntimeException
);
1858 ::boost::shared_ptr
< Chart2ModelContact
> m_spChart2ModelContact
;
1859 mutable Any m_aOuterValue
;
1862 WrappedSolidTypeProperty::WrappedSolidTypeProperty( ::boost::shared_ptr
< Chart2ModelContact
> spChart2ModelContact
)
1863 : WrappedProperty( C2U( "SolidType" ), OUString() )
1864 , m_spChart2ModelContact( spChart2ModelContact
)
1867 m_aOuterValue
= WrappedSolidTypeProperty::getPropertyDefault( 0 );
1870 WrappedSolidTypeProperty::~WrappedSolidTypeProperty()
1874 void WrappedSolidTypeProperty::setPropertyValue( const Any
& rOuterValue
, const Reference
< beans::XPropertySet
>& /*xInnerPropertySet*/ ) const
1875 throw (beans::UnknownPropertyException
, beans::PropertyVetoException
, lang::IllegalArgumentException
, lang::WrappedTargetException
, uno::RuntimeException
)
1877 sal_Int32 nNewSolidType
= ::com::sun::star::chart::ChartSolidType::RECTANGULAR_SOLID
;
1878 if( ! (rOuterValue
>>= nNewSolidType
) )
1879 throw lang::IllegalArgumentException( C2U("Property SolidType requires integer value"), 0, 0 );
1881 m_aOuterValue
= rOuterValue
;
1883 Reference
< chart2::XDiagram
> xDiagram( m_spChart2ModelContact
->getChart2Diagram() );
1884 if( !xDiagram
.is() )
1887 bool bFound
= false;
1888 bool bAmbiguous
= false;
1889 sal_Int32 nOldSolidType
= DiagramHelper::getGeometry3D( xDiagram
, bFound
, bAmbiguous
);
1890 if( bFound
&& ( nOldSolidType
!= nNewSolidType
|| bAmbiguous
) )
1891 DiagramHelper::setGeometry3D( xDiagram
, nNewSolidType
);
1894 Any
WrappedSolidTypeProperty::getPropertyValue( const Reference
< beans::XPropertySet
>& /*xInnerPropertySet*/ ) const
1895 throw (beans::UnknownPropertyException
, lang::WrappedTargetException
, uno::RuntimeException
)
1897 bool bFound
= false;
1898 bool bAmbiguous
= false;
1899 Reference
< chart2::XDiagram
> xDiagram( m_spChart2ModelContact
->getChart2Diagram() );
1902 sal_Int32 nGeometry
= DiagramHelper::getGeometry3D( xDiagram
, bFound
, bAmbiguous
);
1904 m_aOuterValue
<<= nGeometry
;
1906 return m_aOuterValue
;
1909 Any
WrappedSolidTypeProperty::getPropertyDefault( const Reference
< beans::XPropertyState
>& /*xInnerPropertyState*/ ) const
1910 throw (beans::UnknownPropertyException
, lang::WrappedTargetException
, uno::RuntimeException
)
1912 return uno::makeAny( ::com::sun::star::chart::ChartSolidType::RECTANGULAR_SOLID
);
1915 //-----------------------------------------------------------------------------------------------------------------
1916 //-----------------------------------------------------------------------------------------------------------------
1917 //-----------------------------------------------------------------------------------------------------------------
1919 class WrappedAutomaticSizeProperty
: public WrappedProperty
1922 WrappedAutomaticSizeProperty();
1923 virtual ~WrappedAutomaticSizeProperty();
1925 virtual void setPropertyValue( const ::com::sun::star::uno::Any
& rOuterValue
, const ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertySet
>& xInnerPropertySet
) const
1926 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
);
1928 virtual ::com::sun::star::uno::Any
getPropertyValue( const ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertySet
>& xInnerPropertySet
) const
1929 throw (::com::sun::star::beans::UnknownPropertyException
, ::com::sun::star::lang::WrappedTargetException
, ::com::sun::star::uno::RuntimeException
);
1931 virtual ::com::sun::star::uno::Any
getPropertyDefault( const ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertyState
>& xInnerPropertyState
) const
1932 throw (::com::sun::star::beans::UnknownPropertyException
, ::com::sun::star::lang::WrappedTargetException
, ::com::sun::star::uno::RuntimeException
);
1935 WrappedAutomaticSizeProperty::WrappedAutomaticSizeProperty()
1936 : WrappedProperty( C2U( "AutomaticSize" ), OUString() )
1940 WrappedAutomaticSizeProperty::~WrappedAutomaticSizeProperty()
1944 void WrappedAutomaticSizeProperty::setPropertyValue( const Any
& rOuterValue
, const Reference
< beans::XPropertySet
>& xInnerPropertySet
) const
1945 throw (beans::UnknownPropertyException
, beans::PropertyVetoException
, lang::IllegalArgumentException
, lang::WrappedTargetException
, uno::RuntimeException
)
1947 if( xInnerPropertySet
.is() )
1949 bool bNewValue
= true;
1950 if( ! (rOuterValue
>>= bNewValue
) )
1951 throw lang::IllegalArgumentException( C2U("Property AutomaticSize requires value of type boolean"), 0, 0 );
1957 Any
aRelativeSize( xInnerPropertySet
->getPropertyValue( C2U( "RelativeSize" ) ) );
1958 if( aRelativeSize
.hasValue() )
1959 xInnerPropertySet
->setPropertyValue( C2U( "RelativeSize" ), Any() );
1962 catch( uno::Exception
& ex
)
1964 ASSERT_EXCEPTION( ex
);
1969 Any
WrappedAutomaticSizeProperty::getPropertyValue( const Reference
< beans::XPropertySet
>& xInnerPropertySet
) const
1970 throw (beans::UnknownPropertyException
, lang::WrappedTargetException
, uno::RuntimeException
)
1972 Any
aRet( getPropertyDefault( Reference
< beans::XPropertyState
>( xInnerPropertySet
, uno::UNO_QUERY
) ) );
1973 if( xInnerPropertySet
.is() )
1975 Any
aRelativeSize( xInnerPropertySet
->getPropertyValue( C2U( "RelativeSize" ) ) );
1976 if( !aRelativeSize
.hasValue() )
1982 Any
WrappedAutomaticSizeProperty::getPropertyDefault( const Reference
< beans::XPropertyState
>& /*xInnerPropertyState*/ ) const
1983 throw (beans::UnknownPropertyException
, lang::WrappedTargetException
, uno::RuntimeException
)
1990 //-----------------------------------------------------------------------------------------------------------------
1991 //-----------------------------------------------------------------------------------------------------------------
1992 //-----------------------------------------------------------------------------------------------------------------
1994 //PROP_DIAGRAM_INCLUDE_HIDDEN_CELLS
1995 class WrappedIncludeHiddenCellsProperty
: public WrappedProperty
1998 WrappedIncludeHiddenCellsProperty( ::boost::shared_ptr
< Chart2ModelContact
> spChart2ModelContact
);
1999 virtual ~WrappedIncludeHiddenCellsProperty();
2001 virtual void setPropertyValue( const ::com::sun::star::uno::Any
& rOuterValue
, const ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertySet
>& xInnerPropertySet
) const
2002 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
);
2005 ::boost::shared_ptr
< Chart2ModelContact
> m_spChart2ModelContact
;
2008 WrappedIncludeHiddenCellsProperty::WrappedIncludeHiddenCellsProperty( ::boost::shared_ptr
< Chart2ModelContact
> spChart2ModelContact
)
2009 : WrappedProperty(C2U("IncludeHiddenCells"),C2U("IncludeHiddenCells"))
2010 , m_spChart2ModelContact( spChart2ModelContact
)
2014 WrappedIncludeHiddenCellsProperty::~WrappedIncludeHiddenCellsProperty()
2018 void WrappedIncludeHiddenCellsProperty::setPropertyValue( const Any
& rOuterValue
, const Reference
< beans::XPropertySet
>& /*xInnerPropertySet*/ ) const
2019 throw (beans::UnknownPropertyException
, beans::PropertyVetoException
, lang::IllegalArgumentException
, lang::WrappedTargetException
, uno::RuntimeException
)
2021 sal_Bool bNewValue
= false;
2022 if( ! (rOuterValue
>>= bNewValue
) )
2023 throw lang::IllegalArgumentException( C2U("Property Dim3D requires boolean value"), 0, 0 );
2025 ChartModelHelper::setIncludeHiddenCells( bNewValue
, m_spChart2ModelContact
->getChartModel() );
2028 //-----------------------------------------------------------------------------------------------------------------
2029 //-----------------------------------------------------------------------------------------------------------------
2030 //-----------------------------------------------------------------------------------------------------------------
2032 // ____ XDiagramProvider ____
2033 Reference
< chart2::XDiagram
> SAL_CALL
DiagramWrapper::getDiagram()
2034 throw (uno::RuntimeException
)
2036 return m_spChart2ModelContact
->getChart2Diagram();
2039 void SAL_CALL
DiagramWrapper::setDiagram(
2040 const Reference
< chart2::XDiagram
>& /*xDiagram*/ )
2041 throw (uno::RuntimeException
)
2043 //@todo: remove this method from interface
2044 DBG_ERROR("DiagramWrapper::setDiagram is not implemented, should be removed and not be called" );
2047 // ================================================================================
2049 Reference
< beans::XPropertySet
> DiagramWrapper::getInnerPropertySet()
2051 return Reference
< beans::XPropertySet
>( m_spChart2ModelContact
->getChart2Diagram(), uno::UNO_QUERY
);
2054 const Sequence
< beans::Property
>& DiagramWrapper::getPropertySequence()
2056 return lcl_GetPropertySequence();
2059 const std::vector
< WrappedProperty
* > DiagramWrapper::createWrappedProperties()
2061 ::std::vector
< ::chart::WrappedProperty
* > aWrappedProperties
;
2063 WrappedAxisAndGridExistenceProperties::addWrappedProperties( aWrappedProperties
, m_spChart2ModelContact
);
2064 WrappedAxisTitleExistenceProperties::addWrappedProperties( aWrappedProperties
, m_spChart2ModelContact
);
2065 WrappedAxisLabelExistenceProperties::addWrappedProperties( aWrappedProperties
, m_spChart2ModelContact
);
2066 WrappedSceneProperty::addWrappedProperties( aWrappedProperties
, m_spChart2ModelContact
);
2067 WrappedIgnoreProperties::addIgnoreFillProperties( aWrappedProperties
);
2068 WrappedIgnoreProperties::addIgnoreLineProperties( aWrappedProperties
);
2069 WrappedStatisticProperties::addWrappedPropertiesForDiagram( aWrappedProperties
, m_spChart2ModelContact
);
2070 WrappedSymbolProperties::addWrappedPropertiesForDiagram( aWrappedProperties
, m_spChart2ModelContact
);
2071 WrappedDataCaptionProperties::addWrappedPropertiesForDiagram( aWrappedProperties
, m_spChart2ModelContact
);
2072 WrappedSplineProperties::addWrappedProperties( aWrappedProperties
, m_spChart2ModelContact
);
2073 WrappedStockProperties::addWrappedProperties( aWrappedProperties
, m_spChart2ModelContact
);
2074 WrappedAutomaticPositionProperties::addWrappedProperties( aWrappedProperties
);
2076 aWrappedProperties
.push_back( new WrappedDataRowSourceProperty( m_spChart2ModelContact
) );
2077 aWrappedProperties
.push_back( new WrappedStackingProperty( StackMode_Y_STACKED
,m_spChart2ModelContact
) );
2078 aWrappedProperties
.push_back( new WrappedStackingProperty( StackMode_Y_STACKED_PERCENT
, m_spChart2ModelContact
) );
2079 aWrappedProperties
.push_back( new WrappedStackingProperty( StackMode_Z_STACKED
, m_spChart2ModelContact
) );
2080 aWrappedProperties
.push_back( new WrappedDim3DProperty( m_spChart2ModelContact
) );
2081 aWrappedProperties
.push_back( new WrappedVerticalProperty( m_spChart2ModelContact
) );
2082 aWrappedProperties
.push_back( new WrappedNumberOfLinesProperty( m_spChart2ModelContact
) );
2083 aWrappedProperties
.push_back( new WrappedAttributedDataPointsProperty( m_spChart2ModelContact
) );
2084 aWrappedProperties
.push_back( new WrappedProperty( C2U( "StackedBarsConnected" ), C2U( "ConnectBars" ) ) );
2085 aWrappedProperties
.push_back( new WrappedSolidTypeProperty( m_spChart2ModelContact
) );
2086 aWrappedProperties
.push_back( new WrappedAutomaticSizeProperty() );
2087 aWrappedProperties
.push_back( new WrappedIncludeHiddenCellsProperty( m_spChart2ModelContact
) );
2089 return aWrappedProperties
;
2092 // ================================================================================
2094 uno::Sequence
< OUString
> DiagramWrapper::getSupportedServiceNames_Static()
2096 uno::Sequence
< OUString
> aServices( 8 );
2097 aServices
[ 0 ] = C2U( "com.sun.star.chart.Diagram" );
2098 aServices
[ 1 ] = C2U( "com.sun.star.xml.UserDefinedAttributeSupplier" );
2099 aServices
[ 2 ] = C2U( "com.sun.star.chart.StackableDiagram" );
2100 aServices
[ 3 ] = C2U( "com.sun.star.chart.ChartAxisXSupplier" );
2101 aServices
[ 4 ] = C2U( "com.sun.star.chart.ChartAxisYSupplier" );
2102 aServices
[ 5 ] = C2U( "com.sun.star.chart.ChartAxisZSupplier" );
2103 aServices
[ 6 ] = C2U( "com.sun.star.chart.ChartTwoAxisXSupplier" );
2104 aServices
[ 7 ] = C2U( "com.sun.star.chart.ChartTwoAxisYSupplier" );
2105 // aServices[ x ] = C2U( "com.sun.star.beans.PropertySet" );
2106 // aServices[ x ] = C2U( "com.sun.star.drawing.FillProperties" );
2107 // aServices[ x ] = C2U( "com.sun.star.drawing.LineProperties" );
2112 // implement XServiceInfo methods basing upon getSupportedServiceNames_Static
2113 APPHELPER_XSERVICEINFO_IMPL( DiagramWrapper
, lcl_aServiceName
);
2115 } // namespace wrapper
2116 } // namespace chart