Version 6.4.0.0.beta1, tag libreoffice-6.4.0.0.beta1
[LibreOffice.git] / chart2 / source / controller / chartapiwrapper / ChartDataWrapper.cxx
blob5696d6b5c3f4919428605d70350dd58069fb0ec4
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 "ChartDataWrapper.hxx"
21 #include <DiagramHelper.hxx>
22 #include <DataSourceHelper.hxx>
23 #include <ChartModelHelper.hxx>
24 #include <ControllerLockGuard.hxx>
25 #include "Chart2ModelContact.hxx"
26 #include <cppuhelper/supportsservice.hxx>
27 #include <com/sun/star/chart2/XChartDocument.hpp>
28 #include <com/sun/star/chart/XChartDocument.hpp>
30 #include <float.h>
31 #include <rtl/math.hxx>
32 #include <osl/diagnose.h>
34 using namespace ::com::sun::star;
35 using ::com::sun::star::uno::Reference;
36 using ::com::sun::star::uno::Sequence;
37 using ::com::sun::star::chart2::XAnyDescriptionAccess;
38 using ::com::sun::star::chart::XComplexDescriptionAccess;
39 using ::com::sun::star::chart::XChartData;
40 using ::com::sun::star::chart::XChartDataArray;
41 using ::com::sun::star::chart::XDateCategories;
43 namespace
46 uno::Sequence< uno::Sequence< double > > lcl_getNANInsteadDBL_MIN( const uno::Sequence< uno::Sequence< double > >& rData )
48 uno::Sequence< uno::Sequence< double > > aRet;
49 const sal_Int32 nOuterSize = rData.getLength();
50 aRet.realloc( nOuterSize );
51 for( sal_Int32 nOuter=0; nOuter<nOuterSize; ++nOuter )
53 sal_Int32 nInnerSize = rData[nOuter].getLength();
54 aRet[nOuter].realloc( nInnerSize );
55 for( sal_Int32 nInner=0; nInner<nInnerSize; ++nInner )
57 aRet[nOuter][nInner] = rData[nOuter][nInner];
58 double& rValue = aRet[nOuter][nInner];
59 if( rValue == DBL_MIN )
60 ::rtl::math::setNan( &rValue );
63 return aRet;
66 uno::Sequence< uno::Sequence< double > > lcl_getDBL_MINInsteadNAN( const uno::Sequence< uno::Sequence< double > >& rData )
68 uno::Sequence< uno::Sequence< double > > aRet;
69 const sal_Int32 nOuterSize = rData.getLength();
70 aRet.realloc( nOuterSize );
71 for( sal_Int32 nOuter=0; nOuter<nOuterSize; ++nOuter )
73 sal_Int32 nInnerSize = rData[nOuter].getLength();
74 aRet[nOuter].realloc( nInnerSize );
75 for( sal_Int32 nInner=0; nInner<nInnerSize; ++nInner )
77 aRet[nOuter][nInner] = rData[nOuter][nInner];
78 double& rValue = aRet[nOuter][nInner];
79 if( ::rtl::math::isNan( rValue ) )
80 rValue = DBL_MIN;
83 return aRet;
86 } // anonymous namespace
88 namespace chart
90 namespace wrapper
93 struct lcl_Operator
95 lcl_Operator()
98 virtual ~lcl_Operator()
101 virtual void apply( const Reference< XAnyDescriptionAccess >& xDataAccess ) = 0;
103 virtual bool setsCategories( bool /*bDataInColumns*/ )
105 return false;
109 struct lcl_AllOperator : public lcl_Operator
111 explicit lcl_AllOperator( const Reference< XChartData >& xDataToApply )
112 : lcl_Operator()
113 , m_xDataToApply( xDataToApply )
117 virtual bool setsCategories( bool /*bDataInColumns*/ ) override
119 return true;
122 virtual void apply( const Reference< XAnyDescriptionAccess >& xDataAccess ) override
124 if( !xDataAccess.is() )
125 return;
127 Reference< XAnyDescriptionAccess > xNewAny( m_xDataToApply, uno::UNO_QUERY );
128 Reference< XComplexDescriptionAccess > xNewComplex( m_xDataToApply, uno::UNO_QUERY );
129 if( xNewAny.is() )
131 xDataAccess->setData( xNewAny->getData() );
132 xDataAccess->setComplexRowDescriptions( xNewAny->getComplexRowDescriptions() );
133 xDataAccess->setComplexColumnDescriptions( xNewAny->getComplexColumnDescriptions() );
135 else if( xNewComplex.is() )
137 xDataAccess->setData( xNewComplex->getData() );
138 xDataAccess->setComplexRowDescriptions( xNewComplex->getComplexRowDescriptions() );
139 xDataAccess->setComplexColumnDescriptions( xNewComplex->getComplexColumnDescriptions() );
141 else
143 Reference< XChartDataArray > xNew( m_xDataToApply, uno::UNO_QUERY );
144 if( xNew.is() )
146 xDataAccess->setData( xNew->getData() );
147 xDataAccess->setRowDescriptions( xNew->getRowDescriptions() );
148 xDataAccess->setColumnDescriptions( xNew->getColumnDescriptions() );
153 Reference< XChartData > m_xDataToApply;
156 struct lcl_DataOperator : public lcl_Operator
158 explicit lcl_DataOperator( const Sequence< Sequence< double > >& rData )
159 : lcl_Operator()
160 , m_rData( rData )
164 virtual void apply( const Reference< XAnyDescriptionAccess >& xDataAccess ) override
166 if( xDataAccess.is() )
167 xDataAccess->setData( lcl_getNANInsteadDBL_MIN( m_rData ) );
170 const Sequence< Sequence< double > >& m_rData;
173 struct lcl_RowDescriptionsOperator : public lcl_Operator
175 lcl_RowDescriptionsOperator( const Sequence< OUString >& rRowDescriptions
176 , const Reference< chart2::XChartDocument >& xChartDoc )
177 : lcl_Operator()
178 , m_rRowDescriptions( rRowDescriptions )
179 , m_xChartDoc(xChartDoc)
180 , m_bDataInColumns(true)
184 virtual bool setsCategories( bool bDataInColumns ) override
186 m_bDataInColumns = bDataInColumns;
187 return bDataInColumns;
190 virtual void apply( const Reference< XAnyDescriptionAccess >& xDataAccess ) override
192 if( xDataAccess.is() )
194 xDataAccess->setRowDescriptions( m_rRowDescriptions );
195 if( m_bDataInColumns )
196 DiagramHelper::switchToTextCategories( m_xChartDoc );
200 const Sequence< OUString >& m_rRowDescriptions;
201 Reference< chart2::XChartDocument > m_xChartDoc;
202 bool m_bDataInColumns;
205 struct lcl_ComplexRowDescriptionsOperator : public lcl_Operator
207 lcl_ComplexRowDescriptionsOperator( const Sequence< Sequence< OUString > >& rComplexRowDescriptions
208 , const Reference< chart2::XChartDocument >& xChartDoc )
209 : lcl_Operator()
210 , m_rComplexRowDescriptions( rComplexRowDescriptions )
211 , m_xChartDoc(xChartDoc)
212 , m_bDataInColumns(true)
216 virtual bool setsCategories( bool bDataInColumns ) override
218 m_bDataInColumns = bDataInColumns;
219 return bDataInColumns;
222 virtual void apply( const Reference< XAnyDescriptionAccess >& xDataAccess ) override
224 if( xDataAccess.is() )
226 xDataAccess->setComplexRowDescriptions( m_rComplexRowDescriptions );
227 if( m_bDataInColumns )
228 DiagramHelper::switchToTextCategories( m_xChartDoc );
232 const Sequence< Sequence< OUString > >& m_rComplexRowDescriptions;
233 Reference< chart2::XChartDocument > m_xChartDoc;
234 bool m_bDataInColumns;
237 struct lcl_AnyRowDescriptionsOperator : public lcl_Operator
239 explicit lcl_AnyRowDescriptionsOperator( const Sequence< Sequence< uno::Any > >& rAnyRowDescriptions )
240 : lcl_Operator()
241 , m_rAnyRowDescriptions( rAnyRowDescriptions )
245 virtual bool setsCategories( bool bDataInColumns ) override
247 return bDataInColumns;
250 virtual void apply( const Reference< XAnyDescriptionAccess >& xDataAccess ) override
252 if( xDataAccess.is() )
253 xDataAccess->setAnyRowDescriptions( m_rAnyRowDescriptions );
256 const Sequence< Sequence< uno::Any > >& m_rAnyRowDescriptions;
259 struct lcl_ColumnDescriptionsOperator : public lcl_Operator
261 lcl_ColumnDescriptionsOperator( const Sequence< OUString >& rColumnDescriptions
262 , const Reference< chart2::XChartDocument >& xChartDoc )
263 : lcl_Operator()
264 , m_rColumnDescriptions( rColumnDescriptions )
265 , m_xChartDoc(xChartDoc)
266 , m_bDataInColumns(true)
270 virtual bool setsCategories( bool bDataInColumns ) override
272 m_bDataInColumns = bDataInColumns;
273 return !bDataInColumns;
276 virtual void apply( const Reference< XAnyDescriptionAccess >& xDataAccess ) override
278 if( xDataAccess.is() )
280 xDataAccess->setColumnDescriptions( m_rColumnDescriptions );
281 if( !m_bDataInColumns )
282 DiagramHelper::switchToTextCategories( m_xChartDoc );
286 const Sequence< OUString >& m_rColumnDescriptions;
287 Reference< chart2::XChartDocument > m_xChartDoc;
288 bool m_bDataInColumns;
291 struct lcl_ComplexColumnDescriptionsOperator : public lcl_Operator
293 lcl_ComplexColumnDescriptionsOperator( const Sequence< Sequence< OUString > >& rComplexColumnDescriptions
294 , const Reference< chart2::XChartDocument >& xChartDoc )
295 : lcl_Operator()
296 , m_rComplexColumnDescriptions( rComplexColumnDescriptions )
297 , m_xChartDoc(xChartDoc)
298 , m_bDataInColumns(true)
302 virtual bool setsCategories( bool bDataInColumns ) override
304 m_bDataInColumns = bDataInColumns;
305 return !bDataInColumns;
308 virtual void apply( const Reference< XAnyDescriptionAccess >& xDataAccess ) override
310 if( xDataAccess.is() )
312 xDataAccess->setComplexColumnDescriptions( m_rComplexColumnDescriptions );
313 if( !m_bDataInColumns )
314 DiagramHelper::switchToTextCategories( m_xChartDoc );
318 const Sequence< Sequence< OUString > >& m_rComplexColumnDescriptions;
319 Reference< chart2::XChartDocument > m_xChartDoc;
320 bool m_bDataInColumns;
323 struct lcl_AnyColumnDescriptionsOperator : public lcl_Operator
325 explicit lcl_AnyColumnDescriptionsOperator( const Sequence< Sequence< uno::Any > >& rAnyColumnDescriptions )
326 : lcl_Operator()
327 , m_rAnyColumnDescriptions( rAnyColumnDescriptions )
331 virtual bool setsCategories( bool bDataInColumns ) override
333 return bDataInColumns;
336 virtual void apply( const Reference< XAnyDescriptionAccess >& xDataAccess ) override
338 if( xDataAccess.is() )
339 xDataAccess->setAnyColumnDescriptions( m_rAnyColumnDescriptions );
342 const Sequence< Sequence< uno::Any > >& m_rAnyColumnDescriptions;
345 struct lcl_DateCategoriesOperator : public lcl_Operator
347 explicit lcl_DateCategoriesOperator( const Sequence< double >& rDates )
348 : lcl_Operator()
349 , m_rDates( rDates )
353 virtual bool setsCategories( bool /*bDataInColumns*/ ) override
355 return true;
358 virtual void apply( const Reference< XAnyDescriptionAccess >& xDataAccess ) override
360 Reference< XDateCategories > xDateCategories( xDataAccess, uno::UNO_QUERY );
361 if( xDateCategories.is() )
362 xDateCategories->setDateCategories( m_rDates );
365 const Sequence< double >& m_rDates;
368 ChartDataWrapper::ChartDataWrapper(const std::shared_ptr<Chart2ModelContact>& spChart2ModelContact)
369 : m_spChart2ModelContact(spChart2ModelContact)
370 , m_aEventListenerContainer(m_aMutex)
372 osl_atomic_increment( &m_refCount );
373 initDataAccess();
374 osl_atomic_decrement( &m_refCount );
377 ChartDataWrapper::ChartDataWrapper( const std::shared_ptr<Chart2ModelContact>& spChart2ModelContact,
378 const Reference< XChartData >& xNewData ) :
379 m_spChart2ModelContact( spChart2ModelContact ),
380 m_aEventListenerContainer( m_aMutex )
382 osl_atomic_increment( &m_refCount );
383 lcl_AllOperator aOperator( xNewData );
384 applyData( aOperator );
385 osl_atomic_decrement( &m_refCount );
388 ChartDataWrapper::~ChartDataWrapper()
390 // @todo: implement XComponent and call this in dispose(). In the DTOR the
391 // ref-count is 0, thus creating a stack reference to this calls the DTOR at
392 // the end of the block recursively
393 // uno::Reference< uno::XInterface > xSource( static_cast< ::cppu::OWeakObject* >( this ) );
394 // m_aEventListenerContainer.disposeAndClear( lang::EventObject( xSource ) );
397 // ____ XChartDataArray (read)____
398 Sequence< Sequence< double > > SAL_CALL ChartDataWrapper::getData()
400 initDataAccess();
401 if( m_xDataAccess.is() )
402 return lcl_getDBL_MINInsteadNAN( m_xDataAccess->getData() );
403 return Sequence< Sequence< double > >();
405 Sequence< OUString > SAL_CALL ChartDataWrapper::getRowDescriptions()
407 initDataAccess();
408 if( m_xDataAccess.is() )
409 return m_xDataAccess->getRowDescriptions();
410 return Sequence< OUString >();
412 Sequence< OUString > SAL_CALL ChartDataWrapper::getColumnDescriptions()
414 initDataAccess();
415 if( m_xDataAccess.is() )
416 return m_xDataAccess->getColumnDescriptions();
417 return Sequence< OUString > ();
420 // ____ XComplexDescriptionAccess (read) ____
421 Sequence< Sequence< OUString > > SAL_CALL ChartDataWrapper::getComplexRowDescriptions()
423 initDataAccess();
424 if( m_xDataAccess.is() )
425 return m_xDataAccess->getComplexRowDescriptions();
426 return Sequence< Sequence< OUString > >();
428 Sequence< Sequence< OUString > > SAL_CALL ChartDataWrapper::getComplexColumnDescriptions()
430 initDataAccess();
431 if( m_xDataAccess.is() )
432 return m_xDataAccess->getComplexColumnDescriptions();
433 return Sequence< Sequence< OUString > >();
436 // ____ XAnyDescriptionAccess (read) ____
437 Sequence< Sequence< uno::Any > > SAL_CALL ChartDataWrapper::getAnyRowDescriptions()
439 initDataAccess();
440 if( m_xDataAccess.is() )
441 return m_xDataAccess->getAnyRowDescriptions();
442 return Sequence< Sequence< uno::Any > >();
444 Sequence< Sequence< uno::Any > > SAL_CALL ChartDataWrapper::getAnyColumnDescriptions()
446 initDataAccess();
447 if( m_xDataAccess.is() )
448 return m_xDataAccess->getAnyColumnDescriptions();
449 return Sequence< Sequence< uno::Any > >();
452 // ____ XDateCategories (read) ____
453 Sequence< double > SAL_CALL ChartDataWrapper::getDateCategories()
455 initDataAccess();
456 Reference< XDateCategories > xDateCategories( m_xDataAccess, uno::UNO_QUERY );
457 if( xDateCategories.is() )
458 return xDateCategories->getDateCategories();
459 return Sequence< double >();
462 // ____ XChartDataArray (write)____
463 void SAL_CALL ChartDataWrapper::setData( const Sequence< Sequence< double > >& rData )
465 lcl_DataOperator aOperator( rData );
466 applyData( aOperator );
468 void SAL_CALL ChartDataWrapper::setRowDescriptions( const Sequence< OUString >& rRowDescriptions )
470 lcl_RowDescriptionsOperator aOperator( rRowDescriptions, m_spChart2ModelContact->getChart2Document() );
471 applyData( aOperator );
473 void SAL_CALL ChartDataWrapper::setColumnDescriptions( const Sequence< OUString >& rColumnDescriptions )
475 lcl_ColumnDescriptionsOperator aOperator( rColumnDescriptions, m_spChart2ModelContact->getChart2Document() );
476 applyData( aOperator );
479 // ____ XComplexDescriptionAccess (write) ____
480 void SAL_CALL ChartDataWrapper::setComplexRowDescriptions( const Sequence< Sequence< OUString > >& rRowDescriptions )
482 lcl_ComplexRowDescriptionsOperator aOperator( rRowDescriptions, m_spChart2ModelContact->getChart2Document() );
483 applyData( aOperator );
485 void SAL_CALL ChartDataWrapper::setComplexColumnDescriptions( const Sequence< Sequence< OUString > >& rColumnDescriptions )
487 lcl_ComplexColumnDescriptionsOperator aOperator( rColumnDescriptions, m_spChart2ModelContact->getChart2Document() );
488 applyData( aOperator );
491 // ____ XAnyDescriptionAccess (write) ____
492 void SAL_CALL ChartDataWrapper::setAnyRowDescriptions( const Sequence< Sequence< uno::Any > >& rRowDescriptions )
494 lcl_AnyRowDescriptionsOperator aOperator( rRowDescriptions );
495 applyData( aOperator );
497 void SAL_CALL ChartDataWrapper::setAnyColumnDescriptions( const Sequence< Sequence< uno::Any > >& rColumnDescriptions )
499 lcl_AnyColumnDescriptionsOperator aOperator( rColumnDescriptions );
500 applyData( aOperator );
503 // ____ XDateCategories (write) ____
504 void SAL_CALL ChartDataWrapper::setDateCategories( const Sequence< double >& rDates )
506 Reference< chart2::XChartDocument > xChartDoc( m_spChart2ModelContact->getChart2Document() );
507 ControllerLockGuardUNO aCtrlLockGuard( xChartDoc );
508 lcl_DateCategoriesOperator aOperator( rDates );
509 applyData( aOperator );
510 DiagramHelper::switchToDateCategories( xChartDoc );
513 // ____ XChartData (base of XChartDataArray) ____
514 void SAL_CALL ChartDataWrapper::addChartDataChangeEventListener(
515 const uno::Reference< css::chart::XChartDataChangeEventListener >& aListener )
517 m_aEventListenerContainer.addInterface( aListener );
520 void SAL_CALL ChartDataWrapper::removeChartDataChangeEventListener(
521 const uno::Reference< css::chart::XChartDataChangeEventListener >& aListener )
523 m_aEventListenerContainer.removeInterface( aListener );
526 double SAL_CALL ChartDataWrapper::getNotANumber()
528 return DBL_MIN;
531 sal_Bool SAL_CALL ChartDataWrapper::isNotANumber( double nNumber )
533 return nNumber == DBL_MIN
534 || ::rtl::math::isNan( nNumber )
535 || ::rtl::math::isInf( nNumber );
538 // ____ XComponent ____
539 void SAL_CALL ChartDataWrapper::dispose()
541 m_aEventListenerContainer.disposeAndClear( lang::EventObject( static_cast< ::cppu::OWeakObject* >( this )));
542 m_xDataAccess=nullptr;
545 void SAL_CALL ChartDataWrapper::addEventListener(
546 const uno::Reference< lang::XEventListener > & xListener )
548 m_aEventListenerContainer.addInterface( xListener );
551 void SAL_CALL ChartDataWrapper::removeEventListener(
552 const uno::Reference< lang::XEventListener >& aListener )
554 m_aEventListenerContainer.removeInterface( aListener );
557 // ____ XEventListener ____
558 void SAL_CALL ChartDataWrapper::disposing( const lang::EventObject& /* Source */ )
562 void ChartDataWrapper::fireChartDataChangeEvent( css::chart::ChartDataChangeEvent& aEvent )
564 if( ! m_aEventListenerContainer.getLength() )
565 return;
567 uno::Reference< uno::XInterface > xSrc( static_cast< cppu::OWeakObject* >( this ));
568 OSL_ASSERT( xSrc.is());
569 if( xSrc.is() )
570 aEvent.Source = xSrc;
572 m_aEventListenerContainer.notifyEach( &css::chart::XChartDataChangeEventListener::chartDataChanged, aEvent );
575 void ChartDataWrapper::switchToInternalDataProvider()
577 //create an internal data provider that is connected to the model
578 Reference< chart2::XChartDocument > xChartDoc( m_spChart2ModelContact->getChart2Document() );
579 if( xChartDoc.is() )
580 xChartDoc->createInternalDataProvider( true /*bCloneExistingData*/ );
581 initDataAccess();
584 void ChartDataWrapper::initDataAccess()
586 Reference< chart2::XChartDocument > xChartDoc( m_spChart2ModelContact->getChart2Document() );
587 if( !xChartDoc.is() )
588 return;
589 if( xChartDoc->hasInternalDataProvider() )
590 m_xDataAccess.set( xChartDoc->getDataProvider(), uno::UNO_QUERY_THROW );
591 else
593 //create a separate "internal data provider" that is not connected to the model
594 m_xDataAccess.set( ChartModelHelper::createInternalDataProvider(
595 xChartDoc, false /*bConnectToModel*/ ), uno::UNO_QUERY_THROW );
599 void ChartDataWrapper::applyData( lcl_Operator& rDataOperator )
601 //bool bSetValues, bool bSetRowDescriptions, bool bSetColumnDescriptions
602 Reference< chart2::XChartDocument > xChartDoc( m_spChart2ModelContact->getChart2Document() );
603 if( !xChartDoc.is() )
604 return;
606 // remember some diagram properties to reset later
607 bool bStacked = false;
608 bool bPercent = false;
609 bool bDeep = false;
610 uno::Reference< css::chart::XChartDocument > xOldDoc( xChartDoc, uno::UNO_QUERY );
611 OSL_ASSERT( xOldDoc.is());
612 uno::Reference< beans::XPropertySet > xDiaProp( xOldDoc->getDiagram(), uno::UNO_QUERY );
613 if( xDiaProp.is())
615 xDiaProp->getPropertyValue("Stacked") >>= bStacked;
616 xDiaProp->getPropertyValue("Percent") >>= bPercent;
617 xDiaProp->getPropertyValue("Deep") >>= bDeep;
620 //detect arguments for the new data source
621 OUString aRangeString;
622 bool bUseColumns = true;
623 bool bFirstCellAsLabel = true;
624 bool bHasCategories = true;
625 uno::Sequence< sal_Int32 > aSequenceMapping;
627 DataSourceHelper::detectRangeSegmentation(
628 xChartDoc,
629 aRangeString, aSequenceMapping, bUseColumns, bFirstCellAsLabel, bHasCategories );
631 if( !bHasCategories && rDataOperator.setsCategories( bUseColumns ) )
632 bHasCategories = true;
634 aRangeString = "all";
635 uno::Sequence< beans::PropertyValue > aArguments( DataSourceHelper::createArguments(
636 aRangeString, aSequenceMapping, bUseColumns, bFirstCellAsLabel, bHasCategories ) );
638 // -- locked controllers
639 ControllerLockGuardUNO aCtrlLockGuard( xChartDoc );
641 // create and attach new data source
642 switchToInternalDataProvider();
643 rDataOperator.apply(m_xDataAccess);
644 uno::Reference< chart2::data::XDataProvider > xDataProvider( xChartDoc->getDataProvider() );
645 OSL_ASSERT( xDataProvider.is() );
646 if( !xDataProvider.is() )
647 return;
648 uno::Reference< chart2::data::XDataSource > xSource( xDataProvider->createDataSource( aArguments ) );
650 uno::Reference< chart2::XDiagram > xDia( xChartDoc->getFirstDiagram() );
651 if( xDia.is() )
652 xDia->setDiagramData( xSource, aArguments );
654 //correct stacking mode
655 if( bStacked || bPercent || bDeep )
657 StackMode eStackMode = StackMode::YStacked;
658 if( bDeep )
659 eStackMode = StackMode::ZStacked;
660 else if( bPercent )
661 eStackMode = StackMode::YStackedPercent;
662 DiagramHelper::setStackMode( xDia, eStackMode );
665 // notify listeners
666 css::chart::ChartDataChangeEvent aEvent(
667 static_cast< ::cppu::OWeakObject* >( this ),
668 css::chart::ChartDataChangeType_ALL, 0, 0, 0, 0 );
669 fireChartDataChangeEvent( aEvent );
670 // \-- locked controllers
673 OUString SAL_CALL ChartDataWrapper::getImplementationName()
675 return "com.sun.star.comp.chart.ChartData";
678 sal_Bool SAL_CALL ChartDataWrapper::supportsService( const OUString& rServiceName )
680 return cppu::supportsService(this, rServiceName);
683 css::uno::Sequence< OUString > SAL_CALL ChartDataWrapper::getSupportedServiceNames()
685 return {
686 "com.sun.star.chart.ChartDataArray",
687 "com.sun.star.chart.ChartData"
691 } // namespace wrapper
692 } // namespace chart
694 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */