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

Generated by: LCOV version 1.10