LibreOffice Module chart2 (master) 1
DataSeries.cxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19
20#include <DataSeries.hxx>
25#include "DataPoint.hxx"
26#include <DataSeriesHelper.hxx>
27#include <CloneHelper.hxx>
30#include <com/sun/star/chart2/data/XTextualDataSequence.hpp>
31#include <com/sun/star/container/NoSuchElementException.hpp>
32#include <com/sun/star/lang/IndexOutOfBoundsException.hpp>
35#include <rtl/ref.hxx>
36#include <rtl/ustrbuf.hxx>
37
38#include <algorithm>
39
40namespace com::sun::star::uno { class XComponentContext; }
41
42using namespace ::com::sun::star;
43
44using ::com::sun::star::beans::Property;
45using ::com::sun::star::uno::Sequence;
46using ::com::sun::star::uno::Reference;
47using ::osl::MutexGuard;
48
49namespace chart
50{
52{
53 static const ::chart::tPropertyValueMap aStaticDefaults = []()
54 {
58 float fDefaultCharHeight = 10.0;
62 return aMap;
63 }();
64 return aStaticDefaults;
65};
66} // namespace chart
67
68namespace
69{
70
71::cppu::OPropertyArrayHelper& StaticDataSeriesInfoHelper()
72{
73 static ::cppu::OPropertyArrayHelper oHelper = []()
74 {
75 std::vector< css::beans::Property > aProperties;
79
80 std::sort( aProperties.begin(), aProperties.end(),
82
83 return comphelper::containerToSequence( aProperties );
84 }();
85 return oHelper;
86};
87
88void lcl_SetParent(
89 const uno::Reference< uno::XInterface > & xChildInterface,
90 const uno::Reference< uno::XInterface > & xParentInterface )
91{
92 uno::Reference< container::XChild > xChild( xChildInterface, uno::UNO_QUERY );
93 if( xChild.is())
94 xChild->setParent( xParentInterface );
95}
96
97typedef std::map< sal_Int32, css::uno::Reference< css::beans::XPropertySet > >
98 lcl_tDataPointMap;
99
100void lcl_CloneAttributedDataPoints(
101 const lcl_tDataPointMap & rSource, lcl_tDataPointMap & rDestination,
102 const uno::Reference< uno::XInterface > & xSeries )
103{
104 for (auto const& elem : rSource)
105 {
106 Reference< beans::XPropertySet > xPoint( elem.second );
107 if( xPoint.is())
108 {
109 Reference< util::XCloneable > xCloneable( xPoint, uno::UNO_QUERY );
110 if( xCloneable.is())
111 {
112 xPoint.set( xCloneable->createClone(), uno::UNO_QUERY );
113 if( xPoint.is())
114 {
115 lcl_SetParent( xPoint, xSeries );
116 rDestination.emplace( elem.first, xPoint );
117 }
118 }
119 }
120 }
121}
122
123} // anonymous namespace
124
125namespace chart
126{
127
129 m_xModifyEventForwarder( new ModifyEventForwarder() )
130{
131}
132
134 impl::DataSeries_Base(rOther),
135 ::property::OPropertySet( rOther ),
136 m_xModifyEventForwarder( new ModifyEventForwarder() )
137{
138 if( ! rOther.m_aDataSequences.empty())
139 {
142 }
143
146
147 // add as listener to XPropertySet properties
149 uno::Any aValue;
150
152 if( ( aValue >>= xPropertySet )
153 && xPropertySet.is())
155
157 if( ( aValue >>= xPropertySet )
158 && xPropertySet.is())
160}
161
162// late initialization to call after copy-constructing
163void DataSeries::Init( const DataSeries & rOther )
164{
165 Reference< uno::XInterface > xThisInterface( static_cast< ::cppu::OWeakObject * >( this ));
166 if( ! rOther.m_aAttributedDataPoints.empty())
167 {
168 lcl_CloneAttributedDataPoints(
169 rOther.m_aAttributedDataPoints, m_aAttributedDataPoints, xThisInterface );
171 }
172
173 // add as parent to error bars
175 uno::Any aValue;
176
178 if( ( aValue >>= xPropertySet )
179 && xPropertySet.is())
180 lcl_SetParent( xPropertySet, xThisInterface );
181
183 if( ( aValue >>= xPropertySet )
184 && xPropertySet.is())
185 lcl_SetParent( xPropertySet, xThisInterface );
186}
187
189{
190 try
191 {
195
196 // remove listener from XPropertySet properties
198 uno::Any aValue;
199
201 if( ( aValue >>= xPropertySet )
202 && xPropertySet.is())
204
206 if( ( aValue >>= xPropertySet )
207 && xPropertySet.is())
209 }
210 catch( const uno::Exception & )
211 {
212 DBG_UNHANDLED_EXCEPTION("chart2");
213 }
214}
215
216// ____ XCloneable ____
218{
219 rtl::Reference<DataSeries> pNewSeries( new DataSeries( *this ));
220 // do initialization that uses uno references to the clone
221 pNewSeries->Init( *this );
222
223 return pNewSeries;
224}
225
226// ____ OPropertySet ____
227void DataSeries::GetDefaultValue( sal_Int32 nHandle, uno::Any& rDest ) const
228{
229 const tPropertyValueMap& rStaticDefaults = StaticDataSeriesDefaults();
230 tPropertyValueMap::const_iterator aFound( rStaticDefaults.find( nHandle ) );
231 if( aFound == rStaticDefaults.end() )
232 rDest.clear();
233 else
234 rDest = (*aFound).second;
235}
236
237// ____ OPropertySet ____
239{
240 return StaticDataSeriesInfoHelper();
241}
242
243// ____ XPropertySet ____
245{
247 ::cppu::OPropertySetHelper::createPropertySetInfo(StaticDataSeriesInfoHelper() );
248 return xPropSetInfo;
249}
250
252 ( uno::Any& rValue,
253 sal_Int32 nHandle ) const
254{
255 // special handling for get. set is not possible for this property
257 {
258 // TODO: only add those property sets that are really modified
259
261 }
262 else
263 OPropertySet::getFastPropertyValue( rValue, nHandle );
264}
265
267 sal_Int32 nHandle, const uno::Any& rValue )
268{
271 {
272 uno::Any aOldValue;
274 getFastPropertyValue( aOldValue, nHandle );
275 if( aOldValue.hasValue() &&
276 (aOldValue >>= xBroadcaster) &&
277 xBroadcaster.is())
278 {
280 }
281
282 OSL_ASSERT( rValue.getValueType().getTypeClass() == uno::TypeClass_INTERFACE );
283 if( rValue.hasValue() &&
284 (rValue >>= xBroadcaster) &&
285 xBroadcaster.is())
286 {
288 }
289 }
290
292}
293
295 SAL_CALL DataSeries::getDataPointByIndex( sal_Int32 nIndex )
296{
298
299 std::vector< uno::Reference< chart2::data::XLabeledDataSequence > > aSequences;
300 {
301 MutexGuard aGuard( m_aMutex );
302 aSequences = m_aDataSequences;
303 }
304
305 std::vector< uno::Reference< chart2::data::XLabeledDataSequence > > aValuesSeries(
306 DataSeriesHelper::getAllDataSequencesByRole( aSequences , "values" ) );
307
308 if (aValuesSeries.empty())
309 throw lang::IndexOutOfBoundsException();
310
311 Reference< chart2::data::XDataSequence > xSeq( aValuesSeries.front()->getValues() );
312 if( 0 <= nIndex && nIndex < xSeq->getData().getLength() )
313 {
314 {
315 MutexGuard aGuard( m_aMutex );
316 tDataPointAttributeContainer::iterator aIt( m_aAttributedDataPoints.find( nIndex ) );
317 if( aIt != m_aAttributedDataPoints.end() )
318 xResult = (*aIt).second;
319 }
320 if( !xResult.is() )
321 {
322 Reference< beans::XPropertySet > xParentProperties;
323 Reference< util::XModifyListener > xModifyEventForwarder;
324 {
325 MutexGuard aGuard( m_aMutex );
326 xParentProperties = this;
327 xModifyEventForwarder = m_xModifyEventForwarder;
328 }
329
330 // create a new XPropertySet for this data point
331 xResult.set( new DataPoint( xParentProperties ) );
332 {
333 MutexGuard aGuard( m_aMutex );
334 m_aAttributedDataPoints[ nIndex ] = xResult;
335 }
336 ModifyListenerHelper::addListener( xResult, xModifyEventForwarder );
337 }
338 }
339
340 return xResult;
341}
342
343void SAL_CALL DataSeries::resetDataPoint( sal_Int32 nIndex )
344{
346 Reference< util::XModifyListener > xModifyEventForwarder;
347 {
348 MutexGuard aGuard( m_aMutex );
349 xModifyEventForwarder = m_xModifyEventForwarder;
350 tDataPointAttributeContainer::iterator aIt( m_aAttributedDataPoints.find( nIndex ));
351 if( aIt != m_aAttributedDataPoints.end())
352 {
353 xDataPointProp = (*aIt).second;
354 m_aAttributedDataPoints.erase(aIt);
355 }
356
357 }
358 if( xDataPointProp.is() )
359 {
360 Reference< util::XModifyBroadcaster > xBroadcaster( xDataPointProp, uno::UNO_QUERY );
361 if( xBroadcaster.is() && xModifyEventForwarder.is())
362 xBroadcaster->removeModifyListener( xModifyEventForwarder );
364 }
365}
366
368{
369 tDataPointAttributeContainer aOldAttributedDataPoints;
370 Reference< util::XModifyListener > xModifyEventForwarder;
371 {
372 MutexGuard aGuard( m_aMutex );
373 xModifyEventForwarder = m_xModifyEventForwarder;
374 std::swap( aOldAttributedDataPoints, m_aAttributedDataPoints );
375 }
376 ModifyListenerHelper::removeListenerFromAllMapElements( aOldAttributedDataPoints, xModifyEventForwarder );
377 aOldAttributedDataPoints.clear();
379}
380
381// ____ XDataSink ____
383{
384 tDataSequenceContainer aOldDataSequences;
385 tDataSequenceContainer aNewDataSequences;
386 Reference< util::XModifyListener > xModifyEventForwarder;
387 {
388 MutexGuard aGuard( m_aMutex );
389 xModifyEventForwarder = m_xModifyEventForwarder;
390 std::swap( aOldDataSequences, m_aDataSequences );
391 for (const auto & i : aData)
392 {
393 aNewDataSequences.push_back(i);
394 }
395 m_aDataSequences = aNewDataSequences;
396 }
397 ModifyListenerHelper::removeListenerFromAllElements( aOldDataSequences, xModifyEventForwarder );
398 ModifyListenerHelper::addListenerToAllElements( aNewDataSequences, xModifyEventForwarder );
400}
401
402void DataSeries::setData( const std::vector< uno::Reference< chart2::data::XLabeledDataSequence > >& aData )
403{
404 tDataSequenceContainer aOldDataSequences;
405 tDataSequenceContainer aNewDataSequences;
406 Reference< util::XModifyListener > xModifyEventForwarder;
407 {
408 MutexGuard aGuard( m_aMutex );
409 xModifyEventForwarder = m_xModifyEventForwarder;
410 std::swap( aOldDataSequences, m_aDataSequences );
411 aNewDataSequences = aData;
412 m_aDataSequences = aNewDataSequences;
413 }
414 ModifyListenerHelper::removeListenerFromAllElements( aOldDataSequences, xModifyEventForwarder );
415 ModifyListenerHelper::addListenerToAllElements( aNewDataSequences, xModifyEventForwarder );
417}
418
419// ____ XDataSource ____
421{
422 MutexGuard aGuard( m_aMutex );
423 return comphelper::containerToSequence<Reference< chart2::data::XLabeledDataSequence >>( m_aDataSequences );
424}
425
426// ____ XRegressionCurveContainer ____
428 const uno::Reference< chart2::XRegressionCurve >& xRegressionCurve )
429{
430 auto pRegressionCurve = dynamic_cast<RegressionCurveModel*>(xRegressionCurve.get());
431 assert(pRegressionCurve);
432 Reference< util::XModifyListener > xModifyEventForwarder;
433 {
434 MutexGuard aGuard( m_aMutex );
435 xModifyEventForwarder = m_xModifyEventForwarder;
436 if( std::find( m_aRegressionCurves.begin(), m_aRegressionCurves.end(), pRegressionCurve )
437 != m_aRegressionCurves.end())
438 throw lang::IllegalArgumentException("curve not found", static_cast<cppu::OWeakObject*>(this), 1);
439 m_aRegressionCurves.push_back( pRegressionCurve );
440 }
441 ModifyListenerHelper::addListener( rtl::Reference<RegressionCurveModel>(pRegressionCurve), xModifyEventForwarder );
443}
444
446 const uno::Reference< chart2::XRegressionCurve >& xRegressionCurve )
447{
448 if( !xRegressionCurve.is() )
449 throw container::NoSuchElementException();
450 auto pRegressionCurve = dynamic_cast<RegressionCurveModel*>(xRegressionCurve.get());
451 assert(pRegressionCurve);
452
453 Reference< util::XModifyListener > xModifyEventForwarder;
454 {
455 MutexGuard aGuard( m_aMutex );
456 xModifyEventForwarder = m_xModifyEventForwarder;
457 tRegressionCurveContainerType::iterator aIt(
458 std::find( m_aRegressionCurves.begin(), m_aRegressionCurves.end(), pRegressionCurve ) );
459 if( aIt == m_aRegressionCurves.end())
460 throw container::NoSuchElementException(
461 "The given regression curve is no element of this series",
462 static_cast< uno::XWeak * >( this ));
463 m_aRegressionCurves.erase( aIt );
464 }
465
466 ModifyListenerHelper::removeListener( rtl::Reference<RegressionCurveModel>(pRegressionCurve), xModifyEventForwarder );
468}
469
471{
472 MutexGuard aGuard( m_aMutex );
473 return comphelper::containerToSequence<uno::Reference< chart2::XRegressionCurve >>( m_aRegressionCurves );
474}
475
477 const Sequence< Reference< chart2::XRegressionCurve > >& aRegressionCurves )
478{
481 for (const auto & i : aRegressionCurves)
482 {
483 auto pRegressionCurve = dynamic_cast<RegressionCurveModel*>(i.get());
484 assert(pRegressionCurve);
485 aNewCurves.push_back(pRegressionCurve);
486 }
487 Reference< util::XModifyListener > xModifyEventForwarder;
488 {
489 MutexGuard aGuard( m_aMutex );
490 xModifyEventForwarder = m_xModifyEventForwarder;
491 std::swap( aOldCurves, m_aRegressionCurves );
492 m_aRegressionCurves = aNewCurves;
493 }
494 ModifyListenerHelper::removeListenerFromAllElements( aOldCurves, xModifyEventForwarder );
495 ModifyListenerHelper::addListenerToAllElements( aNewCurves, xModifyEventForwarder );
497}
498
499// ____ XModifyBroadcaster ____
501{
502 m_xModifyEventForwarder->addModifyListener( aListener );
503}
504
506{
507 m_xModifyEventForwarder->removeModifyListener( aListener );
508}
509
510// ____ XModifyListener ____
511void SAL_CALL DataSeries::modified( const lang::EventObject& aEvent )
512{
513 m_xModifyEventForwarder->modified( aEvent );
514}
515
516// ____ XEventListener (base of XModifyListener) ____
517void SAL_CALL DataSeries::disposing( const lang::EventObject& )
518{
519}
520
521// ____ OPropertySet ____
523{
525}
526
528{
529 m_xModifyEventForwarder->modified( lang::EventObject( static_cast< uno::XWeak* >( this )));
530}
531
533using ::property::OPropertySet;
534
537
538// implement XServiceInfo methods basing upon getSupportedServiceNames_Static
539OUString SAL_CALL DataSeries::getImplementationName()
540{
541 return "com.sun.star.comp.chart.DataSeries";
542}
543
544sal_Bool SAL_CALL DataSeries::supportsService( const OUString& rServiceName )
545{
546 return cppu::supportsService(this, rServiceName);
547}
548
549css::uno::Sequence< OUString > SAL_CALL DataSeries::getSupportedServiceNames()
550{
551 return {
552 "com.sun.star.chart2.DataSeries",
553 "com.sun.star.chart2.DataPointProperties",
554 "com.sun.star.beans.PropertySet" };
555}
556
559{
561
562 for( auto const & labeledData : rDataSequences )
563 {
564 OSL_ENSURE( labeledData.is(), "empty LabeledDataSequence" );
565 // no values are set but a label exists
566 if( labeledData.is() &&
567 ( ! labeledData->getValues().is() &&
568 labeledData->getLabel().is()))
569 {
570 xResult.set( labeledData );
571 break;
572 }
573 }
574
575 return xResult;
576}
577
579{
580 OUString aResult;
581
582 Reference< chart2::data::XTextualDataSequence > xTextSeq( xSequence, uno::UNO_QUERY );
583 if( xTextSeq.is())
584 {
585 Sequence< OUString > aSeq( xTextSeq->getTextualData());
586
587 const sal_Int32 nMax = aSeq.getLength() - 1;
588 OUStringBuffer aBuf;
589
590 for( sal_Int32 i = 0; i <= nMax; ++i )
591 {
592 aBuf.append( aSeq[i] );
593 if( i < nMax )
594 aBuf.append( ' ');
595 }
596 aResult = aBuf.makeStringAndClear();
597 }
598 else if( xSequence.is())
599 {
600 Sequence< uno::Any > aSeq( xSequence->getData());
601
602 const sal_Int32 nMax = aSeq.getLength() - 1;
603 OUString aVal;
604 OUStringBuffer aBuf;
605 double fNum = 0;
606
607 for( sal_Int32 i = 0; i <= nMax; ++i )
608 {
609 if( aSeq[i] >>= aVal )
610 {
611 aBuf.append( aVal );
612 if( i < nMax )
613 aBuf.append( ' ');
614 }
615 else if( aSeq[ i ] >>= fNum )
616 {
617 aBuf.append( fNum );
618 if( i < nMax )
619 aBuf.append( ' ');
620 }
621 }
622 aResult = aBuf.makeStringAndClear();
623 }
624
625 return aResult;
626}
627
630{
631 OUString aResult;
632 if( xLabeledSeq.is())
633 {
634 Reference< chart2::data::XDataSequence > xSeq( xLabeledSeq->getLabel());
635 if( xSeq.is() )
636 aResult = lcl_getDataSequenceLabel( xSeq );
637 if( !xSeq.is() || aResult.isEmpty() )
638 {
639 // no label set or label content is empty -> use auto-generated one
640 Reference< chart2::data::XDataSequence > xValueSeq( xLabeledSeq->getValues() );
641 if( xValueSeq.is() )
642 {
643 Sequence< OUString > aLabels( xValueSeq->generateLabel(
644 chart2::data::LabelOrigin_SHORT_SIDE ) );
645 // no labels returned is interpreted as: auto-generation not
646 // supported by sequence
647 if( aLabels.hasElements() )
648 aResult=aLabels[0];
649 else
650 {
651 //todo?: maybe use the index of the series as name
652 //but as the index may change it would be better to have such a name persistent
653 //what is not possible at the moment
654 //--> maybe use the identifier as part of the name ...
655 aResult = lcl_getDataSequenceLabel( xValueSeq );
656 }
657 }
658 }
659 }
660 return aResult;
661}
662
663OUString DataSeries::getLabelForRole( const OUString & rLabelSequenceRole )
664{
665 OUString aResult;
666
668 ::chart::DataSeriesHelper::getDataSequenceByRole( this, rLabelSequenceRole ));
669 if( xLabeledSeq.is())
670 aResult = getLabelForLabeledDataSequence( xLabeledSeq );
671 else
672 {
673 // special case: labeled data series with only a label and no values may
674 // serve as label
676 if( xLabeledSeq.is())
677 {
678 Reference< chart2::data::XDataSequence > xSeq( xLabeledSeq->getLabel());
679 if( xSeq.is())
680 aResult = lcl_getDataSequenceLabel( xSeq );
681 }
682 }
683
684 return aResult;
685}
686
688{
689 if (!xDataSequence.is())
690 return false;
691 uno::Reference< beans::XPropertySet > xProp( xDataSequence, uno::UNO_QUERY );
692 if( xProp.is() )
693 {
694 uno::Sequence< sal_Int32 > aHiddenValues;
695 try
696 {
697 xProp->getPropertyValue( "HiddenValues" ) >>= aHiddenValues;
698 if( !aHiddenValues.hasElements() )
699 return true;
700 }
701 catch( const uno::Exception& )
702 {
703 return true;
704 }
705 }
706 return xDataSequence->getData().hasElements();
707}
708
710{
711 MutexGuard aGuard( m_aMutex );
712
714 {
715 if( !rDataSequence.is() )
716 continue;
717 if( lcl_SequenceHasUnhiddenData( rDataSequence->getValues() ) )
718 return true;
719 }
720 return false;
721}
722
723
724} // namespace chart
725
726extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface *
728 css::uno::Sequence<css::uno::Any> const &)
729{
730 return cppu::acquire(new ::chart::DataSeries );
731}
732
733/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
SAL_DLLPUBLIC_EXPORT css::uno::XInterface * com_sun_star_comp_chart_DataSeries_get_implementation(css::uno::XComponentContext *, css::uno::Sequence< css::uno::Any > const &)
Definition: DataSeries.cxx:727
PropertiesInfo aProperties
AnyEventRef aEvent
virtual void SAL_CALL getFastPropertyValue(css::uno::Any &rValue, sal_Int32 nHandle) const override
The same as getFastPropertyValue, but return the value through rValue and nHandle is always valid.
Definition: DataSeries.cxx:252
std::vector< rtl::Reference< ::chart::RegressionCurveModel > > tRegressionCurveContainerType
Definition: DataSeries.hxx:144
virtual void SAL_CALL modified(const css::lang::EventObject &aEvent) override
Definition: DataSeries.cxx:511
virtual void SAL_CALL addModifyListener(const css::uno::Reference< css::util::XModifyListener > &aListener) override
Definition: DataSeries.cxx:500
virtual void SAL_CALL setData(const css::uno::Sequence< css::uno::Reference< css::chart2::data::XLabeledDataSequence > > &aData) override
virtual void SAL_CALL resetAllDataPoints() override
Definition: DataSeries.cxx:367
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
Definition: DataSeries.cxx:549
virtual void SAL_CALL removeRegressionCurve(const css::uno::Reference< css::chart2::XRegressionCurve > &aRegressionCurve) override
Definition: DataSeries.cxx:445
virtual void SAL_CALL resetDataPoint(sal_Int32 nIndex) override
Definition: DataSeries.cxx:343
tDataSequenceContainer m_aDataSequences
Definition: DataSeries.hxx:177
std::map< sal_Int32, css::uno::Reference< css::beans::XPropertySet > > tDataPointAttributeContainer
Definition: DataSeries.hxx:180
virtual void SAL_CALL addRegressionCurve(const css::uno::Reference< css::chart2::XRegressionCurve > &aRegressionCurve) override
Definition: DataSeries.cxx:427
OUString getLabelForRole(const OUString &rLabelSequenceRole)
Get the label of a series (e.g.
Definition: DataSeries.cxx:663
virtual void GetDefaultValue(sal_Int32 nHandle, css::uno::Any &rAny) const override
implement this method to provide default values for all properties supporting defaults.
Definition: DataSeries.cxx:227
virtual ::cppu::IPropertyArrayHelper &SAL_CALL getInfoHelper() override
The InfoHelper table contains all property names and types of this object.
Definition: DataSeries.cxx:238
rtl::Reference< ModifyEventForwarder > m_xModifyEventForwarder
Definition: DataSeries.hxx:185
tRegressionCurveContainerType m_aRegressionCurves
Definition: DataSeries.hxx:183
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
Definition: DataSeries.cxx:544
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
Definition: DataSeries.cxx:244
void Init(const DataSeries &rOther)
Definition: DataSeries.cxx:163
virtual css::uno::Sequence< css::uno::Reference< css::chart2::XRegressionCurve > > SAL_CALL getRegressionCurves() override
Definition: DataSeries.cxx:470
std::vector< css::uno::Reference< css::chart2::data::XLabeledDataSequence > > tDataSequenceContainer
Definition: DataSeries.hxx:137
virtual css::uno::Reference< css::beans::XPropertySet > SAL_CALL getDataPointByIndex(sal_Int32 nIndex) override
Definition: DataSeries.cxx:295
virtual void SAL_CALL setFastPropertyValue_NoBroadcast(sal_Int32 nHandle, const css::uno::Any &rValue) override
The same as setFastPropertyValue; nHandle is always valid.
Definition: DataSeries.cxx:266
virtual void SAL_CALL removeModifyListener(const css::uno::Reference< css::util::XModifyListener > &aListener) override
Definition: DataSeries.cxx:505
virtual css::uno::Reference< css::util::XCloneable > SAL_CALL createClone() override
Definition: DataSeries.cxx:217
virtual void SAL_CALL setRegressionCurves(const css::uno::Sequence< css::uno::Reference< css::chart2::XRegressionCurve > > &aRegressionCurves) override
Definition: DataSeries.cxx:476
virtual css::uno::Sequence< css::uno::Reference< css::chart2::data::XLabeledDataSequence > > SAL_CALL getDataSequences() override
Definition: DataSeries.cxx:420
tDataPointAttributeContainer m_aAttributedDataPoints
Definition: DataSeries.hxx:181
virtual ~DataSeries() override
Definition: DataSeries.cxx:188
virtual void firePropertyChangeEvent() override
implement this method in derived classes to get called when properties change.
Definition: DataSeries.cxx:522
This helper class serves as forwarder of modify events.
mutable::osl::Mutex m_aMutex
static css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL createPropertySetInfo(IPropertyArrayHelper &rProperties)
void SAL_CALL disposing()
virtual void SAL_CALL setFastPropertyValue_NoBroadcast(sal_Int32 nHandle, const css::uno::Any &rValue) override
The same as setFastPropertyValue; nHandle is always valid.
#define DBG_UNHANDLED_EXCEPTION(...)
sal_Int32 nIndex
Sequence< sal_Int8 > aSeq
aBuf
constexpr OUStringLiteral aData
double getLength(const B2DPolygon &rCandidate)
OOO_DLLPUBLIC_CHARTTOOLS void AddDefaultsToMap(::chart::tPropertyValueMap &rOutMap)
OOO_DLLPUBLIC_CHARTTOOLS void AddPropertiesToVector(std::vector< css::beans::Property > &rOutProperties)
void CloneRefVector(const std::vector< css::uno::Reference< Interface > > &rSource, std::vector< css::uno::Reference< Interface > > &rDestination)
clones a vector of UNO-References
Definition: CloneHelper.hxx:48
OOO_DLLPUBLIC_CHARTTOOLS css::uno::Reference< css::chart2::data::XLabeledDataSequence > getDataSequenceByRole(const css::uno::Reference< css::chart2::data::XDataSource > &xSource, const OUString &aRole, bool bMatchPrefix=false)
Retrieves the data sequence in the given data source that matches the given role.
OOO_DLLPUBLIC_CHARTTOOLS std::vector< css::uno::Reference< css::chart2::data::XLabeledDataSequence > > getAllDataSequencesByRole(const css::uno::Sequence< css::uno::Reference< css::chart2::data::XLabeledDataSequence > > &aDataSequences, const OUString &aRole)
Retrieves all data sequences in the given data source that match the given role prefix.
void addListenerToAllMapElements(const Container &rContainer, const css::uno::Reference< css::util::XModifyListener > &xListener)
void removeListener(const InterfaceRef &xObject, const css::uno::Reference< css::util::XModifyListener > &xListener)
void removeListenerFromAllElements(const Container &rContainer, const css::uno::Reference< css::util::XModifyListener > &xListener)
void addListenerToAllElements(const Container &rContainer, const css::uno::Reference< css::util::XModifyListener > &xListener)
void addListener(const InterfaceRef &xObject, const css::uno::Reference< css::util::XModifyListener > &xListener)
void removeListenerFromAllMapElements(const Container &rContainer, const css::uno::Reference< css::util::XModifyListener > &xListener)
void setPropertyValue(tPropertyValueMap &rOutMap, tPropertyValueMapKey key, const Value &value)
Set a property to a certain value in the given map.
::cppu::WeakImplHelper< css::chart2::XDataSeries, css::chart2::data::XDataSink, css::chart2::data::XDataSource, css::lang::XServiceInfo, css::chart2::XRegressionCurveContainer, css::util::XCloneable, css::util::XModifyBroadcaster, css::util::XModifyListener > DataSeries_Base
Definition: DataSeries.hxx:60
std::unordered_map< tPropertyValueMapKey, css::uno::Any > tPropertyValueMap
static Reference< chart2::data::XLabeledDataSequence > lcl_findLSequenceWithOnlyLabel(const Sequence< Reference< chart2::data::XLabeledDataSequence > > &rDataSequences)
Definition: DataSeries.cxx:557
static bool lcl_SequenceHasUnhiddenData(const uno::Reference< chart2::data::XDataSequence > &xDataSequence)
Definition: DataSeries.cxx:687
static OUString lcl_getDataSequenceLabel(const Reference< chart2::data::XDataSequence > &xSequence)
Definition: DataSeries.cxx:578
OOO_DLLPUBLIC_CHARTTOOLS const tPropertyValueMap & StaticDataSeriesDefaults()
Definition: DataSeries.cxx:51
static OUString getLabelForLabeledDataSequence(const Reference< chart2::data::XLabeledDataSequence > &xLabeledSeq)
Definition: DataSeries.cxx:628
css::uno::Sequence< typename M::key_type > mapKeysToSequence(M const &map)
css::uno::Sequence< DstElementType > containerToSequence(const SrcType &i_Container)
bool CPPUHELPER_DLLPUBLIC supportsService(css::lang::XServiceInfo *implementation, rtl::OUString const &name)
int i
IMPLEMENT_FORWARD_XTYPEPROVIDER2(ChildWindowPane, ChildWindowPaneInterfaceBase, Pane)
IMPLEMENT_FORWARD_XINTERFACE2(ChildWindowPane, ChildWindowPaneInterfaceBase, Pane)
HashMap_OWString_Interface aMap
sal_Int32 nHandle
bool hasValue()
unsigned char sal_Bool