Version 6.4.0.0.beta1, tag libreoffice-6.4.0.0.beta1
[LibreOffice.git] / chart2 / source / controller / chartapiwrapper / AxisWrapper.cxx
blobfd28c36a4ff7b2fb4aed6e41663a55c60edcdd8e
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #include "AxisWrapper.hxx"
21 #include <AxisHelper.hxx>
22 #include <TitleHelper.hxx>
23 #include "Chart2ModelContact.hxx"
24 #include <WrappedDirectStateProperty.hxx>
25 #include "GridWrapper.hxx"
26 #include "TitleWrapper.hxx"
27 #include <DisposeHelper.hxx>
28 #include <unonames.hxx>
30 #include <comphelper/sequence.hxx>
31 #include <cppuhelper/supportsservice.hxx>
32 #include <com/sun/star/beans/PropertyAttribute.hpp>
33 #include <com/sun/star/chart/ChartAxisArrangeOrderType.hpp>
34 #include <com/sun/star/chart/ChartAxisPosition.hpp>
35 #include <com/sun/star/chart/ChartAxisLabelPosition.hpp>
36 #include <com/sun/star/chart/ChartAxisMarkPosition.hpp>
38 #include <CharacterProperties.hxx>
39 #include <LinePropertiesHelper.hxx>
40 #include <UserDefinedProperties.hxx>
41 #include "WrappedCharacterHeightProperty.hxx"
42 #include "WrappedTextRotationProperty.hxx"
43 #include "WrappedGapwidthProperty.hxx"
44 #include "WrappedScaleProperty.hxx"
45 #include "WrappedNumberFormatProperty.hxx"
46 #include "WrappedScaleTextProperties.hxx"
48 #include <algorithm>
49 #include <tools/diagnose_ex.h>
51 using namespace ::com::sun::star;
52 using namespace ::com::sun::star::chart2;
54 using ::com::sun::star::beans::Property;
55 using ::com::sun::star::uno::Reference;
56 using ::com::sun::star::uno::Sequence;
57 using ::com::sun::star::uno::Any;
59 namespace
62 enum
64 PROP_AXIS_MAX,
65 PROP_AXIS_MIN,
66 PROP_AXIS_STEPMAIN,
67 PROP_AXIS_STEPHELP, //deprecated property use 'StepHelpCount' instead
68 PROP_AXIS_STEPHELP_COUNT,
69 PROP_AXIS_AUTO_MAX,
70 PROP_AXIS_AUTO_MIN,
71 PROP_AXIS_AUTO_STEPMAIN,
72 PROP_AXIS_AUTO_STEPHELP,
73 PROP_AXIS_TYPE,
74 PROP_AXIS_TIME_INCREMENT,
75 PROP_AXIS_EXPLICIT_TIME_INCREMENT,
76 PROP_AXIS_LOGARITHMIC,
77 PROP_AXIS_REVERSEDIRECTION,
78 PROP_AXIS_VISIBLE,
79 PROP_AXIS_CROSSOVER_POSITION,
80 PROP_AXIS_CROSSOVER_VALUE,
81 PROP_AXIS_ORIGIN,
82 PROP_AXIS_AUTO_ORIGIN,
83 PROP_AXIS_MARKS,
84 PROP_AXIS_HELPMARKS,
85 PROP_AXIS_MARK_POSITION,
86 PROP_AXIS_DISPLAY_LABELS,
87 PROP_AXIS_NUMBERFORMAT,
88 PROP_AXIS_LINK_NUMBERFORMAT_TO_SOURCE,
89 PROP_AXIS_LABEL_POSITION,
90 PROP_AXIS_TEXT_ROTATION,
91 PROP_AXIS_ARRANGE_ORDER,
92 PROP_AXIS_TEXTBREAK,
93 PROP_AXIS_CAN_OVERLAP,
94 PROP_AXIS_STACKEDTEXT,
95 PROP_AXIS_OVERLAP,
96 PROP_AXIS_GAP_WIDTH,
97 PROP_AXIS_DISPLAY_UNITS,
98 PROP_AXIS_BUILTINUNIT,
99 PROP_AXIS_TRY_STAGGERING_FIRST
102 void lcl_AddPropertiesToVector(
103 std::vector< Property > & rOutProperties )
105 //Properties for scaling:
106 rOutProperties.emplace_back( "Max",
107 PROP_AXIS_MAX,
108 cppu::UnoType<double>::get(),
109 beans::PropertyAttribute::BOUND
110 | beans::PropertyAttribute::MAYBEVOID );
112 rOutProperties.emplace_back( "Min",
113 PROP_AXIS_MIN,
114 cppu::UnoType<double>::get(),
115 beans::PropertyAttribute::BOUND
116 | beans::PropertyAttribute::MAYBEVOID );
118 rOutProperties.emplace_back( "StepMain",
119 PROP_AXIS_STEPMAIN,
120 cppu::UnoType<double>::get(),
121 beans::PropertyAttribute::BOUND
122 | beans::PropertyAttribute::MAYBEVOID );
124 rOutProperties.emplace_back( "StepHelpCount",
125 PROP_AXIS_STEPHELP_COUNT,
126 cppu::UnoType<sal_Int32>::get(),
127 beans::PropertyAttribute::BOUND
128 | beans::PropertyAttribute::MAYBEVOID );
130 //deprecated property use 'StepHelpCount' instead
131 rOutProperties.emplace_back( "StepHelp",
132 PROP_AXIS_STEPHELP,
133 cppu::UnoType<double>::get(),
134 beans::PropertyAttribute::BOUND
135 | beans::PropertyAttribute::MAYBEVOID );
137 rOutProperties.emplace_back( "AutoMax",
138 PROP_AXIS_AUTO_MAX,
139 cppu::UnoType<bool>::get(),
140 //#i111967# no PropertyChangeEvent is fired on change so far
141 beans::PropertyAttribute::MAYBEDEFAULT );
143 rOutProperties.emplace_back( "AutoMin",
144 PROP_AXIS_AUTO_MIN,
145 cppu::UnoType<bool>::get(),
146 //#i111967# no PropertyChangeEvent is fired on change so far
147 beans::PropertyAttribute::MAYBEDEFAULT );
149 rOutProperties.emplace_back( "AutoStepMain",
150 PROP_AXIS_AUTO_STEPMAIN,
151 cppu::UnoType<bool>::get(),
152 //#i111967# no PropertyChangeEvent is fired on change so far
153 beans::PropertyAttribute::MAYBEDEFAULT );
155 rOutProperties.emplace_back( "AutoStepHelp",
156 PROP_AXIS_AUTO_STEPHELP,
157 cppu::UnoType<bool>::get(),
158 //#i111967# no PropertyChangeEvent is fired on change so far
159 beans::PropertyAttribute::MAYBEDEFAULT );
161 rOutProperties.emplace_back( "AxisType",
162 PROP_AXIS_TYPE,
163 cppu::UnoType<sal_Int32>::get(), //type css::chart::ChartAxisType
164 //#i111967# no PropertyChangeEvent is fired on change so far
165 beans::PropertyAttribute::MAYBEDEFAULT );
167 rOutProperties.emplace_back( "TimeIncrement",
168 PROP_AXIS_TIME_INCREMENT,
169 cppu::UnoType<css::chart::TimeIncrement>::get(),
170 //#i111967# no PropertyChangeEvent is fired on change so far
171 beans::PropertyAttribute::MAYBEVOID );
173 rOutProperties.emplace_back( "ExplicitTimeIncrement",
174 PROP_AXIS_EXPLICIT_TIME_INCREMENT,
175 cppu::UnoType<css::chart::TimeIncrement>::get(),
176 beans::PropertyAttribute::READONLY |
177 beans::PropertyAttribute::MAYBEVOID );
179 rOutProperties.emplace_back( "Logarithmic",
180 PROP_AXIS_LOGARITHMIC,
181 cppu::UnoType<bool>::get(),
182 //#i111967# no PropertyChangeEvent is fired on change so far
183 beans::PropertyAttribute::MAYBEDEFAULT );
185 rOutProperties.emplace_back( "ReverseDirection",
186 PROP_AXIS_REVERSEDIRECTION,
187 cppu::UnoType<bool>::get(),
188 //#i111967# no PropertyChangeEvent is fired on change so far
189 beans::PropertyAttribute::MAYBEDEFAULT );
191 //todo: this property is missing in the API
192 rOutProperties.emplace_back( "Visible",
193 PROP_AXIS_VISIBLE,
194 cppu::UnoType<bool>::get(),
195 beans::PropertyAttribute::BOUND
196 | beans::PropertyAttribute::MAYBEDEFAULT );
198 rOutProperties.emplace_back( "CrossoverPosition",
199 PROP_AXIS_CROSSOVER_POSITION,
200 cppu::UnoType<css::chart::ChartAxisPosition>::get(),
201 beans::PropertyAttribute::MAYBEDEFAULT );
203 rOutProperties.emplace_back( "CrossoverValue",
204 PROP_AXIS_CROSSOVER_VALUE,
205 cppu::UnoType<double>::get(),
206 beans::PropertyAttribute::MAYBEVOID );
208 rOutProperties.emplace_back( "Origin",
209 PROP_AXIS_ORIGIN,
210 cppu::UnoType<double>::get(),
211 beans::PropertyAttribute::BOUND
212 | beans::PropertyAttribute::MAYBEVOID );
214 rOutProperties.emplace_back( "AutoOrigin",
215 PROP_AXIS_AUTO_ORIGIN,
216 cppu::UnoType<bool>::get(),
217 //#i111967# no PropertyChangeEvent is fired on change so far
218 beans::PropertyAttribute::MAYBEDEFAULT );
220 //Properties for interval marks:
221 rOutProperties.emplace_back( "Marks",
222 PROP_AXIS_MARKS,
223 cppu::UnoType<sal_Int32>::get(),
224 beans::PropertyAttribute::BOUND
225 | beans::PropertyAttribute::MAYBEDEFAULT );
227 rOutProperties.emplace_back( "HelpMarks",
228 PROP_AXIS_HELPMARKS,
229 cppu::UnoType<sal_Int32>::get(),
230 beans::PropertyAttribute::BOUND
231 | beans::PropertyAttribute::MAYBEDEFAULT );
233 rOutProperties.emplace_back( "MarkPosition",
234 PROP_AXIS_MARK_POSITION,
235 cppu::UnoType<css::chart::ChartAxisMarkPosition>::get(),
236 beans::PropertyAttribute::MAYBEDEFAULT );
238 //Properties for labels:
239 rOutProperties.emplace_back( "DisplayLabels",
240 PROP_AXIS_DISPLAY_LABELS,
241 cppu::UnoType<bool>::get(),
242 beans::PropertyAttribute::BOUND
243 | beans::PropertyAttribute::MAYBEDEFAULT );
245 rOutProperties.emplace_back( CHART_UNONAME_NUMFMT,
246 PROP_AXIS_NUMBERFORMAT,
247 cppu::UnoType<sal_Int32>::get(),
248 beans::PropertyAttribute::BOUND
249 | beans::PropertyAttribute::MAYBEDEFAULT );
251 rOutProperties.emplace_back( CHART_UNONAME_LINK_TO_SRC_NUMFMT,
252 PROP_AXIS_LINK_NUMBERFORMAT_TO_SOURCE,
253 cppu::UnoType<bool>::get(),
254 beans::PropertyAttribute::BOUND
255 | beans::PropertyAttribute::MAYBEDEFAULT );
257 rOutProperties.emplace_back( "LabelPosition",
258 PROP_AXIS_LABEL_POSITION,
259 cppu::UnoType<css::chart::ChartAxisLabelPosition>::get(),
260 beans::PropertyAttribute::MAYBEDEFAULT );
262 rOutProperties.emplace_back( "TextRotation",
263 PROP_AXIS_TEXT_ROTATION,
264 cppu::UnoType<sal_Int32>::get(),
265 beans::PropertyAttribute::BOUND
266 | beans::PropertyAttribute::MAYBEDEFAULT );
268 rOutProperties.emplace_back( "ArrangeOrder",
269 PROP_AXIS_ARRANGE_ORDER,
270 cppu::UnoType<css::chart::ChartAxisArrangeOrderType>::get(),
271 beans::PropertyAttribute::BOUND
272 | beans::PropertyAttribute::MAYBEDEFAULT );
274 rOutProperties.emplace_back( "TextBreak",
275 PROP_AXIS_TEXTBREAK,
276 cppu::UnoType<bool>::get(),
277 beans::PropertyAttribute::BOUND
278 | beans::PropertyAttribute::MAYBEDEFAULT );
280 rOutProperties.emplace_back( "TextCanOverlap",
281 PROP_AXIS_CAN_OVERLAP,
282 cppu::UnoType<bool>::get(),
283 beans::PropertyAttribute::BOUND
284 | beans::PropertyAttribute::MAYBEDEFAULT );
286 rOutProperties.emplace_back( "StackedText",
287 PROP_AXIS_STACKEDTEXT,
288 cppu::UnoType<bool>::get(),
289 beans::PropertyAttribute::BOUND
290 | beans::PropertyAttribute::MAYBEDEFAULT );
292 // Properties related to bar charts:
293 rOutProperties.emplace_back( "Overlap",
294 PROP_AXIS_OVERLAP,
295 cppu::UnoType<sal_Int32>::get(),
296 //#i111967# no PropertyChangeEvent is fired on change so far
297 beans::PropertyAttribute::MAYBEDEFAULT );
299 rOutProperties.emplace_back( "GapWidth",
300 PROP_AXIS_GAP_WIDTH,
301 cppu::UnoType<sal_Int32>::get(),
302 //#i111967# no PropertyChangeEvent is fired on change so far
303 beans::PropertyAttribute::MAYBEDEFAULT );
305 //Properties for display units:
306 rOutProperties.emplace_back( "DisplayUnits",
307 PROP_AXIS_DISPLAY_UNITS,
308 cppu::UnoType<bool>::get(),
309 beans::PropertyAttribute::BOUND
310 | beans::PropertyAttribute::MAYBEDEFAULT );
312 //Properties for labels:
313 rOutProperties.emplace_back( "BuiltInUnit",
314 PROP_AXIS_BUILTINUNIT,
315 cppu::UnoType<OUString>::get(),
316 beans::PropertyAttribute::BOUND
317 | beans::PropertyAttribute::MAYBEDEFAULT );
319 // Compatibility option: starting from LibreOffice 5.1 the rotated
320 // layout is preferred to staggering for axis labels.
321 rOutProperties.emplace_back( "TryStaggeringFirst",
322 PROP_AXIS_TRY_STAGGERING_FIRST,
323 cppu::UnoType<bool>::get(),
324 beans::PropertyAttribute::BOUND
325 | beans::PropertyAttribute::MAYBEDEFAULT );
328 struct StaticAxisWrapperPropertyArray_Initializer
330 Sequence< Property >* operator()()
332 static Sequence< Property > aPropSeq( lcl_GetPropertySequence() );
333 return &aPropSeq;
336 private:
337 static Sequence< Property > lcl_GetPropertySequence()
339 std::vector< css::beans::Property > aProperties;
340 lcl_AddPropertiesToVector( aProperties );
341 ::chart::CharacterProperties::AddPropertiesToVector( aProperties );
342 ::chart::LinePropertiesHelper::AddPropertiesToVector( aProperties );
343 ::chart::UserDefinedProperties::AddPropertiesToVector( aProperties );
344 ::chart::wrapper::WrappedScaleTextProperties::addProperties( aProperties );
346 std::sort( aProperties.begin(), aProperties.end(),
347 ::chart::PropertyNameLess() );
349 return comphelper::containerToSequence( aProperties );
353 struct StaticAxisWrapperPropertyArray : public rtl::StaticAggregate< Sequence< Property >, StaticAxisWrapperPropertyArray_Initializer >
357 } // anonymous namespace
359 namespace chart
361 namespace wrapper
364 AxisWrapper::AxisWrapper(
365 tAxisType eType, const std::shared_ptr<Chart2ModelContact>& spChart2ModelContact) :
366 m_spChart2ModelContact( spChart2ModelContact ),
367 m_aEventListenerContainer( m_aMutex ),
368 m_eType( eType )
372 AxisWrapper::~AxisWrapper()
376 // ____ chart::XAxis ____
377 Reference< beans::XPropertySet > SAL_CALL AxisWrapper::getAxisTitle()
379 if( !m_xAxisTitle.is() )
381 TitleHelper::eTitleType eTitleType( TitleHelper::X_AXIS_TITLE );
382 switch( m_eType )
384 case X_AXIS:
385 eTitleType = TitleHelper::X_AXIS_TITLE;
386 break;
387 case Y_AXIS:
388 eTitleType = TitleHelper::Y_AXIS_TITLE;
389 break;
390 case Z_AXIS:
391 eTitleType = TitleHelper::Z_AXIS_TITLE;
392 break;
393 case SECOND_X_AXIS:
394 eTitleType = TitleHelper::SECONDARY_X_AXIS_TITLE;
395 break;
396 case SECOND_Y_AXIS:
397 eTitleType = TitleHelper::SECONDARY_Y_AXIS_TITLE;
398 break;
399 default:
400 return nullptr;
402 m_xAxisTitle = new TitleWrapper( eTitleType, m_spChart2ModelContact );
404 return m_xAxisTitle;
406 Reference< beans::XPropertySet > SAL_CALL AxisWrapper::getMajorGrid()
408 if( !m_xMajorGrid.is() )
410 GridWrapper::tGridType eGridType( GridWrapper::X_MAJOR_GRID );
411 switch( m_eType )
413 case X_AXIS:
414 eGridType = GridWrapper::X_MAJOR_GRID;
415 break;
416 case Y_AXIS:
417 eGridType = GridWrapper::Y_MAJOR_GRID;
418 break;
419 case Z_AXIS:
420 eGridType = GridWrapper::Z_MAJOR_GRID;
421 break;
422 default:
423 return nullptr;
425 m_xMajorGrid = new GridWrapper( eGridType, m_spChart2ModelContact );
427 return m_xMajorGrid;
429 Reference< beans::XPropertySet > SAL_CALL AxisWrapper::getMinorGrid()
431 if( !m_xMinorGrid.is() )
433 GridWrapper::tGridType eGridType( GridWrapper::X_MAJOR_GRID );
434 switch( m_eType )
436 case X_AXIS:
437 eGridType = GridWrapper::X_MINOR_GRID;
438 break;
439 case Y_AXIS:
440 eGridType = GridWrapper::Y_MINOR_GRID;
441 break;
442 case Z_AXIS:
443 eGridType = GridWrapper::Z_MINOR_GRID;
444 break;
445 default:
446 return nullptr;
448 m_xMinorGrid = new GridWrapper( eGridType, m_spChart2ModelContact );
450 return m_xMinorGrid;
453 // ____ XShape ____
454 awt::Point SAL_CALL AxisWrapper::getPosition()
456 awt::Point aResult( m_spChart2ModelContact->GetAxisPosition( getAxis() ) );
457 return aResult;
460 void SAL_CALL AxisWrapper::setPosition( const awt::Point& /*aPosition*/ )
462 OSL_FAIL( "trying to set position of Axis" );
465 awt::Size SAL_CALL AxisWrapper::getSize()
467 awt::Size aSize( m_spChart2ModelContact->GetAxisSize( getAxis() ) );
468 return aSize;
471 void SAL_CALL AxisWrapper::setSize( const awt::Size& /*aSize*/ )
473 OSL_FAIL( "trying to set size of Axis" );
476 // ____ XShapeDescriptor (base of XShape) ____
477 OUString SAL_CALL AxisWrapper::getShapeType()
479 return "com.sun.star.chart.ChartAxis";
482 // ____ XNumberFormatsSupplier ____
483 uno::Reference< beans::XPropertySet > SAL_CALL AxisWrapper::getNumberFormatSettings()
485 Reference< util::XNumberFormatsSupplier > xNumSuppl( m_spChart2ModelContact->getChartModel(), uno::UNO_QUERY );
486 if( xNumSuppl.is() )
487 return xNumSuppl->getNumberFormatSettings();
489 return uno::Reference< beans::XPropertySet >();
492 uno::Reference< util::XNumberFormats > SAL_CALL AxisWrapper::getNumberFormats()
494 Reference< util::XNumberFormatsSupplier > xNumSuppl( m_spChart2ModelContact->getChartModel(), uno::UNO_QUERY );
495 if( xNumSuppl.is() )
496 return xNumSuppl->getNumberFormats();
498 return uno::Reference< util::XNumberFormats >();
501 void AxisWrapper::getDimensionAndMainAxisBool( tAxisType eType, sal_Int32& rnDimensionIndex, bool& rbMainAxis )
503 switch( eType )
505 case X_AXIS:
506 rnDimensionIndex = 0; rbMainAxis = true; break;
507 case Y_AXIS:
508 rnDimensionIndex = 1; rbMainAxis = true; break;
509 case Z_AXIS:
510 rnDimensionIndex = 2; rbMainAxis = true; break;
511 case SECOND_X_AXIS:
512 rnDimensionIndex = 0; rbMainAxis = false; break;
513 case SECOND_Y_AXIS:
514 rnDimensionIndex = 1; rbMainAxis = false; break;
518 // ____ XComponent ____
519 void SAL_CALL AxisWrapper::dispose()
521 Reference< uno::XInterface > xSource( static_cast< ::cppu::OWeakObject* >( this ) );
522 m_aEventListenerContainer.disposeAndClear( lang::EventObject( xSource ) );
524 DisposeHelper::DisposeAndClear( m_xAxisTitle );
525 DisposeHelper::DisposeAndClear( m_xMajorGrid );
526 DisposeHelper::DisposeAndClear( m_xMinorGrid );
528 clearWrappedPropertySet();
531 void SAL_CALL AxisWrapper::addEventListener(
532 const Reference< lang::XEventListener >& xListener )
534 m_aEventListenerContainer.addInterface( xListener );
537 void SAL_CALL AxisWrapper::removeEventListener(
538 const Reference< lang::XEventListener >& aListener )
540 m_aEventListenerContainer.removeInterface( aListener );
543 //ReferenceSizePropertyProvider
544 void AxisWrapper::updateReferenceSize()
546 Reference< beans::XPropertySet > xProp( getAxis(), uno::UNO_QUERY );
547 if( xProp.is() )
549 if( xProp->getPropertyValue("ReferencePageSize").hasValue() )
550 xProp->setPropertyValue("ReferencePageSize", uno::Any(
551 m_spChart2ModelContact->GetPageSize() ));
554 Any AxisWrapper::getReferenceSize()
556 Any aRet;
557 Reference< beans::XPropertySet > xProp( getAxis(), uno::UNO_QUERY );
558 if( xProp.is() )
559 aRet = xProp->getPropertyValue("ReferencePageSize");
560 return aRet;
562 awt::Size AxisWrapper::getCurrentSizeForReference()
564 return m_spChart2ModelContact->GetPageSize();
567 Reference< chart2::XAxis > AxisWrapper::getAxis()
569 Reference< chart2::XAxis > xAxis;
572 sal_Int32 nDimensionIndex = 0;
573 bool bMainAxis = true;
574 AxisWrapper::getDimensionAndMainAxisBool( m_eType, nDimensionIndex, bMainAxis );
576 Reference< XDiagram > xDiagram( m_spChart2ModelContact->getChart2Diagram() );
577 xAxis = AxisHelper::getAxis( nDimensionIndex, bMainAxis, xDiagram );
578 if( !xAxis.is() )
580 xAxis = AxisHelper::createAxis( nDimensionIndex, bMainAxis, xDiagram, m_spChart2ModelContact->m_xContext );
581 Reference< beans::XPropertySet > xProp( xAxis, uno::UNO_QUERY );
582 if( xProp.is() )
583 xProp->setPropertyValue("Show", uno::Any( false ) );
586 catch( const uno::Exception & )
588 DBG_UNHANDLED_EXCEPTION("chart2");
590 return xAxis;
593 // WrappedPropertySet
594 Reference< beans::XPropertySet > AxisWrapper::getInnerPropertySet()
596 return Reference< beans::XPropertySet >( getAxis(), uno::UNO_QUERY );
599 const Sequence< beans::Property >& AxisWrapper::getPropertySequence()
601 return *StaticAxisWrapperPropertyArray::get();
604 std::vector< std::unique_ptr<WrappedProperty> > AxisWrapper::createWrappedProperties()
606 std::vector< std::unique_ptr<WrappedProperty> > aWrappedProperties;
608 aWrappedProperties.emplace_back( new WrappedTextRotationProperty() );
609 aWrappedProperties.emplace_back( new WrappedProperty("Marks","MajorTickmarks") );
610 aWrappedProperties.emplace_back( new WrappedProperty("HelpMarks","MinorTickmarks") );
611 aWrappedProperties.emplace_back( new WrappedProperty("TextCanOverlap","TextOverlap") );
612 aWrappedProperties.emplace_back( new WrappedProperty("ArrangeOrder","ArrangeOrder") );
613 aWrappedProperties.emplace_back( new WrappedProperty("Visible","Show") );
614 aWrappedProperties.emplace_back( new WrappedDirectStateProperty("DisplayLabels","DisplayLabels") );
615 aWrappedProperties.emplace_back( new WrappedDirectStateProperty("TryStaggeringFirst","TryStaggeringFirst") );
616 aWrappedProperties.emplace_back( new WrappedDirectStateProperty("TextBreak","TextBreak") );
617 aWrappedProperties.emplace_back( new WrappedNumberFormatProperty(m_spChart2ModelContact) );
618 aWrappedProperties.emplace_back( new WrappedLinkNumberFormatProperty );
619 aWrappedProperties.emplace_back( new WrappedProperty("StackedText","StackCharacters") );
620 aWrappedProperties.emplace_back( new WrappedDirectStateProperty("CrossoverPosition","CrossoverPosition") );
622 WrappedGapwidthProperty* pWrappedGapwidthProperty( new WrappedGapwidthProperty( m_spChart2ModelContact ) );
623 WrappedBarOverlapProperty* pWrappedBarOverlapProperty( new WrappedBarOverlapProperty( m_spChart2ModelContact ) );
624 sal_Int32 nDimensionIndex = 0;
625 bool bMainAxis = true;
626 sal_Int32 nAxisIndex = 0;
627 AxisWrapper::getDimensionAndMainAxisBool( m_eType, nDimensionIndex, bMainAxis );
628 if( !bMainAxis )
629 nAxisIndex = 1;
630 pWrappedGapwidthProperty->setDimensionAndAxisIndex( nDimensionIndex, nAxisIndex );
631 pWrappedBarOverlapProperty->setDimensionAndAxisIndex( nDimensionIndex, nAxisIndex );
632 aWrappedProperties.emplace_back( pWrappedGapwidthProperty );
633 aWrappedProperties.emplace_back( pWrappedBarOverlapProperty );
636 WrappedScaleProperty::addWrappedProperties( aWrappedProperties, m_spChart2ModelContact );
638 WrappedCharacterHeightProperty::addWrappedProperties( aWrappedProperties, this );
639 WrappedScaleTextProperties::addWrappedProperties( aWrappedProperties, m_spChart2ModelContact );
641 return aWrappedProperties;
644 OUString SAL_CALL AxisWrapper::getImplementationName()
646 return "com.sun.star.comp.chart.Axis";
649 sal_Bool SAL_CALL AxisWrapper::supportsService( const OUString& rServiceName )
651 return cppu::supportsService(this, rServiceName);
654 css::uno::Sequence< OUString > SAL_CALL AxisWrapper::getSupportedServiceNames()
656 return {
657 "com.sun.star.chart.ChartAxis",
658 "com.sun.star.xml.UserDefinedAttributesSupplier",
659 "com.sun.star.style.CharacterProperties"
663 } // namespace wrapper
664 } // namespace chart
666 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */