1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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 "WrappedStatisticProperties.hxx"
21 #include "WrappedSeriesOrDiagramProperty.hxx"
23 #include "FastPropertyIdRanges.hxx"
24 #include "RegressionCurveHelper.hxx"
25 #include "DiagramHelper.hxx"
26 #include "ErrorBar.hxx"
27 #include "StatisticsHelper.hxx"
28 #include <unonames.hxx>
30 #include <com/sun/star/beans/PropertyAttribute.hpp>
31 #include <com/sun/star/chart/ChartErrorCategory.hpp>
32 #include <com/sun/star/chart/ErrorBarStyle.hpp>
33 #include <com/sun/star/chart/ChartErrorIndicatorType.hpp>
34 #include <com/sun/star/chart/ChartRegressionCurveType.hpp>
35 #include <com/sun/star/chart2/data/XDataProvider.hpp>
36 #include <com/sun/star/chart2/data/XRangeXMLConversion.hpp>
38 using namespace ::com::sun::star
;
39 using ::com::sun::star::uno::Any
;
40 using ::com::sun::star::uno::Reference
;
41 using ::com::sun::star::uno::Sequence
;
42 using ::com::sun::star::beans::Property
;
52 Any
lcl_getRegressionDefault()
55 aRet
<<= ::com::sun::star::chart::ChartRegressionCurveType_NONE
;
59 ::com::sun::star::chart::ChartRegressionCurveType
lcl_getRegressionCurveType(SvxChartRegress eRegressionType
)
61 ::com::sun::star::chart::ChartRegressionCurveType eRet
= ::com::sun::star::chart::ChartRegressionCurveType_NONE
;
62 switch(eRegressionType
)
64 case CHREGRESS_LINEAR
:
65 eRet
= ::com::sun::star::chart::ChartRegressionCurveType_LINEAR
;
68 eRet
= ::com::sun::star::chart::ChartRegressionCurveType_LOGARITHM
;
71 eRet
= ::com::sun::star::chart::ChartRegressionCurveType_EXPONENTIAL
;
74 eRet
= ::com::sun::star::chart::ChartRegressionCurveType_POWER
;
76 case CHREGRESS_POLYNOMIAL
:
77 eRet
= ::com::sun::star::chart::ChartRegressionCurveType_POLYNOMIAL
;
79 /*case CHREGRESS_MOVING_AVERAGE:
80 eRet = ::com::sun::star::chart::ChartRegressionCurveType_MOVING_AVERAGE;
83 eRet
= ::com::sun::star::chart::ChartRegressionCurveType_NONE
;
89 SvxChartRegress
lcl_getRegressionType( ::com::sun::star::chart::ChartRegressionCurveType eRegressionCurveType
)
92 switch (eRegressionCurveType
)
94 case ::com::sun::star::chart::ChartRegressionCurveType_LINEAR
:
95 eRet
= CHREGRESS_LINEAR
;
97 case ::com::sun::star::chart::ChartRegressionCurveType_LOGARITHM
:
100 case ::com::sun::star::chart::ChartRegressionCurveType_EXPONENTIAL
:
101 eRet
= CHREGRESS_EXP
;
103 case ::com::sun::star::chart::ChartRegressionCurveType_POLYNOMIAL
:
104 //case ::com::sun::star::chart::ChartRegressionCurveType_MOVING_AVERAGE:
105 case ::com::sun::star::chart::ChartRegressionCurveType_POWER
:
106 eRet
= CHREGRESS_POWER
;
109 eRet
= CHREGRESS_NONE
;
115 sal_Int32
lcl_getErrorBarStyle( const uno::Reference
< beans::XPropertySet
>& xErrorBarProperties
)
117 sal_Int32 nStyle
= ::com::sun::star::chart::ErrorBarStyle::NONE
;
118 if(xErrorBarProperties
.is())
119 xErrorBarProperties
->getPropertyValue( "ErrorBarStyle" ) >>= nStyle
;
123 uno::Reference
< chart2::data::XDataProvider
> lcl_getDataProviderFromContact(
124 ::boost::shared_ptr
< Chart2ModelContact
> spChart2ModelContact
)
126 uno::Reference
< chart2::data::XDataProvider
> xResult
;
127 if( spChart2ModelContact
.get())
129 uno::Reference
< chart2::XChartDocument
> xChartDoc(
130 spChart2ModelContact
->getChart2Document());
132 xResult
.set( xChartDoc
->getDataProvider());
137 void lcl_ConvertRangeFromXML(
138 OUString
& rInOutRange
,
139 ::boost::shared_ptr
< Chart2ModelContact
> spChart2ModelContact
)
141 if( !rInOutRange
.isEmpty())
143 uno::Reference
< chart2::data::XRangeXMLConversion
> xConverter(
144 lcl_getDataProviderFromContact( spChart2ModelContact
), uno::UNO_QUERY
);
147 OUString aResult
= xConverter
->convertRangeFromXML( rInOutRange
);
148 rInOutRange
= aResult
;
153 void lcl_ConvertRangeToXML(
154 OUString
& rInOutRange
,
155 ::boost::shared_ptr
< Chart2ModelContact
> spChart2ModelContact
)
157 if( !rInOutRange
.isEmpty())
159 uno::Reference
< chart2::data::XRangeXMLConversion
> xConverter(
160 lcl_getDataProviderFromContact( spChart2ModelContact
), uno::UNO_QUERY
);
163 OUString aResult
= xConverter
->convertRangeToXML( rInOutRange
);
164 rInOutRange
= aResult
;
169 }//anonymous namespace
171 template< typename PROPERTYTYPE
>
172 class WrappedStatisticProperty
: public WrappedSeriesOrDiagramProperty
< PROPERTYTYPE
>
175 explicit WrappedStatisticProperty( const OUString
& rName
, const Any
& rDefaulValue
176 , ::boost::shared_ptr
< Chart2ModelContact
> spChart2ModelContact
177 , tSeriesOrDiagramPropertyType ePropertyType
)
178 : WrappedSeriesOrDiagramProperty
< PROPERTYTYPE
>(rName
,rDefaulValue
,spChart2ModelContact
,ePropertyType
)
180 virtual ~WrappedStatisticProperty() {};
183 static uno::Reference
< beans::XPropertySet
> getOrCreateErrorBarProperties( const Reference
< beans::XPropertySet
>& xSeriesPropertySet
)
185 if(!xSeriesPropertySet
.is())
187 uno::Reference
< beans::XPropertySet
> xErrorBarProperties
;
188 xSeriesPropertySet
->getPropertyValue( CHART_UNONAME_ERRORBAR_Y
) >>= xErrorBarProperties
;
189 if( !xErrorBarProperties
.is() )
191 // todo: use a valid context
192 xErrorBarProperties
= ::chart::createErrorBar( uno::Reference
< uno::XComponentContext
>() );
193 //default in new and old api are different
194 xErrorBarProperties
->setPropertyValue( "ShowPositiveError" , uno::makeAny(false) );
195 xErrorBarProperties
->setPropertyValue( "ShowNegativeError" , uno::makeAny(false) );
196 xErrorBarProperties
->setPropertyValue( "ErrorBarStyle" , uno::makeAny(::com::sun::star::chart::ErrorBarStyle::NONE
) );
197 xSeriesPropertySet
->setPropertyValue( CHART_UNONAME_ERRORBAR_Y
, uno::makeAny( xErrorBarProperties
) );
199 return xErrorBarProperties
;
204 //PROP_CHART_STATISTIC_CONST_ERROR_LOW
205 class WrappedConstantErrorLowProperty
: public WrappedStatisticProperty
< double >
208 virtual double getValueFromSeries( const Reference
< beans::XPropertySet
>& xSeriesPropertySet
) const SAL_OVERRIDE
;
209 virtual void setValueToSeries( const Reference
< beans::XPropertySet
>& xSeriesPropertySet
, const double& aNewValue
) const SAL_OVERRIDE
;
211 explicit WrappedConstantErrorLowProperty( ::boost::shared_ptr
< Chart2ModelContact
> spChart2ModelContact
,
212 tSeriesOrDiagramPropertyType ePropertyType
);
213 virtual ~WrappedConstantErrorLowProperty();
216 mutable Any m_aOuterValue
;
219 WrappedConstantErrorLowProperty::WrappedConstantErrorLowProperty(
220 ::boost::shared_ptr
< Chart2ModelContact
> spChart2ModelContact
,
221 tSeriesOrDiagramPropertyType ePropertyType
)
222 : WrappedStatisticProperty
< double >( "ConstantErrorLow"
223 , uno::makeAny( double(0.0) ), spChart2ModelContact
, ePropertyType
)
226 WrappedConstantErrorLowProperty::~WrappedConstantErrorLowProperty()
230 double WrappedConstantErrorLowProperty::getValueFromSeries( const Reference
< beans::XPropertySet
>& xSeriesPropertySet
) const
233 m_aDefaultValue
>>= aRet
;
234 uno::Reference
< beans::XPropertySet
> xErrorBarProperties
;
235 if( xSeriesPropertySet
.is() && ( xSeriesPropertySet
->getPropertyValue( CHART_UNONAME_ERRORBAR_Y
) >>= xErrorBarProperties
) && xErrorBarProperties
.is())
237 if( ::com::sun::star::chart::ErrorBarStyle::ABSOLUTE
== lcl_getErrorBarStyle( xErrorBarProperties
) )
238 xErrorBarProperties
->getPropertyValue( "NegativeError" ) >>= aRet
;
240 m_aOuterValue
>>= aRet
;
245 void WrappedConstantErrorLowProperty::setValueToSeries( const Reference
< beans::XPropertySet
>& xSeriesPropertySet
, const double& aNewValue
) const
247 uno::Reference
< beans::XPropertySet
> xErrorBarProperties( getOrCreateErrorBarProperties(xSeriesPropertySet
) );
248 if( xErrorBarProperties
.is() )
250 m_aOuterValue
= uno::makeAny( aNewValue
);
251 if( ::com::sun::star::chart::ErrorBarStyle::ABSOLUTE
== lcl_getErrorBarStyle( xErrorBarProperties
) )
253 xErrorBarProperties
->setPropertyValue( "NegativeError", m_aOuterValue
);
258 //PROP_CHART_STATISTIC_CONST_ERROR_HIGH
259 class WrappedConstantErrorHighProperty
: public WrappedStatisticProperty
< double >
262 virtual double getValueFromSeries( const Reference
< beans::XPropertySet
>& xSeriesPropertySet
) const SAL_OVERRIDE
;
263 virtual void setValueToSeries( const Reference
< beans::XPropertySet
>& xSeriesPropertySet
, const double& aNewValue
) const SAL_OVERRIDE
;
265 explicit WrappedConstantErrorHighProperty( ::boost::shared_ptr
< Chart2ModelContact
> spChart2ModelContact
,
266 tSeriesOrDiagramPropertyType ePropertyType
);
267 virtual ~WrappedConstantErrorHighProperty();
270 mutable Any m_aOuterValue
;
273 WrappedConstantErrorHighProperty::WrappedConstantErrorHighProperty(
274 ::boost::shared_ptr
< Chart2ModelContact
> spChart2ModelContact
,
275 tSeriesOrDiagramPropertyType ePropertyType
)
276 : WrappedStatisticProperty
< double >( "ConstantErrorHigh"
277 , uno::makeAny( double(0.0) ), spChart2ModelContact
, ePropertyType
)
280 WrappedConstantErrorHighProperty::~WrappedConstantErrorHighProperty()
284 double WrappedConstantErrorHighProperty::getValueFromSeries( const Reference
< beans::XPropertySet
>& xSeriesPropertySet
) const
287 m_aDefaultValue
>>= aRet
;
288 uno::Reference
< beans::XPropertySet
> xErrorBarProperties
;
289 if( xSeriesPropertySet
.is() && ( xSeriesPropertySet
->getPropertyValue( CHART_UNONAME_ERRORBAR_Y
) >>= xErrorBarProperties
) && xErrorBarProperties
.is())
291 if( ::com::sun::star::chart::ErrorBarStyle::ABSOLUTE
== lcl_getErrorBarStyle( xErrorBarProperties
) )
292 xErrorBarProperties
->getPropertyValue( "PositiveError" ) >>= aRet
;
294 m_aOuterValue
>>= aRet
;
299 void WrappedConstantErrorHighProperty::setValueToSeries( const Reference
< beans::XPropertySet
>& xSeriesPropertySet
, const double& aNewValue
) const
301 uno::Reference
< beans::XPropertySet
> xErrorBarProperties( getOrCreateErrorBarProperties(xSeriesPropertySet
) );
302 if( xErrorBarProperties
.is() )
304 m_aOuterValue
= uno::makeAny( aNewValue
);
305 if( ::com::sun::star::chart::ErrorBarStyle::ABSOLUTE
== lcl_getErrorBarStyle( xErrorBarProperties
) )
307 xErrorBarProperties
->setPropertyValue( "PositiveError" , m_aOuterValue
);
312 //PROP_CHART_STATISTIC_MEAN_VALUE
313 class WrappedMeanValueProperty
: public WrappedStatisticProperty
< sal_Bool
>
316 virtual sal_Bool
getValueFromSeries( const Reference
< beans::XPropertySet
>& xSeriesPropertySet
) const SAL_OVERRIDE
;
317 virtual void setValueToSeries( const Reference
< beans::XPropertySet
>& xSeriesPropertySet
, const sal_Bool
& aNewValue
) const SAL_OVERRIDE
;
319 explicit WrappedMeanValueProperty( ::boost::shared_ptr
< Chart2ModelContact
> spChart2ModelContact
,
320 tSeriesOrDiagramPropertyType ePropertyType
);
321 virtual ~WrappedMeanValueProperty();
324 WrappedMeanValueProperty::WrappedMeanValueProperty(
325 ::boost::shared_ptr
< Chart2ModelContact
> spChart2ModelContact
,
326 tSeriesOrDiagramPropertyType ePropertyType
)
327 : WrappedStatisticProperty
< sal_Bool
>( "MeanValue", uno::makeAny( sal_False
), spChart2ModelContact
, ePropertyType
)
330 WrappedMeanValueProperty::~WrappedMeanValueProperty()
334 sal_Bool
WrappedMeanValueProperty::getValueFromSeries( const Reference
< beans::XPropertySet
>& xSeriesPropertySet
) const
337 uno::Reference
< chart2::XRegressionCurveContainer
> xRegCnt( xSeriesPropertySet
, uno::UNO_QUERY
);
339 bRet
= RegressionCurveHelper::hasMeanValueLine( xRegCnt
);
343 void WrappedMeanValueProperty::setValueToSeries( const Reference
< beans::XPropertySet
>& xSeriesPropertySet
, const sal_Bool
& aNewValue
) const
345 uno::Reference
< chart2::XRegressionCurveContainer
> xRegCnt( xSeriesPropertySet
, uno::UNO_QUERY
);
349 RegressionCurveHelper::addMeanValueLine( xRegCnt
, 0, 0 );
351 RegressionCurveHelper::removeMeanValueLine( xRegCnt
);
355 //PROP_CHART_STATISTIC_ERROR_CATEGORY
356 // deprecated, replaced by ErrorBarStyle
357 class WrappedErrorCategoryProperty
: public WrappedStatisticProperty
< ::com::sun::star::chart::ChartErrorCategory
>
360 virtual ::com::sun::star::chart::ChartErrorCategory
getValueFromSeries( const Reference
< beans::XPropertySet
>& xSeriesPropertySet
) const SAL_OVERRIDE
;
361 virtual void setValueToSeries( const Reference
< beans::XPropertySet
>& xSeriesPropertySet
, const ::com::sun::star::chart::ChartErrorCategory
& aNewValue
) const SAL_OVERRIDE
;
363 explicit WrappedErrorCategoryProperty( ::boost::shared_ptr
< Chart2ModelContact
> spChart2ModelContact
,
364 tSeriesOrDiagramPropertyType ePropertyType
);
365 virtual ~WrappedErrorCategoryProperty();
368 WrappedErrorCategoryProperty::WrappedErrorCategoryProperty(
369 ::boost::shared_ptr
< Chart2ModelContact
> spChart2ModelContact
,
370 tSeriesOrDiagramPropertyType ePropertyType
)
371 : WrappedStatisticProperty
< ::com::sun::star::chart::ChartErrorCategory
>( "ErrorCategory"
372 , uno::makeAny( ::com::sun::star::chart::ChartErrorCategory_NONE
), spChart2ModelContact
, ePropertyType
)
375 WrappedErrorCategoryProperty::~WrappedErrorCategoryProperty()
379 ::com::sun::star::chart::ChartErrorCategory
WrappedErrorCategoryProperty::getValueFromSeries( const Reference
< beans::XPropertySet
>& xSeriesPropertySet
) const
381 ::com::sun::star::chart::ChartErrorCategory aRet
= ::com::sun::star::chart::ChartErrorCategory_NONE
;
382 m_aDefaultValue
>>= aRet
;
383 uno::Reference
< beans::XPropertySet
> xErrorBarProperties
;
384 if( xSeriesPropertySet
.is() && ( xSeriesPropertySet
->getPropertyValue( CHART_UNONAME_ERRORBAR_Y
) >>= xErrorBarProperties
) && xErrorBarProperties
.is())
386 sal_Int32 nStyle
= ::com::sun::star::chart::ErrorBarStyle::NONE
;
387 xErrorBarProperties
->getPropertyValue( "ErrorBarStyle" ) >>= nStyle
;
390 case ::com::sun::star::chart::ErrorBarStyle::NONE
:
391 aRet
= ::com::sun::star::chart::ChartErrorCategory_NONE
;
393 case ::com::sun::star::chart::ErrorBarStyle::VARIANCE
:
394 aRet
= ::com::sun::star::chart::ChartErrorCategory_VARIANCE
;
396 case ::com::sun::star::chart::ErrorBarStyle::STANDARD_DEVIATION
:
397 aRet
= ::com::sun::star::chart::ChartErrorCategory_STANDARD_DEVIATION
;
399 case ::com::sun::star::chart::ErrorBarStyle::ABSOLUTE
:
400 aRet
= ::com::sun::star::chart::ChartErrorCategory_CONSTANT_VALUE
;
402 case ::com::sun::star::chart::ErrorBarStyle::RELATIVE
:
403 aRet
= ::com::sun::star::chart::ChartErrorCategory_PERCENT
;
405 case ::com::sun::star::chart::ErrorBarStyle::ERROR_MARGIN
:
406 aRet
= ::com::sun::star::chart::ChartErrorCategory_ERROR_MARGIN
;
408 case ::com::sun::star::chart::ErrorBarStyle::STANDARD_ERROR
:
410 case ::com::sun::star::chart::ErrorBarStyle::FROM_DATA
:
418 void WrappedErrorCategoryProperty::setValueToSeries( const Reference
< beans::XPropertySet
>& xSeriesPropertySet
, const ::com::sun::star::chart::ChartErrorCategory
& aNewValue
) const
420 if( !xSeriesPropertySet
.is() )
423 uno::Reference
< beans::XPropertySet
> xErrorBarProperties( getOrCreateErrorBarProperties(xSeriesPropertySet
) );
424 if( xErrorBarProperties
.is() )
426 sal_Int32 nNewStyle
= ::com::sun::star::chart::ErrorBarStyle::NONE
;
429 case ::com::sun::star::chart::ChartErrorCategory_NONE
:
430 nNewStyle
= ::com::sun::star::chart::ErrorBarStyle::NONE
;
432 case ::com::sun::star::chart::ChartErrorCategory_VARIANCE
:
433 nNewStyle
= ::com::sun::star::chart::ErrorBarStyle::VARIANCE
;
435 case ::com::sun::star::chart::ChartErrorCategory_STANDARD_DEVIATION
:
436 nNewStyle
= ::com::sun::star::chart::ErrorBarStyle::STANDARD_DEVIATION
;
438 case ::com::sun::star::chart::ChartErrorCategory_CONSTANT_VALUE
:
439 nNewStyle
= ::com::sun::star::chart::ErrorBarStyle::ABSOLUTE
;
441 case ::com::sun::star::chart::ChartErrorCategory_PERCENT
:
442 nNewStyle
= ::com::sun::star::chart::ErrorBarStyle::RELATIVE
;
444 case ::com::sun::star::chart::ChartErrorCategory_ERROR_MARGIN
:
445 nNewStyle
= ::com::sun::star::chart::ErrorBarStyle::ERROR_MARGIN
;
450 xErrorBarProperties
->setPropertyValue( "ErrorBarStyle" , uno::makeAny(nNewStyle
) );
454 //PROP_CHART_STATISTIC_PERCENT_ERROR
455 class WrappedPercentageErrorProperty
: public WrappedStatisticProperty
< double >
458 virtual double getValueFromSeries( const Reference
< beans::XPropertySet
>& xSeriesPropertySet
) const SAL_OVERRIDE
;
459 virtual void setValueToSeries( const Reference
< beans::XPropertySet
>& xSeriesPropertySet
, const double& aNewValue
) const SAL_OVERRIDE
;
461 explicit WrappedPercentageErrorProperty( ::boost::shared_ptr
< Chart2ModelContact
> spChart2ModelContact
,
462 tSeriesOrDiagramPropertyType ePropertyType
);
463 virtual ~WrappedPercentageErrorProperty();
466 mutable Any m_aOuterValue
;
469 WrappedPercentageErrorProperty::WrappedPercentageErrorProperty(
470 ::boost::shared_ptr
< Chart2ModelContact
> spChart2ModelContact
,
471 tSeriesOrDiagramPropertyType ePropertyType
)
472 : WrappedStatisticProperty
< double >( "PercentageError"
473 , uno::makeAny( double(0.0) ), spChart2ModelContact
, ePropertyType
)
476 WrappedPercentageErrorProperty::~WrappedPercentageErrorProperty()
480 double WrappedPercentageErrorProperty::getValueFromSeries( const Reference
< beans::XPropertySet
>& xSeriesPropertySet
) const
483 m_aDefaultValue
>>= aRet
;
484 uno::Reference
< beans::XPropertySet
> xErrorBarProperties
;
485 if( xSeriesPropertySet
.is() && ( xSeriesPropertySet
->getPropertyValue( CHART_UNONAME_ERRORBAR_Y
) >>= xErrorBarProperties
) && xErrorBarProperties
.is())
487 if( ::com::sun::star::chart::ErrorBarStyle::RELATIVE
== lcl_getErrorBarStyle( xErrorBarProperties
) )
488 xErrorBarProperties
->getPropertyValue( "PositiveError" ) >>= aRet
;
490 m_aOuterValue
>>= aRet
;
494 void WrappedPercentageErrorProperty::setValueToSeries( const Reference
< beans::XPropertySet
>& xSeriesPropertySet
, const double& aNewValue
) const
496 uno::Reference
< beans::XPropertySet
> xErrorBarProperties( getOrCreateErrorBarProperties(xSeriesPropertySet
) );
497 if( xErrorBarProperties
.is() )
499 m_aOuterValue
= uno::makeAny( aNewValue
);
500 if( ::com::sun::star::chart::ErrorBarStyle::RELATIVE
== lcl_getErrorBarStyle( xErrorBarProperties
) )
502 xErrorBarProperties
->setPropertyValue( "PositiveError" , m_aOuterValue
);
503 xErrorBarProperties
->setPropertyValue( "NegativeError" , m_aOuterValue
);
508 //PROP_CHART_STATISTIC_ERROR_MARGIN
509 class WrappedErrorMarginProperty
: public WrappedStatisticProperty
< double >
512 virtual double getValueFromSeries( const Reference
< beans::XPropertySet
>& xSeriesPropertySet
) const SAL_OVERRIDE
;
513 virtual void setValueToSeries( const Reference
< beans::XPropertySet
>& xSeriesPropertySet
, const double& aNewValue
) const SAL_OVERRIDE
;
515 explicit WrappedErrorMarginProperty( ::boost::shared_ptr
< Chart2ModelContact
> spChart2ModelContact
,
516 tSeriesOrDiagramPropertyType ePropertyType
);
517 virtual ~WrappedErrorMarginProperty();
520 mutable Any m_aOuterValue
;
523 WrappedErrorMarginProperty::WrappedErrorMarginProperty(
524 ::boost::shared_ptr
< Chart2ModelContact
> spChart2ModelContact
,
525 tSeriesOrDiagramPropertyType ePropertyType
)
526 : WrappedStatisticProperty
< double >( "ErrorMargin"
527 , uno::makeAny( double(0.0) ), spChart2ModelContact
, ePropertyType
)
530 WrappedErrorMarginProperty::~WrappedErrorMarginProperty()
534 double WrappedErrorMarginProperty::getValueFromSeries( const Reference
< beans::XPropertySet
>& xSeriesPropertySet
) const
537 m_aDefaultValue
>>= aRet
;
538 uno::Reference
< beans::XPropertySet
> xErrorBarProperties
;
539 if( xSeriesPropertySet
.is() && ( xSeriesPropertySet
->getPropertyValue( CHART_UNONAME_ERRORBAR_Y
) >>= xErrorBarProperties
) && xErrorBarProperties
.is())
541 if( ::com::sun::star::chart::ErrorBarStyle::ERROR_MARGIN
== lcl_getErrorBarStyle( xErrorBarProperties
) )
542 xErrorBarProperties
->getPropertyValue( "PositiveError" ) >>= aRet
;
544 m_aOuterValue
>>= aRet
;
548 void WrappedErrorMarginProperty::setValueToSeries( const Reference
< beans::XPropertySet
>& xSeriesPropertySet
, const double& aNewValue
) const
550 uno::Reference
< beans::XPropertySet
> xErrorBarProperties( getOrCreateErrorBarProperties(xSeriesPropertySet
) );
551 if( xErrorBarProperties
.is() )
553 m_aOuterValue
= uno::makeAny( aNewValue
);
554 if( ::com::sun::star::chart::ErrorBarStyle::ERROR_MARGIN
== lcl_getErrorBarStyle( xErrorBarProperties
) )
556 xErrorBarProperties
->setPropertyValue( "PositiveError" , m_aOuterValue
);
557 xErrorBarProperties
->setPropertyValue( "NegativeError" , m_aOuterValue
);
562 //PROP_CHART_STATISTIC_ERROR_INDICATOR
563 class WrappedErrorIndicatorProperty
: public WrappedStatisticProperty
< ::com::sun::star::chart::ChartErrorIndicatorType
>
566 virtual ::com::sun::star::chart::ChartErrorIndicatorType
getValueFromSeries( const Reference
< beans::XPropertySet
>& xSeriesPropertySet
) const SAL_OVERRIDE
;
567 virtual void setValueToSeries( const Reference
< beans::XPropertySet
>& xSeriesPropertySet
, const ::com::sun::star::chart::ChartErrorIndicatorType
& aNewValue
) const SAL_OVERRIDE
;
569 explicit WrappedErrorIndicatorProperty( ::boost::shared_ptr
< Chart2ModelContact
> spChart2ModelContact
,
570 tSeriesOrDiagramPropertyType ePropertyType
);
571 virtual ~WrappedErrorIndicatorProperty();
574 WrappedErrorIndicatorProperty::WrappedErrorIndicatorProperty(
575 ::boost::shared_ptr
< Chart2ModelContact
> spChart2ModelContact
,
576 tSeriesOrDiagramPropertyType ePropertyType
)
577 : WrappedStatisticProperty
< ::com::sun::star::chart::ChartErrorIndicatorType
>( "ErrorIndicator"
578 , uno::makeAny( ::com::sun::star::chart::ChartErrorIndicatorType_NONE
), spChart2ModelContact
, ePropertyType
)
581 WrappedErrorIndicatorProperty::~WrappedErrorIndicatorProperty()
585 ::com::sun::star::chart::ChartErrorIndicatorType
WrappedErrorIndicatorProperty::getValueFromSeries( const Reference
< beans::XPropertySet
>& xSeriesPropertySet
) const
587 ::com::sun::star::chart::ChartErrorIndicatorType aRet
= ::com::sun::star::chart::ChartErrorIndicatorType_NONE
;
588 m_aDefaultValue
>>= aRet
;
589 uno::Reference
< beans::XPropertySet
> xErrorBarProperties
;
590 if( xSeriesPropertySet
.is() && ( xSeriesPropertySet
->getPropertyValue( CHART_UNONAME_ERRORBAR_Y
) >>= xErrorBarProperties
) && xErrorBarProperties
.is())
592 bool bPositive
= false;
593 bool bNegative
= false;
594 xErrorBarProperties
->getPropertyValue( "ShowPositiveError" ) >>= bPositive
;
595 xErrorBarProperties
->getPropertyValue( "ShowNegativeError" ) >>= bNegative
;
597 if( bPositive
&& bNegative
)
598 aRet
= ::com::sun::star::chart::ChartErrorIndicatorType_TOP_AND_BOTTOM
;
599 else if( bPositive
&& !bNegative
)
600 aRet
= ::com::sun::star::chart::ChartErrorIndicatorType_UPPER
;
601 else if( !bPositive
&& bNegative
)
602 aRet
= ::com::sun::star::chart::ChartErrorIndicatorType_LOWER
;
606 void WrappedErrorIndicatorProperty::setValueToSeries( const Reference
< beans::XPropertySet
>& xSeriesPropertySet
, const ::com::sun::star::chart::ChartErrorIndicatorType
& aNewValue
) const
608 uno::Reference
< beans::XPropertySet
> xErrorBarProperties( getOrCreateErrorBarProperties(xSeriesPropertySet
) );
609 if( xErrorBarProperties
.is() )
611 bool bPositive
= false;
612 bool bNegative
= false;
615 case ::com::sun::star::chart::ChartErrorIndicatorType_TOP_AND_BOTTOM
:
619 case ::com::sun::star::chart::ChartErrorIndicatorType_UPPER
:
622 case ::com::sun::star::chart::ChartErrorIndicatorType_LOWER
:
629 xErrorBarProperties
->setPropertyValue( "ShowPositiveError" , uno::makeAny(bPositive
) );
630 xErrorBarProperties
->setPropertyValue( "ShowNegativeError" , uno::makeAny(bNegative
) );
634 //PROP_CHART_STATISTIC_ERROR_BAR_STYLE
635 // this is the new constant group that replaces the deprecated enum ChartErrorCategory
636 class WrappedErrorBarStyleProperty
: public WrappedStatisticProperty
< sal_Int32
>
639 virtual sal_Int32
getValueFromSeries( const Reference
< beans::XPropertySet
>& xSeriesPropertySet
) const SAL_OVERRIDE
;
640 virtual void setValueToSeries( const Reference
< beans::XPropertySet
>& xSeriesPropertySet
, const sal_Int32
& nNewValue
) const SAL_OVERRIDE
;
642 explicit WrappedErrorBarStyleProperty( ::boost::shared_ptr
< Chart2ModelContact
> spChart2ModelContact1
,
643 tSeriesOrDiagramPropertyType ePropertyType
);
644 virtual ~WrappedErrorBarStyleProperty();
647 WrappedErrorBarStyleProperty::WrappedErrorBarStyleProperty(
648 ::boost::shared_ptr
< Chart2ModelContact
> spChart2ModelContact
,
649 tSeriesOrDiagramPropertyType ePropertyType
)
650 : WrappedStatisticProperty
< sal_Int32
>( "ErrorBarStyle"
651 , uno::makeAny( ::com::sun::star::chart::ErrorBarStyle::NONE
), spChart2ModelContact
, ePropertyType
)
654 WrappedErrorBarStyleProperty::~WrappedErrorBarStyleProperty()
658 sal_Int32
WrappedErrorBarStyleProperty::getValueFromSeries( const Reference
< beans::XPropertySet
>& xSeriesPropertySet
) const
660 sal_Int32 nRet
= ::com::sun::star::chart::ErrorBarStyle::NONE
;
661 m_aDefaultValue
>>= nRet
;
662 uno::Reference
< beans::XPropertySet
> xErrorBarProperties
;
663 if( xSeriesPropertySet
.is() && ( xSeriesPropertySet
->getPropertyValue( CHART_UNONAME_ERRORBAR_Y
) >>= xErrorBarProperties
) && xErrorBarProperties
.is())
665 xErrorBarProperties
->getPropertyValue( "ErrorBarStyle" ) >>= nRet
;
669 void WrappedErrorBarStyleProperty::setValueToSeries( const Reference
< beans::XPropertySet
>& xSeriesPropertySet
, const sal_Int32
& nNewValue
) const
671 if( !xSeriesPropertySet
.is() )
674 uno::Reference
< beans::XPropertySet
> xErrorBarProperties( getOrCreateErrorBarProperties(xSeriesPropertySet
) );
675 if( xErrorBarProperties
.is() )
677 xErrorBarProperties
->setPropertyValue( "ErrorBarStyle" , uno::makeAny( nNewValue
));
681 //PROP_CHART_STATISTIC_ERROR_RANGE_POSITIVE
682 class WrappedErrorBarRangePositiveProperty
: public WrappedStatisticProperty
< OUString
>
685 virtual OUString
getValueFromSeries( const Reference
< beans::XPropertySet
>& xSeriesPropertySet
) const SAL_OVERRIDE
;
686 virtual void setValueToSeries( const Reference
< beans::XPropertySet
>& xSeriesPropertySet
, const OUString
& aNewValue
) const SAL_OVERRIDE
;
688 explicit WrappedErrorBarRangePositiveProperty( ::boost::shared_ptr
< Chart2ModelContact
> spChart2ModelContact
,
689 tSeriesOrDiagramPropertyType ePropertyType
);
690 virtual ~WrappedErrorBarRangePositiveProperty();
693 mutable Any m_aOuterValue
;
696 WrappedErrorBarRangePositiveProperty::WrappedErrorBarRangePositiveProperty(
697 ::boost::shared_ptr
< Chart2ModelContact
> spChart2ModelContact
,
698 tSeriesOrDiagramPropertyType ePropertyType
)
699 : WrappedStatisticProperty
< OUString
>( "ErrorBarRangePositive"
700 , uno::makeAny( OUString() ), spChart2ModelContact
, ePropertyType
)
703 WrappedErrorBarRangePositiveProperty::~WrappedErrorBarRangePositiveProperty()
707 OUString
WrappedErrorBarRangePositiveProperty::getValueFromSeries( const Reference
< beans::XPropertySet
>& xSeriesPropertySet
) const
710 m_aDefaultValue
>>= aRet
;
711 uno::Reference
< chart2::data::XDataSource
> xErrorBarDataSource
;
712 if( xSeriesPropertySet
.is() &&
713 ( xSeriesPropertySet
->getPropertyValue( CHART_UNONAME_ERRORBAR_Y
) >>= xErrorBarDataSource
) &&
714 xErrorBarDataSource
.is())
716 uno::Reference
< chart2::data::XDataSequence
> xSeq(
717 StatisticsHelper::getErrorDataSequenceFromDataSource(
718 xErrorBarDataSource
, true /* positive */, true /* y-error */ ));
720 aRet
= xSeq
->getSourceRangeRepresentation();
722 m_aOuterValue
>>= aRet
;
724 lcl_ConvertRangeToXML( aRet
, m_spChart2ModelContact
);
728 void WrappedErrorBarRangePositiveProperty::setValueToSeries( const Reference
< beans::XPropertySet
>& xSeriesPropertySet
, const OUString
& aNewValue
) const
730 uno::Reference
< beans::XPropertySet
> xErrorBarProperties( getOrCreateErrorBarProperties(xSeriesPropertySet
) );
731 if( xErrorBarProperties
.is() )
733 uno::Reference
< chart2::data::XDataProvider
> xDataProvider(
734 lcl_getDataProviderFromContact( m_spChart2ModelContact
));
735 uno::Reference
< chart2::data::XDataSource
> xDataSource( xErrorBarProperties
, uno::UNO_QUERY
);
736 if( xDataSource
.is() && xDataProvider
.is())
738 OUString
aTmp( aNewValue
);
739 OUString
aXMLRange( aNewValue
);
740 lcl_ConvertRangeFromXML( aTmp
, m_spChart2ModelContact
);
741 StatisticsHelper::setErrorDataSequence(
742 xDataSource
, xDataProvider
, aTmp
, true /* positive */, true /* y-error */, &aXMLRange
);
743 m_aOuterValue
<<= aTmp
;
748 //PROP_CHART_STATISTIC_ERROR_RANGE_NEGATIVE
749 class WrappedErrorBarRangeNegativeProperty
: public WrappedStatisticProperty
< OUString
>
752 virtual OUString
getValueFromSeries( const Reference
< beans::XPropertySet
>& xSeriesPropertySet
) const SAL_OVERRIDE
;
753 virtual void setValueToSeries( const Reference
< beans::XPropertySet
>& xSeriesPropertySet
, const OUString
& aNewValue
) const SAL_OVERRIDE
;
755 explicit WrappedErrorBarRangeNegativeProperty( ::boost::shared_ptr
< Chart2ModelContact
> spChart2ModelContact
,
756 tSeriesOrDiagramPropertyType ePropertyType
);
757 virtual ~WrappedErrorBarRangeNegativeProperty();
760 mutable Any m_aOuterValue
;
763 WrappedErrorBarRangeNegativeProperty::WrappedErrorBarRangeNegativeProperty(
764 ::boost::shared_ptr
< Chart2ModelContact
> spChart2ModelContact
,
765 tSeriesOrDiagramPropertyType ePropertyType
)
766 : WrappedStatisticProperty
< OUString
>( "ErrorBarRangeNegative"
767 , uno::makeAny( OUString() ), spChart2ModelContact
, ePropertyType
)
770 WrappedErrorBarRangeNegativeProperty::~WrappedErrorBarRangeNegativeProperty()
774 OUString
WrappedErrorBarRangeNegativeProperty::getValueFromSeries( const Reference
< beans::XPropertySet
>& xSeriesPropertySet
) const
777 m_aDefaultValue
>>= aRet
;
778 uno::Reference
< chart2::data::XDataSource
> xErrorBarDataSource
;
779 if( xSeriesPropertySet
.is() &&
780 ( xSeriesPropertySet
->getPropertyValue( CHART_UNONAME_ERRORBAR_Y
) >>= xErrorBarDataSource
) &&
781 xErrorBarDataSource
.is())
783 uno::Reference
< chart2::data::XDataSequence
> xSeq(
784 StatisticsHelper::getErrorDataSequenceFromDataSource(
785 xErrorBarDataSource
, false /* positive */, true /* y-error */ ));
787 aRet
= xSeq
->getSourceRangeRepresentation();
789 m_aOuterValue
>>= aRet
;
791 lcl_ConvertRangeToXML( aRet
, m_spChart2ModelContact
);
795 void WrappedErrorBarRangeNegativeProperty::setValueToSeries( const Reference
< beans::XPropertySet
>& xSeriesPropertySet
, const OUString
& aNewValue
) const
797 uno::Reference
< beans::XPropertySet
> xErrorBarProperties( getOrCreateErrorBarProperties(xSeriesPropertySet
) );
798 if( xErrorBarProperties
.is() )
800 uno::Reference
< chart2::data::XDataProvider
> xDataProvider(
801 lcl_getDataProviderFromContact( m_spChart2ModelContact
));
802 uno::Reference
< chart2::data::XDataSource
> xDataSource( xErrorBarProperties
, uno::UNO_QUERY
);
803 if( xDataSource
.is() && xDataProvider
.is())
805 OUString
aTmp( aNewValue
);
806 OUString
aXMLRange( aNewValue
);
807 lcl_ConvertRangeFromXML( aTmp
, m_spChart2ModelContact
);
808 StatisticsHelper::setErrorDataSequence(
809 xDataSource
, xDataProvider
, aTmp
, false /* positive */, true /* y-error */, &aXMLRange
);
810 m_aOuterValue
<<= aTmp
;
815 //PROP_CHART_STATISTIC_REGRESSION_CURVES
816 class WrappedRegressionCurvesProperty
: public WrappedStatisticProperty
< ::com::sun::star::chart::ChartRegressionCurveType
>
819 virtual ::com::sun::star::chart::ChartRegressionCurveType
getValueFromSeries( const Reference
< beans::XPropertySet
>& xSeriesPropertySet
) const SAL_OVERRIDE
;
820 virtual void setValueToSeries( const Reference
< beans::XPropertySet
>& xSeriesPropertySet
, const ::com::sun::star::chart::ChartRegressionCurveType
& aNewValue
) const SAL_OVERRIDE
;
822 explicit WrappedRegressionCurvesProperty( ::boost::shared_ptr
< Chart2ModelContact
> spChart2ModelContact
,
823 tSeriesOrDiagramPropertyType ePropertyType
);
824 virtual ~WrappedRegressionCurvesProperty();
827 WrappedRegressionCurvesProperty::WrappedRegressionCurvesProperty(
828 ::boost::shared_ptr
< Chart2ModelContact
> spChart2ModelContact
,
829 tSeriesOrDiagramPropertyType ePropertyType
)
830 : WrappedStatisticProperty
< ::com::sun::star::chart::ChartRegressionCurveType
>( "RegressionCurves"
831 , lcl_getRegressionDefault(), spChart2ModelContact
, ePropertyType
)
835 WrappedRegressionCurvesProperty::~WrappedRegressionCurvesProperty()
839 ::com::sun::star::chart::ChartRegressionCurveType
WrappedRegressionCurvesProperty::getValueFromSeries( const Reference
< beans::XPropertySet
>& xSeriesPropertySet
) const
841 ::com::sun::star::chart::ChartRegressionCurveType aRet
;
842 m_aDefaultValue
>>= aRet
;
843 uno::Reference
< chart2::XRegressionCurveContainer
> xRegCnt( xSeriesPropertySet
, uno::UNO_QUERY
);
846 aRet
= lcl_getRegressionCurveType(
847 RegressionCurveHelper::getFirstRegressTypeNotMeanValueLine( xRegCnt
) );
851 void WrappedRegressionCurvesProperty::setValueToSeries( const Reference
< beans::XPropertySet
>& xSeriesPropertySet
, const ::com::sun::star::chart::ChartRegressionCurveType
& aNewValue
) const
853 uno::Reference
< chart2::XRegressionCurveContainer
> xRegressionCurveContainer( xSeriesPropertySet
, uno::UNO_QUERY
);
854 uno::Reference
< chart2::XRegressionCurve
> xRegressionCurve( xSeriesPropertySet
, uno::UNO_QUERY
);
856 if( xRegressionCurveContainer
.is() && xRegressionCurve
.is() )
858 SvxChartRegress eNewRegressionType
= lcl_getRegressionType( aNewValue
);
860 RegressionCurveHelper::changeRegressionCurveType(
862 xRegressionCurveContainer
,
864 uno::Reference
< uno::XComponentContext
>());
868 //PROP_CHART_STATISTIC_REGRESSION_PROPERTIES
869 //PROP_CHART_STATISTIC_ERROR_PROPERTIES
870 //PROP_CHART_STATISTIC_MEAN_VALUE_PROPERTIES
871 class WrappedStatisticPropertySetProperty
: public WrappedStatisticProperty
< Reference
< beans::XPropertySet
> >
874 virtual Reference
< beans::XPropertySet
> getValueFromSeries( const Reference
< beans::XPropertySet
>& xSeriesPropertySet
) const SAL_OVERRIDE
;
875 // properties are read-only, so this method should never be called
876 virtual void setValueToSeries( const Reference
< beans::XPropertySet
>& xSeriesPropertySet
, const Reference
< beans::XPropertySet
> & xNewValue
) const SAL_OVERRIDE
;
880 PROPERTY_SET_TYPE_REGRESSION
,
881 PROPERTY_SET_TYPE_ERROR_BAR
,
882 PROPERTY_SET_TYPE_MEAN_VALUE
885 explicit WrappedStatisticPropertySetProperty(
886 PropertySetType ePropertySetType
, ::boost::shared_ptr
< Chart2ModelContact
> spChart2ModelContact
,
887 tSeriesOrDiagramPropertyType ePropertyType
);
888 virtual ~WrappedStatisticPropertySetProperty();
891 PropertySetType m_eType
;
894 WrappedStatisticPropertySetProperty::WrappedStatisticPropertySetProperty(
895 PropertySetType ePropertySetType
896 , ::boost::shared_ptr
< Chart2ModelContact
> spChart2ModelContact
897 , tSeriesOrDiagramPropertyType ePropertyType
)
898 : WrappedStatisticProperty
< Reference
< beans::XPropertySet
> >(
899 (ePropertySetType
== PROPERTY_SET_TYPE_REGRESSION
)
900 ? OUString("DataRegressionProperties")
901 : (ePropertySetType
== PROPERTY_SET_TYPE_ERROR_BAR
)
902 ? OUString("DataErrorProperties")
903 : OUString("DataMeanValueProperties")
904 , uno::Any(), spChart2ModelContact
, ePropertyType
)
905 , m_eType( ePropertySetType
)
908 WrappedStatisticPropertySetProperty::~WrappedStatisticPropertySetProperty()
912 Reference
< beans::XPropertySet
> WrappedStatisticPropertySetProperty::getValueFromSeries( const Reference
< beans::XPropertySet
>& xSeriesPropertySet
) const
914 Reference
< beans::XPropertySet
> xResult
;
915 uno::Reference
< chart2::XRegressionCurveContainer
> xRegCnt( xSeriesPropertySet
, uno::UNO_QUERY
);
919 case PROPERTY_SET_TYPE_REGRESSION
:
921 xResult
.set( RegressionCurveHelper::getFirstCurveNotMeanValueLine( xRegCnt
), uno::UNO_QUERY
);
923 case PROPERTY_SET_TYPE_ERROR_BAR
:
924 if( xSeriesPropertySet
.is())
925 xSeriesPropertySet
->getPropertyValue( CHART_UNONAME_ERRORBAR_Y
) >>= xResult
;
927 case PROPERTY_SET_TYPE_MEAN_VALUE
:
929 xResult
.set( RegressionCurveHelper::getMeanValueLine( xRegCnt
), uno::UNO_QUERY
);
936 void WrappedStatisticPropertySetProperty::setValueToSeries(
937 const Reference
< beans::XPropertySet
>& /* xSeriesPropertySet */
938 , const Reference
< beans::XPropertySet
>& /* xNewValue */ ) const
946 //statistic properties
947 PROP_CHART_STATISTIC_CONST_ERROR_LOW
= FAST_PROPERTY_ID_START_CHART_STATISTIC_PROP
,
948 PROP_CHART_STATISTIC_CONST_ERROR_HIGH
,
949 PROP_CHART_STATISTIC_MEAN_VALUE
,
950 PROP_CHART_STATISTIC_ERROR_CATEGORY
,
951 PROP_CHART_STATISTIC_ERROR_BAR_STYLE
,
952 PROP_CHART_STATISTIC_PERCENT_ERROR
,
953 PROP_CHART_STATISTIC_ERROR_MARGIN
,
954 PROP_CHART_STATISTIC_ERROR_INDICATOR
,
955 PROP_CHART_STATISTIC_ERROR_RANGE_POSITIVE
,
956 PROP_CHART_STATISTIC_ERROR_RANGE_NEGATIVE
,
957 PROP_CHART_STATISTIC_REGRESSION_CURVES
,
958 PROP_CHART_STATISTIC_REGRESSION_PROPERTIES
,
959 PROP_CHART_STATISTIC_ERROR_PROPERTIES
,
960 PROP_CHART_STATISTIC_MEAN_VALUE_PROPERTIES
963 /** @parameter bDataSeriesProperty if true, this property is for a single data
964 series, if false, it is for the whole diagram, i.e. for all
967 void lcl_addWrappedProperties( std::vector
< WrappedProperty
* >& rList
968 , ::boost::shared_ptr
< Chart2ModelContact
> spChart2ModelContact
969 , tSeriesOrDiagramPropertyType ePropertyType
)
971 rList
.push_back( new WrappedConstantErrorLowProperty( spChart2ModelContact
, ePropertyType
) );
972 rList
.push_back( new WrappedConstantErrorHighProperty( spChart2ModelContact
, ePropertyType
) );
973 rList
.push_back( new WrappedMeanValueProperty( spChart2ModelContact
, ePropertyType
) );
974 rList
.push_back( new WrappedErrorCategoryProperty( spChart2ModelContact
, ePropertyType
) );
975 rList
.push_back( new WrappedErrorBarStyleProperty( spChart2ModelContact
, ePropertyType
) );
976 rList
.push_back( new WrappedPercentageErrorProperty( spChart2ModelContact
, ePropertyType
) );
977 rList
.push_back( new WrappedErrorMarginProperty( spChart2ModelContact
, ePropertyType
) );
978 rList
.push_back( new WrappedErrorIndicatorProperty( spChart2ModelContact
, ePropertyType
) );
979 rList
.push_back( new WrappedErrorBarRangePositiveProperty( spChart2ModelContact
, ePropertyType
) );
980 rList
.push_back( new WrappedErrorBarRangeNegativeProperty( spChart2ModelContact
, ePropertyType
) );
981 rList
.push_back( new WrappedRegressionCurvesProperty( spChart2ModelContact
, ePropertyType
) );
982 rList
.push_back( new WrappedStatisticPropertySetProperty(
983 WrappedStatisticPropertySetProperty::PROPERTY_SET_TYPE_REGRESSION
, spChart2ModelContact
, ePropertyType
) );
984 rList
.push_back( new WrappedStatisticPropertySetProperty(
985 WrappedStatisticPropertySetProperty::PROPERTY_SET_TYPE_ERROR_BAR
, spChart2ModelContact
, ePropertyType
) );
986 rList
.push_back( new WrappedStatisticPropertySetProperty(
987 WrappedStatisticPropertySetProperty::PROPERTY_SET_TYPE_MEAN_VALUE
, spChart2ModelContact
, ePropertyType
) );
990 }//anonymous namespace
992 void WrappedStatisticProperties::addProperties( ::std::vector
< Property
> & rOutProperties
)
994 rOutProperties
.push_back(
995 Property( "ConstantErrorLow",
996 PROP_CHART_STATISTIC_CONST_ERROR_LOW
,
997 cppu::UnoType
<double>::get(),
998 beans::PropertyAttribute::BOUND
999 | beans::PropertyAttribute::MAYBEDEFAULT
));
1000 rOutProperties
.push_back(
1001 Property( "ConstantErrorHigh",
1002 PROP_CHART_STATISTIC_CONST_ERROR_HIGH
,
1003 cppu::UnoType
<double>::get(),
1004 beans::PropertyAttribute::BOUND
1005 | beans::PropertyAttribute::MAYBEDEFAULT
));
1006 rOutProperties
.push_back(
1007 Property( "MeanValue",
1008 PROP_CHART_STATISTIC_MEAN_VALUE
,
1009 cppu::UnoType
<bool>::get(),
1010 beans::PropertyAttribute::BOUND
1011 | beans::PropertyAttribute::MAYBEDEFAULT
));
1012 rOutProperties
.push_back(
1013 Property( "ErrorCategory",
1014 PROP_CHART_STATISTIC_ERROR_CATEGORY
,
1015 cppu::UnoType
<com::sun::star::chart::ChartErrorCategory
>::get(),
1016 beans::PropertyAttribute::BOUND
1017 | beans::PropertyAttribute::MAYBEDEFAULT
));
1018 rOutProperties
.push_back(
1019 Property( "ErrorBarStyle",
1020 PROP_CHART_STATISTIC_ERROR_BAR_STYLE
,
1021 cppu::UnoType
<sal_Int32
>::get(),
1022 beans::PropertyAttribute::BOUND
1023 | beans::PropertyAttribute::MAYBEDEFAULT
));
1024 rOutProperties
.push_back(
1025 Property( "PercentageError",
1026 PROP_CHART_STATISTIC_PERCENT_ERROR
,
1027 cppu::UnoType
<double>::get(),
1028 beans::PropertyAttribute::BOUND
1029 | beans::PropertyAttribute::MAYBEDEFAULT
));
1030 rOutProperties
.push_back(
1031 Property( "ErrorMargin",
1032 PROP_CHART_STATISTIC_ERROR_MARGIN
,
1033 cppu::UnoType
<double>::get(),
1034 beans::PropertyAttribute::BOUND
1035 | beans::PropertyAttribute::MAYBEDEFAULT
));
1036 rOutProperties
.push_back(
1037 Property( "ErrorIndicator",
1038 PROP_CHART_STATISTIC_ERROR_INDICATOR
,
1039 cppu::UnoType
<com::sun::star::chart::ChartErrorIndicatorType
>::get(),
1040 beans::PropertyAttribute::BOUND
1041 | beans::PropertyAttribute::MAYBEDEFAULT
));
1042 rOutProperties
.push_back(
1043 Property( "ErrorBarRangePositive",
1044 PROP_CHART_STATISTIC_ERROR_RANGE_POSITIVE
,
1045 cppu::UnoType
<OUString
>::get(),
1046 beans::PropertyAttribute::BOUND
1047 | beans::PropertyAttribute::MAYBEDEFAULT
));
1048 rOutProperties
.push_back(
1049 Property( "ErrorBarRangeNegative",
1050 PROP_CHART_STATISTIC_ERROR_RANGE_NEGATIVE
,
1051 cppu::UnoType
<OUString
>::get(),
1052 beans::PropertyAttribute::BOUND
1053 | beans::PropertyAttribute::MAYBEDEFAULT
));
1054 rOutProperties
.push_back(
1055 Property( "RegressionCurves",
1056 PROP_CHART_STATISTIC_REGRESSION_CURVES
,
1057 cppu::UnoType
<com::sun::star::chart::ChartRegressionCurveType
>::get(),
1058 beans::PropertyAttribute::BOUND
1059 | beans::PropertyAttribute::MAYBEDEFAULT
));
1061 rOutProperties
.push_back(
1062 Property( "DataRegressionProperties",
1063 PROP_CHART_STATISTIC_REGRESSION_PROPERTIES
,
1064 cppu::UnoType
<beans::XPropertySet
>::get(),
1065 beans::PropertyAttribute::BOUND
1066 | beans::PropertyAttribute::READONLY
1067 | beans::PropertyAttribute::MAYBEVOID
));
1068 rOutProperties
.push_back(
1069 Property( "DataErrorProperties",
1070 PROP_CHART_STATISTIC_ERROR_PROPERTIES
,
1071 cppu::UnoType
<beans::XPropertySet
>::get(),
1072 beans::PropertyAttribute::BOUND
1073 | beans::PropertyAttribute::READONLY
1074 | beans::PropertyAttribute::MAYBEVOID
));
1075 rOutProperties
.push_back(
1076 Property( "DataMeanValueProperties",
1077 PROP_CHART_STATISTIC_MEAN_VALUE_PROPERTIES
,
1078 cppu::UnoType
<beans::XPropertySet
>::get(),
1079 beans::PropertyAttribute::BOUND
1080 | beans::PropertyAttribute::READONLY
1081 | beans::PropertyAttribute::MAYBEVOID
));
1084 void WrappedStatisticProperties::addWrappedPropertiesForSeries( std::vector
< WrappedProperty
* >& rList
1085 , ::boost::shared_ptr
< Chart2ModelContact
> spChart2ModelContact
)
1087 lcl_addWrappedProperties( rList
, spChart2ModelContact
, DATA_SERIES
);
1090 void WrappedStatisticProperties::addWrappedPropertiesForDiagram( std::vector
< WrappedProperty
* >& rList
1091 , ::boost::shared_ptr
< Chart2ModelContact
> spChart2ModelContact
)
1093 lcl_addWrappedProperties( rList
, spChart2ModelContact
, DIAGRAM
);
1096 } //namespace wrapper
1099 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */