LCOV - code coverage report
Current view: top level - chart2/source/controller/chartapiwrapper - DataSeriesPointWrapper.cxx (source / functions) Hit Total Coverage
Test: commit 10e77ab3ff6f4314137acd6e2702a6e5c1ce1fae Lines: 277 361 76.7 %
Date: 2014-11-03 Functions: 45 57 78.9 %
Legend: Lines: hit not hit

          Line data    Source code
       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 "DataSeriesPointWrapper.hxx"
      21             : #include "macros.hxx"
      22             : #include "RegressionCurveHelper.hxx"
      23             : #include "Chart2ModelContact.hxx"
      24             : #include "ChartTypeHelper.hxx"
      25             : #include "DiagramHelper.hxx"
      26             : #include "ContainerHelper.hxx"
      27             : #include "ChartModelHelper.hxx"
      28             : #include "LinePropertiesHelper.hxx"
      29             : #include "FillProperties.hxx"
      30             : #include "CharacterProperties.hxx"
      31             : #include "UserDefinedProperties.hxx"
      32             : #include "WrappedCharacterHeightProperty.hxx"
      33             : #include "WrappedProperty.hxx"
      34             : #include "WrappedIgnoreProperty.hxx"
      35             : #include "WrappedStatisticProperties.hxx"
      36             : #include "WrappedSymbolProperties.hxx"
      37             : #include "WrappedDataCaptionProperties.hxx"
      38             : #include "WrappedSeriesAreaOrLineProperty.hxx"
      39             : #include "WrappedScaleTextProperties.hxx"
      40             : #include "WrappedNumberFormatProperty.hxx"
      41             : #include "WrappedTextRotationProperty.hxx"
      42             : #include <unonames.hxx>
      43             : 
      44             : #include <rtl/ustrbuf.hxx>
      45             : #include <rtl/math.hxx>
      46             : 
      47             : #include <algorithm>
      48             : #include <comphelper/InlineContainer.hxx>
      49             : #include <com/sun/star/beans/PropertyAttribute.hpp>
      50             : #include <com/sun/star/chart/ChartAxisAssign.hpp>
      51             : #include <com/sun/star/chart/ChartErrorCategory.hpp>
      52             : #include <com/sun/star/chart/XChartDocument.hpp>
      53             : #include <com/sun/star/drawing/FillStyle.hpp>
      54             : #include <com/sun/star/drawing/LineJoint.hpp>
      55             : #include <com/sun/star/drawing/LineStyle.hpp>
      56             : 
      57             : using namespace ::com::sun::star;
      58             : using namespace ::chart::wrapper;
      59             : 
      60             : using ::com::sun::star::uno::Reference;
      61             : using ::com::sun::star::uno::Sequence;
      62             : using ::com::sun::star::beans::Property;
      63             : using ::com::sun::star::uno::Any;
      64             : using ::osl::MutexGuard;
      65             : 
      66             : namespace
      67             : {
      68          34 : static const OUString lcl_aServiceName( "com.sun.star.comp.chart.DataSeries" );
      69             : 
      70             : enum
      71             : {
      72             :     //data point  properties
      73             :     PROP_SERIES_DATAPOINT_SOLIDTYPE,
      74             :     PROP_SERIES_DATAPOINT_SEGMENT_OFFSET,
      75             :     PROP_SERIES_DATAPOINT_PERCENT_DIAGONAL,
      76             :     PROP_SERIES_DATAPOINT_LABEL_SEPARATOR,
      77             :     PROP_SERIES_NUMBERFORMAT,
      78             :     PROP_SERIES_LINK_NUMBERFORMAT_TO_SOURCE,
      79             :     PROP_SERIES_PERCENTAGE_NUMBERFORMAT,
      80             :     PROP_SERIES_DATAPOINT_LABEL_PLACEMENT,
      81             :     //other series properties
      82             :     PROP_SERIES_ATTACHED_AXIS,
      83             :     PROP_SERIES_DATAPOINT_TEXT_ROTATION,
      84             :     PROP_SERIES_DATAPOINT_LABEL_BORDER_STYLE,
      85             :     PROP_SERIES_DATAPOINT_LABEL_BORDER_WIDTH,
      86             :     PROP_SERIES_DATAPOINT_LABEL_BORDER_COLOR,
      87             :     PROP_SERIES_DATAPOINT_LABEL_BORDER_TRANS
      88             : };
      89             : 
      90          28 : void lcl_AddPropertiesToVector_PointProperties(
      91             :     ::std::vector< Property > & rOutProperties )
      92             : {
      93             :     //service chart::Chart3DBarProperties
      94             :     rOutProperties.push_back(
      95             :         Property( "SolidType",
      96             :                   PROP_SERIES_DATAPOINT_SOLIDTYPE,
      97          28 :                   cppu::UnoType<sal_Int32>::get(),
      98             :                   beans::PropertyAttribute::BOUND
      99          56 :                   | beans::PropertyAttribute::MAYBEDEFAULT ));
     100             : 
     101             :     rOutProperties.push_back(
     102             :         Property( "SegmentOffset",
     103             :                   PROP_SERIES_DATAPOINT_SEGMENT_OFFSET,
     104          28 :                   cppu::UnoType<sal_Int32>::get(),
     105             :                   beans::PropertyAttribute::BOUND
     106          56 :                   | beans::PropertyAttribute::MAYBEDEFAULT ));
     107             : 
     108             :     rOutProperties.push_back(
     109             :         Property( "D3DPercentDiagonal",
     110             :                   PROP_SERIES_DATAPOINT_PERCENT_DIAGONAL,
     111          28 :                   cppu::UnoType<sal_Int16>::get(),
     112             :                   beans::PropertyAttribute::BOUND
     113          56 :                   | beans::PropertyAttribute::MAYBEVOID ));
     114             : 
     115             :     rOutProperties.push_back(
     116             :         Property( "LabelSeparator",
     117             :                   PROP_SERIES_DATAPOINT_LABEL_SEPARATOR,
     118          28 :                   cppu::UnoType<OUString>::get(),
     119             :                   beans::PropertyAttribute::BOUND
     120          56 :                   | beans::PropertyAttribute::MAYBEDEFAULT ));
     121             : 
     122             :     rOutProperties.push_back(
     123             :         Property( CHART_UNONAME_NUMFMT,
     124             :                   PROP_SERIES_NUMBERFORMAT,
     125          28 :                   cppu::UnoType<sal_Int32>::get(),
     126             :                   beans::PropertyAttribute::BOUND
     127          56 :                   | beans::PropertyAttribute::MAYBEVOID ));
     128             : 
     129             :     rOutProperties.push_back(
     130             :         Property( "PercentageNumberFormat",
     131             :                   PROP_SERIES_PERCENTAGE_NUMBERFORMAT,
     132          28 :                   cppu::UnoType<sal_Int32>::get(),
     133             :                   beans::PropertyAttribute::BOUND
     134          56 :                   | beans::PropertyAttribute::MAYBEVOID ));
     135             : 
     136             :     rOutProperties.push_back(
     137             :         Property( "LabelPlacement",
     138             :                   PROP_SERIES_DATAPOINT_LABEL_PLACEMENT,
     139          28 :                   cppu::UnoType<sal_Int32>::get(),
     140             :                   beans::PropertyAttribute::BOUND
     141          56 :                   | beans::PropertyAttribute::MAYBEVOID ));
     142             : 
     143             :     rOutProperties.push_back(
     144             :         Property( "TextRotation",
     145             :                   PROP_SERIES_DATAPOINT_TEXT_ROTATION,
     146          28 :                   cppu::UnoType<sal_Int32>::get(),
     147             :                   beans::PropertyAttribute::BOUND
     148          56 :                   | beans::PropertyAttribute::MAYBEDEFAULT ));
     149             : 
     150             :     rOutProperties.push_back(
     151             :         Property( CHART_UNONAME_LABEL_BORDER_STYLE,
     152             :                   PROP_SERIES_DATAPOINT_LABEL_BORDER_STYLE,
     153          28 :                   cppu::UnoType<drawing::LineStyle>::get(),
     154             :                   beans::PropertyAttribute::BOUND
     155          56 :                   | beans::PropertyAttribute::MAYBEDEFAULT ));
     156             : 
     157             :     rOutProperties.push_back(
     158             :         Property( CHART_UNONAME_LABEL_BORDER_WIDTH,
     159             :                   PROP_SERIES_DATAPOINT_LABEL_BORDER_WIDTH,
     160          28 :                   cppu::UnoType<sal_Int32>::get(),
     161             :                   beans::PropertyAttribute::BOUND
     162          56 :                   | beans::PropertyAttribute::MAYBEDEFAULT ));
     163             : 
     164             :     rOutProperties.push_back(
     165             :         Property( CHART_UNONAME_LABEL_BORDER_COLOR,
     166             :                   PROP_SERIES_DATAPOINT_LABEL_BORDER_COLOR,
     167          28 :                   cppu::UnoType<sal_Int32>::get(),
     168             :                   beans::PropertyAttribute::BOUND
     169             :                   | beans::PropertyAttribute::MAYBEVOID         // "maybe auto"
     170          56 :                   | beans::PropertyAttribute::MAYBEDEFAULT ));
     171             : 
     172             :     rOutProperties.push_back(
     173             :         Property( CHART_UNONAME_LABEL_BORDER_TRANS,
     174             :                   PROP_SERIES_DATAPOINT_LABEL_BORDER_TRANS,
     175          28 :                   cppu::UnoType<sal_Int16>::get(),
     176             :                   beans::PropertyAttribute::BOUND
     177          56 :                   | beans::PropertyAttribute::MAYBEDEFAULT ));
     178          28 : }
     179             : 
     180          20 : void lcl_AddPropertiesToVector_SeriesOnly(
     181             :     ::std::vector< Property > & rOutProperties )
     182             : {
     183             :     rOutProperties.push_back(
     184             :         Property( "Axis",
     185             :                   PROP_SERIES_ATTACHED_AXIS,
     186          20 :                   cppu::UnoType<sal_Int32>::get(),
     187             :                   beans::PropertyAttribute::BOUND
     188          40 :                   | beans::PropertyAttribute::MAYBEDEFAULT ));
     189             : 
     190             :     rOutProperties.push_back(
     191             :         Property( CHART_UNONAME_LINK_TO_SRC_NUMFMT,
     192             :                   PROP_SERIES_LINK_NUMBERFORMAT_TO_SOURCE,
     193          20 :                   ::getBooleanCppuType(),
     194             :                   beans::PropertyAttribute::BOUND
     195          40 :                   | beans::PropertyAttribute::MAYBEDEFAULT ));
     196          20 : }
     197             : 
     198          28 : uno::Sequence< Property > lcl_GetPropertySequence( DataSeriesPointWrapper::eType _eType )
     199             : {
     200          28 :     ::std::vector< ::com::sun::star::beans::Property > aProperties;
     201             : 
     202          28 :     lcl_AddPropertiesToVector_PointProperties( aProperties );
     203          28 :     if( _eType == DataSeriesPointWrapper::DATA_SERIES )
     204             :     {
     205          20 :         lcl_AddPropertiesToVector_SeriesOnly( aProperties );
     206          20 :         WrappedStatisticProperties::addProperties( aProperties );
     207             :     }
     208          28 :     WrappedSymbolProperties::addProperties( aProperties ); //for series and  points
     209          28 :     WrappedDataCaptionProperties::addProperties( aProperties ); //for series and  points
     210             : 
     211          28 :     ::chart::FillProperties::AddPropertiesToVector( aProperties );
     212          28 :     ::chart::LinePropertiesHelper::AddPropertiesToVector( aProperties );
     213          28 :     ::chart::CharacterProperties::AddPropertiesToVector( aProperties );
     214          28 :     ::chart::UserDefinedProperties::AddPropertiesToVector( aProperties );
     215          28 :     ::chart::wrapper::WrappedScaleTextProperties::addProperties( aProperties );
     216             : 
     217          28 :     ::std::sort( aProperties.begin(), aProperties.end(), ::chart::PropertyNameLess() );
     218             : 
     219          28 :     return ::chart::ContainerHelper::ContainerToSequence( aProperties );
     220             : }
     221             : 
     222             : struct StaticSeriesWrapperPropertyArray_Initializer
     223             : {
     224          20 :     Sequence< Property >* operator()()
     225             :     {
     226          20 :         static Sequence< Property > aPropSeq( lcl_GetPropertySequence( DataSeriesPointWrapper::DATA_SERIES ) );
     227          20 :         return &aPropSeq;
     228             :     }
     229             : };
     230             : 
     231             : struct StaticSeriesWrapperPropertyArray : public rtl::StaticAggregate< Sequence< Property >, StaticSeriesWrapperPropertyArray_Initializer >
     232             : {
     233             : };
     234             : 
     235             : struct StaticPointWrapperPropertyArray_Initializer
     236             : {
     237           8 :     Sequence< Property >* operator()()
     238             :     {
     239           8 :         static Sequence< Property > aPropSeq( lcl_GetPropertySequence( DataSeriesPointWrapper::DATA_POINT ) );
     240           8 :         return &aPropSeq;
     241             :     }
     242             : };
     243             : 
     244             : struct StaticPointWrapperPropertyArray : public rtl::StaticAggregate< Sequence< Property >, StaticPointWrapperPropertyArray_Initializer >
     245             : {
     246             : };
     247             : 
     248             : //PROP_SERIES_ATTACHED_AXIS
     249             : class WrappedAttachedAxisProperty : public ::chart::WrappedProperty
     250             : {
     251             : public:
     252             :     WrappedAttachedAxisProperty( ::boost::shared_ptr< Chart2ModelContact > spChart2ModelContact );
     253             :     virtual ~WrappedAttachedAxisProperty();
     254             : 
     255             :     virtual void setPropertyValue( const Any& rOuterValue, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& xInnerPropertySet ) const
     256             :                         throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException) SAL_OVERRIDE;
     257             : 
     258             :     virtual Any getPropertyValue( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& xInnerPropertySet ) const
     259             :                         throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException) SAL_OVERRIDE;
     260             : 
     261             :     virtual Any getPropertyDefault( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyState >& xInnerPropertyState ) const
     262             :                         throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException) SAL_OVERRIDE;
     263             : 
     264             : protected:
     265             :     ::boost::shared_ptr< Chart2ModelContact >   m_spChart2ModelContact;
     266             : };
     267             : 
     268        3176 : WrappedAttachedAxisProperty::WrappedAttachedAxisProperty(
     269             :                 ::boost::shared_ptr< Chart2ModelContact > spChart2ModelContact )
     270             :                 : WrappedProperty("Axis",OUString())
     271        3176 :             , m_spChart2ModelContact( spChart2ModelContact )
     272             : {
     273        3176 : }
     274             : 
     275        6352 : WrappedAttachedAxisProperty::~WrappedAttachedAxisProperty()
     276             : {
     277        6352 : }
     278             : 
     279           0 : Any WrappedAttachedAxisProperty::getPropertyDefault( const Reference< beans::XPropertyState >& /*xInnerPropertyState*/ ) const
     280             :                         throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
     281             : {
     282           0 :     Any aRet;
     283           0 :     aRet <<= ::com::sun::star::chart::ChartAxisAssign::PRIMARY_Y;
     284           0 :     return aRet;
     285             : }
     286             : 
     287        2654 : Any WrappedAttachedAxisProperty::getPropertyValue( const Reference< beans::XPropertySet >& xInnerPropertySet ) const
     288             :                         throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
     289             : {
     290        2654 :     Any aRet;
     291             : 
     292        5308 :     uno::Reference< chart2::XDataSeries > xDataSeries( xInnerPropertySet, uno::UNO_QUERY );
     293        2654 :     bool bAttachedToMainAxis = ::chart::DiagramHelper::isSeriesAttachedToMainAxis( xDataSeries );
     294        2654 :     if( bAttachedToMainAxis )
     295        2528 :         aRet <<= ::com::sun::star::chart::ChartAxisAssign::PRIMARY_Y;
     296             :     else
     297         126 :         aRet <<= ::com::sun::star::chart::ChartAxisAssign::SECONDARY_Y;
     298        5308 :     return aRet;
     299             : }
     300             : 
     301          36 : void WrappedAttachedAxisProperty::setPropertyValue( const Any& rOuterValue, const Reference< beans::XPropertySet >& xInnerPropertySet ) const
     302             :                 throw (beans::UnknownPropertyException, beans::PropertyVetoException, lang::IllegalArgumentException, lang::WrappedTargetException, uno::RuntimeException)
     303             : {
     304          36 :     uno::Reference< chart2::XDataSeries > xDataSeries( xInnerPropertySet, uno::UNO_QUERY );
     305             : 
     306          36 :     sal_Int32 nChartAxisAssign = ::com::sun::star::chart::ChartAxisAssign::PRIMARY_Y;
     307          36 :     if( ! (rOuterValue >>= nChartAxisAssign) )
     308           0 :         throw lang::IllegalArgumentException("Property Axis requires value of type sal_Int32", 0, 0 );
     309             : 
     310          36 :     bool bNewAttachedToMainAxis = nChartAxisAssign == ::com::sun::star::chart::ChartAxisAssign::PRIMARY_Y;
     311          36 :     bool bOldAttachedToMainAxis = ::chart::DiagramHelper::isSeriesAttachedToMainAxis( xDataSeries );
     312             : 
     313          36 :     if( bNewAttachedToMainAxis != bOldAttachedToMainAxis)
     314             :     {
     315          36 :         Reference< chart2::XDiagram > xDiagram( m_spChart2ModelContact->getChart2Diagram() );
     316          36 :         if( xDiagram.is() )
     317          36 :             ::chart::DiagramHelper::attachSeriesToAxis( bNewAttachedToMainAxis, xDataSeries, xDiagram, m_spChart2ModelContact->m_xContext, false );
     318          36 :     }
     319          36 : }
     320             : 
     321             : class WrappedSegmentOffsetProperty : public ::chart::WrappedProperty
     322             : {
     323             : public:
     324             :     WrappedSegmentOffsetProperty();
     325             :     virtual ~WrappedSegmentOffsetProperty();
     326             : 
     327             : protected:
     328             :     virtual Any convertInnerToOuterValue( const Any& rInnerValue ) const SAL_OVERRIDE;
     329             :     virtual Any convertOuterToInnerValue( const Any& rOuterValue ) const SAL_OVERRIDE;
     330             : };
     331             : 
     332        5266 : WrappedSegmentOffsetProperty::WrappedSegmentOffsetProperty() :
     333        5266 :         WrappedProperty("SegmentOffset","Offset")
     334        5266 : {}
     335             : 
     336       10532 : WrappedSegmentOffsetProperty::~WrappedSegmentOffsetProperty()
     337       10532 : {}
     338             : 
     339        3748 : Any WrappedSegmentOffsetProperty::convertInnerToOuterValue( const Any& rInnerValue ) const
     340             : {
     341             :     // convert new double offset to former integer segment-offset
     342        3748 :     double fOffset = 0;
     343        3748 :     Any aResult( rInnerValue );
     344             : 
     345        3748 :     if( rInnerValue >>= fOffset )
     346        3748 :         aResult <<= static_cast< sal_Int32 >( ::rtl::math::round( fOffset * 100.0 ));
     347             : 
     348        3748 :     return aResult;
     349             : }
     350             : 
     351          12 : Any WrappedSegmentOffsetProperty::convertOuterToInnerValue( const Any& rOuterValue ) const
     352             : {
     353             :     // convert former integer segment-offset to new double offset
     354          12 :     sal_Int32 nOffset = 0;
     355          12 :     Any aResult( rOuterValue );
     356             : 
     357          12 :     if( rOuterValue >>= nOffset )
     358          12 :         aResult <<= (static_cast< double >( nOffset ) / 100.0);
     359             : 
     360          12 :     return aResult;
     361             : }
     362             : 
     363             : class WrappedLineColorProperty : public WrappedSeriesAreaOrLineProperty
     364             : {
     365             : public:
     366             :     WrappedLineColorProperty( DataSeriesPointWrapper* pDataSeriesPointWrapper );
     367             :     virtual ~WrappedLineColorProperty();
     368             : 
     369             :     virtual void setPropertyValue( const Any& rOuterValue, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& xInnerPropertySet ) const
     370             :                         throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException) SAL_OVERRIDE;
     371             : 
     372             :     virtual void setPropertyToDefault( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyState >& xInnerPropertyState ) const
     373             :                         throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException) SAL_OVERRIDE;
     374             : 
     375             :     virtual ::com::sun::star::uno::Any getPropertyDefault( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyState >& xInnerPropertyState ) const
     376             :                         throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException) SAL_OVERRIDE;
     377             : 
     378             : protected:
     379             :     DataSeriesPointWrapper* m_pDataSeriesPointWrapper;
     380             :     mutable Any             m_aDefaultValue;
     381             :     mutable Any             m_aOuterValue;
     382             : };
     383             : 
     384        5266 : WrappedLineColorProperty::WrappedLineColorProperty(
     385             :                 DataSeriesPointWrapper* pDataSeriesPointWrapper )
     386             :                 : WrappedSeriesAreaOrLineProperty("LineColor","BorderColor","Color", pDataSeriesPointWrapper )
     387             :                 , m_pDataSeriesPointWrapper( pDataSeriesPointWrapper )
     388             :                 , m_aDefaultValue(uno::makeAny(sal_Int32( 0x0099ccff )))  // blue 8
     389        5266 :                 , m_aOuterValue(m_aDefaultValue)
     390             : {
     391        5266 : }
     392             : 
     393       10532 : WrappedLineColorProperty::~WrappedLineColorProperty()
     394             : {
     395       10532 : }
     396             : 
     397         208 : void WrappedLineColorProperty::setPropertyValue( const Any& rOuterValue, const Reference< beans::XPropertySet >& xInnerPropertySet ) const
     398             :                 throw (beans::UnknownPropertyException, beans::PropertyVetoException, lang::IllegalArgumentException, lang::WrappedTargetException, uno::RuntimeException)
     399             : {
     400         208 :     if( m_pDataSeriesPointWrapper && m_pDataSeriesPointWrapper->isLinesForbidden() )
     401           0 :         m_aOuterValue = rOuterValue;
     402             :     else
     403         208 :         WrappedSeriesAreaOrLineProperty::setPropertyValue( rOuterValue, xInnerPropertySet );
     404         208 : }
     405             : 
     406           0 : void WrappedLineColorProperty::setPropertyToDefault( const Reference< beans::XPropertyState >& xInnerPropertyState ) const
     407             :                         throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException)
     408             : {
     409           0 :     if( m_pDataSeriesPointWrapper && m_pDataSeriesPointWrapper->isLinesForbidden() )
     410           0 :         m_aOuterValue = m_aDefaultValue;
     411             :     else
     412           0 :         WrappedSeriesAreaOrLineProperty::setPropertyToDefault( xInnerPropertyState );
     413           0 : }
     414             : 
     415           0 : Any WrappedLineColorProperty::getPropertyDefault( const Reference< beans::XPropertyState >& xInnerPropertyState ) const
     416             :                         throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
     417             : {
     418           0 :     if( m_pDataSeriesPointWrapper && !m_pDataSeriesPointWrapper->isSupportingAreaProperties() )
     419           0 :         return m_aDefaultValue;
     420             :     else
     421           0 :         return WrappedSeriesAreaOrLineProperty::getPropertyDefault( xInnerPropertyState );
     422             : }
     423             : 
     424             : class WrappedLineStyleProperty : public WrappedSeriesAreaOrLineProperty
     425             : {
     426             : public:
     427             :     WrappedLineStyleProperty( DataSeriesPointWrapper* pDataSeriesPointWrapper );
     428             :     virtual ~WrappedLineStyleProperty();
     429             : 
     430             :     virtual void setPropertyValue( const Any& rOuterValue, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& xInnerPropertySet ) const
     431             :                         throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException) SAL_OVERRIDE;
     432             : 
     433             :     virtual void setPropertyToDefault( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyState >& xInnerPropertyState ) const
     434             :                         throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException) SAL_OVERRIDE;
     435             : 
     436             : protected:
     437             :     DataSeriesPointWrapper* m_pDataSeriesPointWrapper;
     438             :     mutable Any             m_aDefaultValue;
     439             :     mutable Any             m_aOuterValue;
     440             : };
     441             : 
     442        5266 : WrappedLineStyleProperty::WrappedLineStyleProperty(
     443             :                 DataSeriesPointWrapper* pDataSeriesPointWrapper )
     444             :                 : WrappedSeriesAreaOrLineProperty("LineStyle","BorderStyle", "LineStyle", pDataSeriesPointWrapper )
     445             :                 , m_pDataSeriesPointWrapper( pDataSeriesPointWrapper )
     446             :                 , m_aDefaultValue(uno::makeAny(drawing::LineStyle_SOLID))
     447        5266 :                 , m_aOuterValue(m_aDefaultValue)
     448             : {
     449        5266 : }
     450             : 
     451       10532 : WrappedLineStyleProperty::~WrappedLineStyleProperty()
     452             : {
     453       10532 : }
     454             : 
     455         346 : void WrappedLineStyleProperty::setPropertyValue( const Any& rOuterValue, const Reference< beans::XPropertySet >& xInnerPropertySet ) const
     456             :                 throw (beans::UnknownPropertyException, beans::PropertyVetoException, lang::IllegalArgumentException, lang::WrappedTargetException, uno::RuntimeException)
     457             : {
     458         346 :     Any aNewValue(rOuterValue);
     459         346 :     if( m_pDataSeriesPointWrapper && m_pDataSeriesPointWrapper->isLinesForbidden() )
     460             :     {
     461           0 :         m_aOuterValue = rOuterValue;
     462           0 :         aNewValue = uno::makeAny(drawing::LineStyle_NONE);
     463             :     }
     464         346 :     WrappedSeriesAreaOrLineProperty::setPropertyValue( aNewValue, xInnerPropertySet );
     465         346 : }
     466             : 
     467           0 : void WrappedLineStyleProperty::setPropertyToDefault( const Reference< beans::XPropertyState >& xInnerPropertyState ) const
     468             :                         throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException)
     469             : {
     470           0 :     if( m_pDataSeriesPointWrapper && m_pDataSeriesPointWrapper->isLinesForbidden() )
     471           0 :         m_aOuterValue = m_aDefaultValue;
     472             :     else
     473           0 :         WrappedSeriesAreaOrLineProperty::setPropertyToDefault( xInnerPropertyState );
     474           0 : }
     475             : 
     476             : } // anonymous namespace
     477             : 
     478             : namespace chart
     479             : {
     480             : namespace wrapper
     481             : {
     482             : 
     483        5262 : DataSeriesPointWrapper::DataSeriesPointWrapper(
     484             :             ::boost::shared_ptr< Chart2ModelContact > spChart2ModelContact )
     485             :         : m_spChart2ModelContact( spChart2ModelContact )
     486             :         , m_aEventListenerContainer( m_aMutex )
     487             :         , m_eType( DATA_SERIES )
     488             :         , m_nSeriesIndexInNewAPI( -1 )
     489             :         , m_nPointIndex( -1 )
     490             :         , m_bLinesAllowed(true)
     491        5262 :         , m_xDataSeries(0)
     492             : {
     493             :     //need initialize call afterwards
     494        5262 : }
     495             : 
     496        5262 : void SAL_CALL DataSeriesPointWrapper::initialize( const uno::Sequence< uno::Any >& aArguments )
     497             :                 throw ( uno::Exception, uno::RuntimeException, std::exception)
     498             : {
     499             :     OSL_PRECOND(aArguments.getLength() >= 1,"need at least 1 argument to initialize the DataSeriesPointWrapper: series reference + optional datapoint index");
     500             : 
     501        5262 :     m_nSeriesIndexInNewAPI = -1;//ignored in this case
     502        5262 :     m_nPointIndex = -1;
     503        5262 :     if( aArguments.getLength() >= 1 )
     504             :     {
     505        5262 :         aArguments[0] >>= m_xDataSeries;
     506        5262 :         if( aArguments.getLength() >= 2 )
     507        2088 :             aArguments[1] >>= m_nPointIndex;
     508             :     }
     509             : 
     510        5262 :     if( !m_xDataSeries.is() )
     511             :         throw uno::Exception(
     512           0 :             "DataSeries index invalid", static_cast< ::cppu::OWeakObject * >( this ));
     513             : 
     514             :     //todo: check upper border of point index
     515             : 
     516        5262 :     if( m_nPointIndex >= 0 )
     517        2088 :         m_eType = DATA_POINT;
     518             :     else
     519        3174 :         m_eType = DATA_SERIES;
     520        5262 : }
     521             : 
     522          86 : DataSeriesPointWrapper::DataSeriesPointWrapper( eType _eType,
     523             :                                                 sal_Int32 nSeriesIndexInNewAPI ,
     524             :                                                 sal_Int32 nPointIndex, //ignored for series
     525             :                                                 ::boost::shared_ptr< Chart2ModelContact > spChart2ModelContact )
     526             :     : m_spChart2ModelContact( spChart2ModelContact )
     527             :     , m_aEventListenerContainer( m_aMutex )
     528             :     , m_eType( _eType )
     529             :     , m_nSeriesIndexInNewAPI( nSeriesIndexInNewAPI )
     530             :     , m_nPointIndex( (_eType == DATA_POINT) ? nPointIndex : -1 )
     531             :     , m_bLinesAllowed( false )
     532          86 :     , m_xDataSeries(0)
     533             : {
     534          86 : }
     535             : 
     536       10696 : DataSeriesPointWrapper::~DataSeriesPointWrapper()
     537             : {
     538       10696 : }
     539             : 
     540             : // ____ XComponent ____
     541           0 : void SAL_CALL DataSeriesPointWrapper::dispose()
     542             :     throw (uno::RuntimeException, std::exception)
     543             : {
     544           0 :     uno::Reference< uno::XInterface > xSource( static_cast< ::cppu::OWeakObject* >( this ) );
     545           0 :     m_aEventListenerContainer.disposeAndClear( lang::EventObject( xSource ) );
     546             : 
     547           0 :     m_xDataSeries.clear();
     548           0 :     clearWrappedPropertySet();
     549           0 : }
     550             : 
     551           0 : void SAL_CALL DataSeriesPointWrapper::addEventListener(
     552             :     const uno::Reference< lang::XEventListener >& xListener )
     553             :     throw (uno::RuntimeException, std::exception)
     554             : {
     555           0 :     m_aEventListenerContainer.addInterface( xListener );
     556           0 : }
     557             : 
     558           0 : void SAL_CALL DataSeriesPointWrapper::removeEventListener(
     559             :     const uno::Reference< lang::XEventListener >& aListener )
     560             :     throw (uno::RuntimeException, std::exception)
     561             : {
     562           0 :     m_aEventListenerContainer.removeInterface( aListener );
     563           0 : }
     564             : 
     565             : // ____ XEventListener ____
     566           0 : void SAL_CALL DataSeriesPointWrapper::disposing( const lang::EventObject& /*Source*/ )
     567             :     throw (uno::RuntimeException, std::exception)
     568             : {
     569           0 : }
     570             : 
     571       35296 : bool DataSeriesPointWrapper::isSupportingAreaProperties()
     572             : {
     573       35296 :     Reference< chart2::XDataSeries > xSeries( this->getDataSeries() );
     574       70592 :     Reference< chart2::XDiagram > xDiagram( m_spChart2ModelContact->getChart2Diagram() );
     575       70592 :     Reference< chart2::XChartType > xChartType( DiagramHelper::getChartTypeOfSeries( xDiagram, xSeries ) );
     576       35296 :     sal_Int32 nDimensionCount = DiagramHelper::getDimension( xDiagram );
     577             : 
     578       70592 :     return ChartTypeHelper::isSupportingAreaProperties( xChartType, nDimensionCount );
     579             : }
     580             : 
     581      695320 : Reference< chart2::XDataSeries > DataSeriesPointWrapper::getDataSeries()
     582             : {
     583      695320 :     Reference< chart2::XDataSeries > xSeries( m_xDataSeries );
     584      695320 :     if( !xSeries.is() )
     585             :     {
     586        1658 :         Reference< chart2::XDiagram > xDiagram( m_spChart2ModelContact->getChart2Diagram() );
     587             :         ::std::vector< uno::Reference< chart2::XDataSeries > > aSeriesList(
     588        3316 :             ::chart::DiagramHelper::getDataSeriesFromDiagram( xDiagram ) );
     589             : 
     590        1658 :         if( m_nSeriesIndexInNewAPI >= 0 && m_nSeriesIndexInNewAPI < static_cast<sal_Int32>(aSeriesList.size()) )
     591        3316 :             xSeries = aSeriesList[m_nSeriesIndexInNewAPI];
     592             :     }
     593             : 
     594      695320 :     return xSeries;
     595             : }
     596             : 
     597      188368 : Reference< beans::XPropertySet > DataSeriesPointWrapper::getDataPointProperties()
     598             : {
     599      188368 :     Reference< beans::XPropertySet > xPointProp;
     600             : 
     601      376736 :     Reference< chart2::XDataSeries > xSeries( this->getDataSeries() );
     602             : 
     603             :     // may throw an IllegalArgumentException
     604      188368 :     if( xSeries.is() )
     605      188368 :         xPointProp = xSeries->getDataPointByIndex( m_nPointIndex );
     606             : 
     607      376736 :     return xPointProp;
     608             : }
     609             : 
     610             : //ReferenceSizePropertyProvider
     611        1610 : void DataSeriesPointWrapper::updateReferenceSize()
     612             : {
     613        1610 :     Reference< beans::XPropertySet > xProp( this->getInnerPropertySet(), uno::UNO_QUERY );
     614        1610 :     if( xProp.is() )
     615             :     {
     616        1610 :         if( xProp->getPropertyValue("ReferencePageSize").hasValue() )
     617           0 :             xProp->setPropertyValue("ReferencePageSize", uno::makeAny(
     618           0 :                 m_spChart2ModelContact->GetPageSize() ));
     619        1610 :     }
     620        1610 : }
     621       19042 : Any DataSeriesPointWrapper::getReferenceSize()
     622             : {
     623       19042 :     Any aRet;
     624       38084 :     Reference< beans::XPropertySet > xProp( this->getInnerPropertySet(), uno::UNO_QUERY );
     625       19042 :     if( xProp.is() )
     626       19042 :         aRet = xProp->getPropertyValue("ReferencePageSize");
     627       38084 :     return aRet;
     628             : }
     629           0 : awt::Size DataSeriesPointWrapper::getCurrentSizeForReference()
     630             : {
     631           0 :     return m_spChart2ModelContact->GetPageSize();
     632             : }
     633             : 
     634             : // WrappedPropertySet
     635             : 
     636             : //XPropertyState
     637      403556 : beans::PropertyState SAL_CALL DataSeriesPointWrapper::getPropertyState( const OUString& rPropertyName )
     638             :                                     throw (beans::UnknownPropertyException, uno::RuntimeException, std::exception)
     639             : {
     640      403556 :     beans::PropertyState aState( beans::PropertyState_DIRECT_VALUE );
     641             : 
     642      403556 :     if( m_eType == DATA_SERIES )
     643      239396 :         aState = WrappedPropertySet::getPropertyState( rPropertyName );
     644             :     else
     645             :     {
     646      164160 :         if( rPropertyName == "FillColor")
     647             :         {
     648        1824 :             Reference< beans::XPropertySet > xSeriesProp( getDataSeries(), uno::UNO_QUERY );
     649        1824 :             bool bVaryColorsByPoint = false;
     650        5472 :             if( xSeriesProp.is() && (xSeriesProp->getPropertyValue("VaryColorsByPoint") >>= bVaryColorsByPoint)
     651        5472 :                 && bVaryColorsByPoint )
     652        1080 :                 return beans::PropertyState_DIRECT_VALUE;
     653             :         }
     654      324672 :         else if( rPropertyName == "Lines"
     655      160512 :             ||  rPropertyName == "SymbolType"
     656      321024 :             ||  rPropertyName == "SymbolSize" )
     657        5472 :             return WrappedPropertySet::getPropertyState( rPropertyName );
     658             : 
     659      157608 :         uno::Any aDefault( getPropertyDefault( rPropertyName ) );
     660      315216 :         uno::Any aValue( getPropertyValue( rPropertyName ) );
     661      157608 :         if( aDefault==aValue )
     662      311568 :             aState = beans::PropertyState_DEFAULT_VALUE;
     663             :     }
     664      397004 :     return aState;
     665             : }
     666             : 
     667           0 : void SAL_CALL DataSeriesPointWrapper::setPropertyToDefault( const OUString& rPropertyName )
     668             :                                     throw (beans::UnknownPropertyException, uno::RuntimeException, std::exception)
     669             : {
     670           0 :     if( m_eType == DATA_SERIES )
     671           0 :         WrappedPropertySet::setPropertyToDefault( rPropertyName );
     672             :     else
     673             :     {
     674             :         //for data points the default is given by the series
     675           0 :         setPropertyValue( rPropertyName, getPropertyDefault( rPropertyName ) );
     676             :     }
     677           0 : }
     678      157608 : Any SAL_CALL DataSeriesPointWrapper::getPropertyDefault( const OUString& rPropertyName )
     679             :                                     throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException, std::exception)
     680             : {
     681      157608 :     Any aRet;
     682             :     try
     683             :     {
     684      157608 :         sal_Int32 nHandle = getInfoHelper().getHandleByName( rPropertyName );
     685      157608 :         if( nHandle > 0 )
     686             :         {
     687             :             //always take the series current value as default for points
     688      155784 :             Reference< beans::XPropertySet > xInnerPropertySet( getDataSeries(), uno::UNO_QUERY );
     689      155784 :             if( xInnerPropertySet.is() )
     690             :             {
     691      155784 :                 const WrappedProperty* pWrappedProperty = getWrappedProperty( rPropertyName );
     692      155784 :                 if( pWrappedProperty )
     693       59112 :                     aRet = pWrappedProperty->getPropertyValue(xInnerPropertySet);
     694             :                 else
     695       96672 :                     aRet = xInnerPropertySet->getPropertyValue( rPropertyName );
     696      155784 :             }
     697             :         }
     698             :     }
     699           0 :     catch( const beans::UnknownPropertyException& )
     700             :     {
     701           0 :         aRet = WrappedPropertySet::getPropertyDefault( rPropertyName );
     702             :     }
     703      157608 :     return aRet;
     704             : }
     705             : 
     706      499352 : Reference< beans::XPropertySet > DataSeriesPointWrapper::getInnerPropertySet()
     707             : {
     708      499352 :     if( m_eType == DATA_SERIES )
     709      312136 :         return Reference< beans::XPropertySet >( getDataSeries(), uno::UNO_QUERY );
     710      187216 :     return getDataPointProperties();
     711             : }
     712             : 
     713        5266 : const Sequence< beans::Property >& DataSeriesPointWrapper::getPropertySequence()
     714             : {
     715        5266 :     if( m_eType == DATA_SERIES )
     716        3176 :         return *StaticSeriesWrapperPropertyArray::get();
     717             :     else
     718        2090 :         return *StaticPointWrapperPropertyArray::get();
     719             : }
     720             : 
     721        5266 : const std::vector< WrappedProperty* > DataSeriesPointWrapper::createWrappedProperties()
     722             : {
     723        5266 :     ::std::vector< ::chart::WrappedProperty* > aWrappedProperties;
     724             : 
     725        5266 :     WrappedCharacterHeightProperty::addWrappedProperties( aWrappedProperties, this );
     726             : 
     727        5266 :     if( m_eType == DATA_SERIES )
     728             :     {
     729        3176 :         WrappedStatisticProperties::addWrappedPropertiesForSeries( aWrappedProperties, m_spChart2ModelContact );
     730        3176 :         aWrappedProperties.push_back( new WrappedAttachedAxisProperty( m_spChart2ModelContact ) );
     731             : 
     732        3176 :         aWrappedProperties.push_back( new WrappedNumberFormatProperty(m_spChart2ModelContact) );
     733        3176 :         aWrappedProperties.push_back( new WrappedLinkNumberFormatProperty(m_spChart2ModelContact) );
     734             :     }
     735             : 
     736        5266 :     WrappedSymbolProperties::addWrappedPropertiesForSeries( aWrappedProperties, m_spChart2ModelContact );
     737        5266 :     WrappedDataCaptionProperties::addWrappedPropertiesForSeries( aWrappedProperties, m_spChart2ModelContact );
     738        5266 :     WrappedScaleTextProperties::addWrappedProperties( aWrappedProperties, m_spChart2ModelContact );
     739             : 
     740             :     //add unnamed line properties (different inner names here)
     741             : 
     742        5266 :     aWrappedProperties.push_back( new WrappedProperty("FillColor","Color") );
     743        5266 :     aWrappedProperties.push_back( new WrappedLineStyleProperty( this ) );
     744        5266 :     aWrappedProperties.push_back( new WrappedLineColorProperty( this ) );
     745        5266 :     aWrappedProperties.push_back( new WrappedSeriesAreaOrLineProperty("LineDashName","BorderDashName","LineDashName", this ) );
     746        5266 :     aWrappedProperties.push_back( new WrappedSeriesAreaOrLineProperty("LineTransparence","BorderTransparency","Transparency", this ) );
     747        5266 :     aWrappedProperties.push_back( new WrappedSeriesAreaOrLineProperty("LineWidth","BorderWidth","LineWidth", this ) );
     748        5266 :     aWrappedProperties.push_back( new WrappedProperty("FillStyle","FillStyle" ) );
     749        5266 :     aWrappedProperties.push_back( new WrappedProperty("FillTransparence","Transparency") );
     750             : 
     751        5266 :     aWrappedProperties.push_back( new WrappedIgnoreProperty("LineJoint", uno::makeAny( drawing::LineJoint_ROUND ) ) );
     752        5266 :     aWrappedProperties.push_back( new WrappedProperty("FillTransparenceGradientName","TransparencyGradientName") );
     753        5266 :     aWrappedProperties.push_back( new WrappedProperty("FillGradientName","GradientName") );
     754        5266 :     aWrappedProperties.push_back( new WrappedProperty("FillGradientStepCount","GradientStepCount") );
     755        5266 :     aWrappedProperties.push_back( new WrappedProperty("FillHatchName","HatchName") );
     756        5266 :     aWrappedProperties.push_back( new WrappedProperty("FillBitmapName","FillBitmapName") );
     757        5266 :     aWrappedProperties.push_back( new WrappedProperty("FillBackground","FillBackground") );
     758             : 
     759             :     //bitmap properties
     760        5266 :     aWrappedProperties.push_back( new WrappedProperty("FillBitmapMode","FillBitmapMode") );
     761        5266 :     aWrappedProperties.push_back( new WrappedProperty("FillBitmapSizeX","FillBitmapSizeX") );
     762        5266 :     aWrappedProperties.push_back( new WrappedProperty("FillBitmapSizeY","FillBitmapSizeY") );
     763        5266 :     aWrappedProperties.push_back( new WrappedProperty("FillBitmapLogicalSize","FillBitmapLogicalSize") );
     764        5266 :     aWrappedProperties.push_back( new WrappedProperty("FillBitmapOffsetX","FillBitmapOffsetX") );
     765        5266 :     aWrappedProperties.push_back( new WrappedProperty("FillBitmapOffsetY","FillBitmapOffsetY") );
     766        5266 :     aWrappedProperties.push_back( new WrappedProperty("FillBitmapRectanglePoint","FillBitmapRectanglePoint") );
     767        5266 :     aWrappedProperties.push_back( new WrappedProperty("FillBitmapPositionOffsetX","FillBitmapPositionOffsetX") );
     768        5266 :     aWrappedProperties.push_back( new WrappedProperty("FillBitmapPositionOffsetY","FillBitmapPositionOffsetY") );
     769             : 
     770        5266 :     aWrappedProperties.push_back( new WrappedProperty("SolidType","Geometry3D") );
     771        5266 :     aWrappedProperties.push_back( new WrappedSegmentOffsetProperty() );
     772        5266 :     aWrappedProperties.push_back( new WrappedProperty("D3DPercentDiagonal","PercentDiagonal") );
     773             : 
     774        5266 :     aWrappedProperties.push_back( new WrappedTextRotationProperty() );
     775             : 
     776        5266 :     return aWrappedProperties;
     777             : }
     778             : 
     779        9718 : void SAL_CALL DataSeriesPointWrapper::setPropertyValue( const OUString& rPropertyName, const Any& rValue )
     780             :                                     throw (beans::UnknownPropertyException, beans::PropertyVetoException, lang::IllegalArgumentException, lang::WrappedTargetException, uno::RuntimeException, std::exception)
     781             : {
     782        9718 :     if(rPropertyName == "Lines")
     783             :     {
     784           0 :         if( ! (rValue >>= m_bLinesAllowed) )
     785           0 :             throw lang::IllegalArgumentException("Property Lines requires value of type sal_Bool", 0, 0 );
     786             :     }
     787             : 
     788        9718 :     sal_Int32 nHandle = getInfoHelper().getHandleByName( rPropertyName );
     789        9718 :     static const sal_Int32 nErrorCategoryHandle = getInfoHelper().getHandleByName("ErrorCategory");
     790        9718 :     if( nErrorCategoryHandle == nHandle )
     791             :     {
     792           0 :         ::com::sun::star::chart::ChartErrorCategory aNewValue = ::com::sun::star::chart::ChartErrorCategory_NONE;
     793           0 :         rValue >>= aNewValue;
     794           0 :         Any aLow, aHigh;
     795           0 :         bool bSetHighAndLowValues = false;
     796           0 :         switch(aNewValue)
     797             :         {
     798             :             case ::com::sun::star::chart::ChartErrorCategory_CONSTANT_VALUE:
     799           0 :                 aHigh = this->getPropertyValue("ConstantErrorHigh");
     800           0 :                 aLow = this->getPropertyValue("ConstantErrorLow");
     801           0 :                 bSetHighAndLowValues = true;
     802           0 :                 break;
     803             :             case ::com::sun::star::chart::ChartErrorCategory_PERCENT:
     804           0 :                 aHigh = aLow = this->getPropertyValue("PercentageError");
     805           0 :                 bSetHighAndLowValues = true;
     806           0 :                 break;
     807             :             case ::com::sun::star::chart::ChartErrorCategory_ERROR_MARGIN:
     808           0 :                 aHigh = aLow = this->getPropertyValue("ErrorMargin");
     809           0 :                 bSetHighAndLowValues = true;
     810           0 :                 break;
     811             :             default:
     812           0 :                 break;
     813             :         }
     814             : 
     815           0 :         WrappedPropertySet::setPropertyValue( rPropertyName, rValue );
     816             : 
     817           0 :         if(bSetHighAndLowValues)
     818             :         {
     819           0 :             switch(aNewValue)
     820             :             {
     821             :                 case ::com::sun::star::chart::ChartErrorCategory_CONSTANT_VALUE:
     822           0 :                     this->setPropertyValue("ConstantErrorHigh",aHigh);
     823           0 :                     this->setPropertyValue("ConstantErrorLow",aLow);
     824           0 :                     break;
     825             :                 case ::com::sun::star::chart::ChartErrorCategory_PERCENT:
     826           0 :                     this->setPropertyValue("PercentageError",aHigh);
     827           0 :                     break;
     828             :                 case ::com::sun::star::chart::ChartErrorCategory_ERROR_MARGIN:
     829           0 :                     this->setPropertyValue("ErrorMargin",aHigh);
     830           0 :                     break;
     831             :                 default:
     832           0 :                     break;
     833             :             }
     834           0 :         }
     835             :     }
     836             :     else
     837        9718 :         WrappedPropertySet::setPropertyValue( rPropertyName, rValue );
     838        9718 : }
     839             : 
     840      223770 : Any SAL_CALL DataSeriesPointWrapper::getPropertyValue( const OUString& rPropertyName )
     841             :                 throw ( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException, std::exception)
     842             : {
     843      223770 :     if( m_eType == DATA_POINT )
     844             :     {
     845      168702 :         if( rPropertyName == "FillColor" )
     846             :         {
     847        1912 :             Reference< beans::XPropertySet > xSeriesProp( getDataSeries(), uno::UNO_QUERY );
     848        1912 :             bool bVaryColorsByPoint = false;
     849        5736 :             if( xSeriesProp.is() && (xSeriesProp->getPropertyValue("VaryColorsByPoint") >>= bVaryColorsByPoint)
     850        5736 :                 && bVaryColorsByPoint )
     851             :             {
     852        1152 :                 uno::Reference< beans::XPropertyState > xPointState( DataSeriesPointWrapper::getDataPointProperties(), uno::UNO_QUERY );
     853        1152 :                 if( xPointState.is() && xPointState->getPropertyState("Color") == beans::PropertyState_DEFAULT_VALUE )
     854             :                 {
     855           0 :                     Reference< chart2::XDiagram > xDiagram( m_spChart2ModelContact->getChart2Diagram() );
     856           0 :                     if( xDiagram.is() )
     857             :                     {
     858           0 :                         Reference< chart2::XColorScheme > xColorScheme( xDiagram->getDefaultColorScheme() );
     859           0 :                         if( xColorScheme.is() )
     860           0 :                             return uno::makeAny( xColorScheme->getColorByIndex( m_nPointIndex ) );
     861           0 :                     }
     862        1152 :                 }
     863        1912 :             }
     864             :         }
     865             :     }
     866      223770 :     return WrappedPropertySet::getPropertyValue( rPropertyName );
     867             : }
     868             : 
     869           4 : uno::Sequence< OUString > DataSeriesPointWrapper::getSupportedServiceNames_Static()
     870             : {
     871           4 :     uno::Sequence< OUString > aServices( 7 );
     872           4 :     aServices[ 0 ] = "com.sun.star.chart.ChartDataRowProperties";
     873           4 :     aServices[ 1 ] = "com.sun.star.chart.ChartDataPointProperties";
     874           4 :     aServices[ 2 ] = "com.sun.star.xml.UserDefinedAttributesSupplier";
     875           4 :     aServices[ 3 ] =  "com.sun.star.beans.PropertySet";
     876           4 :     aServices[ 4 ] = "com.sun.star.drawing.FillProperties";
     877           4 :     aServices[ 5 ] = "com.sun.star.drawing.LineProperties";
     878           4 :     aServices[ 6 ] = "com.sun.star.style.CharacterProperties";
     879             : 
     880           4 :     return aServices;
     881             : }
     882             : 
     883             : // implement XServiceInfo methods basing upon getSupportedServiceNames_Static
     884           8 : APPHELPER_XSERVICEINFO_IMPL( DataSeriesPointWrapper, lcl_aServiceName );
     885             : 
     886             : } //  namespace wrapper
     887         102 : } //  namespace chart
     888             : 
     889             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10