LCOV - code coverage report
Current view: top level - libreoffice/chart2/source/view/main - VDataSeries.cxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 175 517 33.8 %
Date: 2012-12-27 Functions: 40 74 54.1 %
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 "VDataSeries.hxx"
      21             : #include "ObjectIdentifier.hxx"
      22             : #include "macros.hxx"
      23             : #include "CommonConverters.hxx"
      24             : #include "LabelPositionHelper.hxx"
      25             : #include "ChartTypeHelper.hxx"
      26             : #include "ContainerHelper.hxx"
      27             : #include "DataSeriesHelper.hxx"
      28             : #include "RegressionCurveHelper.hxx"
      29             : 
      30             : #include <com/sun/star/chart/MissingValueTreatment.hpp>
      31             : #include <com/sun/star/chart2/Symbol.hpp>
      32             : 
      33             : #include <rtl/math.hxx>
      34             : #include <com/sun/star/beans/XPropertySet.hpp>
      35             : #include <com/sun/star/beans/XPropertyState.hpp>
      36             : #include <com/sun/star/drawing/LineStyle.hpp>
      37             : #include <com/sun/star/drawing/TextVerticalAdjust.hpp>
      38             : #include <com/sun/star/drawing/TextHorizontalAdjust.hpp>
      39             : #include <com/sun/star/text/WritingMode.hpp>
      40             : #include <com/sun/star/chart2/data/XDataSource.hpp>
      41             : 
      42             : //.............................................................................
      43             : namespace chart
      44             : {
      45             : //.............................................................................
      46             : using namespace ::com::sun::star;
      47             : using namespace ::com::sun::star::chart2;
      48             : using ::com::sun::star::uno::Reference;
      49             : 
      50         123 : void VDataSequence::init( const uno::Reference< data::XDataSequence >& xModel )
      51             : {
      52         123 :     Model = xModel;
      53         123 :     Doubles = DataSequenceToDoubleSequence( xModel );
      54         123 : }
      55             : 
      56        4920 : bool VDataSequence::is() const
      57             : {
      58        4920 :     return Model.is();
      59             : }
      60         123 : void VDataSequence::clear()
      61             : {
      62         123 :     Model = NULL;
      63         123 :     Doubles.realloc(0);
      64         123 : }
      65             : 
      66           0 : double VDataSequence::getValue( sal_Int32 index ) const
      67             : {
      68           0 :     if( 0<=index && index<Doubles.getLength() )
      69           0 :         return Doubles[index];
      70             :     else
      71             :     {
      72             :         double fNan;
      73           0 :         ::rtl::math::setNan( & fNan );
      74           0 :         return fNan;
      75             :     }
      76             : }
      77             : 
      78           0 : sal_Int32 VDataSequence::detectNumberFormatKey( sal_Int32 index ) const
      79             : {
      80           0 :     sal_Int32 nNumberFormatKey = -1;
      81             : 
      82             :     // -1 is allowed and means a key for the whole sequence
      83           0 :     if( -1<=index && index<Doubles.getLength() &&
      84           0 :         Model.is())
      85             :     {
      86           0 :         nNumberFormatKey = Model->getNumberFormatKeyByIndex( index );
      87             :     }
      88             : 
      89           0 :     return nNumberFormatKey;
      90             : }
      91             : 
      92        2214 : sal_Int32 VDataSequence::getLength() const
      93             : {
      94        2214 :     return Doubles.getLength();
      95             : }
      96             : 
      97             : namespace
      98             : {
      99             : struct lcl_LessXOfPoint
     100             : {
     101           0 :     inline bool operator() ( const std::vector< double >& first,
     102             :                              const std::vector< double >& second )
     103             :     {
     104           0 :         if( !first.empty() && !second.empty() )
     105             :         {
     106           0 :             return first[0]<second[0];
     107             :         }
     108           0 :         return false;
     109             :     }
     110             : };
     111             : 
     112           0 : void lcl_clearIfNoValuesButTextIsContained( VDataSequence& rData, const uno::Reference<data::XDataSequence>& xDataSequence )
     113             : {
     114             :     //#i71686#, #i101968#, #i102428#
     115           0 :     sal_Int32 nCount = rData.Doubles.getLength();
     116           0 :     for( sal_Int32 i = 0; i < nCount; ++i )
     117             :     {
     118           0 :         if( !::rtl::math::isNan( rData.Doubles[i] ) )
     119             :             return;
     120             :     }
     121             :     //no double value is countained
     122             :     //is there any text?
     123           0 :     uno::Sequence< rtl::OUString > aStrings( DataSequenceToStringSequence( xDataSequence ) );
     124           0 :     sal_Int32 nTextCount = aStrings.getLength();
     125           0 :     for( sal_Int32 j = 0; j < nTextCount; ++j )
     126             :     {
     127           0 :         if( !aStrings[j].isEmpty() )
     128             :         {
     129           0 :             rData.clear();
     130             :             return;
     131             :         }
     132           0 :     }
     133             :     //no content at all
     134             : }
     135             : 
     136        3936 : void lcl_maybeReplaceNanWithZero( double& rfValue, sal_Int32 nMissingValueTreatment )
     137             : {
     138        3936 :     if( nMissingValueTreatment == ::com::sun::star::chart::MissingValueTreatment::USE_ZERO
     139           0 :         && (::rtl::math::isNan(rfValue) || ::rtl::math::isInf(rfValue)) )
     140           0 :             rfValue = 0.0;
     141        3936 : }
     142             : 
     143             : }
     144             : 
     145         123 : VDataSeries::VDataSeries( const uno::Reference< XDataSeries >& xDataSeries )
     146             :     : m_nPolygonIndex(0)
     147             :     , m_fLogicMinX(0.0)
     148             :     , m_fLogicMaxX(0.0)
     149             :     , m_fLogicZPos(0.0)
     150             :     , m_xGroupShape(NULL)
     151             :     , m_xLabelsGroupShape(NULL)
     152             :     , m_xErrorXBarsGroupShape(NULL)
     153             :     , m_xErrorYBarsGroupShape(NULL)
     154             :     , m_xFrontSubGroupShape(NULL)
     155             :     , m_xBackSubGroupShape(NULL)
     156             :     , m_xDataSeries(xDataSeries)
     157             :     , m_aDataSequences()
     158             :     , m_nPointCount(0)
     159             : 
     160             :     , m_aValues_X()
     161             :     , m_aValues_Y()
     162             :     , m_aValues_Z()
     163             :     , m_aValues_Y_Min()
     164             :     , m_aValues_Y_Max()
     165             :     , m_aValues_Y_First()
     166             :     , m_aValues_Y_Last()
     167             :     , m_aValues_Bubble_Size()
     168             :     , m_pValueSequenceForDataLabelNumberFormatDetection(&m_aValues_Y)
     169             : 
     170             :     , m_fXMeanValue(1.0)
     171             :     , m_fYMeanValue(1.0)
     172             : 
     173             :     , m_aAttributedDataPointIndexList()
     174             : 
     175             :     , m_eStackingDirection(StackingDirection_NO_STACKING)
     176             :     , m_nAxisIndex(0)
     177             :     , m_bConnectBars(sal_False)
     178             :     , m_bGroupBarsPerAxis(sal_True)
     179             :     , m_nStartingAngle(90)
     180             : 
     181             :     , m_aSeriesParticle()
     182             :     , m_aCID()
     183             :     , m_aPointCID_Stub()
     184             :     , m_aLabelCID_Stub()
     185             : 
     186             :     , m_nGlobalSeriesIndex(0)
     187             : 
     188             :     , m_apLabel_Series(NULL)
     189             :     , m_apLabelPropNames_Series(NULL)
     190             :     , m_apLabelPropValues_Series(NULL)
     191             :     , m_apSymbolProperties_Series(NULL)
     192             : 
     193             :     , m_apLabel_AttributedPoint(NULL)
     194             :     , m_apLabelPropNames_AttributedPoint(NULL)
     195             :     , m_apLabelPropValues_AttributedPoint(NULL)
     196             :     , m_apSymbolProperties_AttributedPoint(NULL)
     197             :     , m_apSymbolProperties_InvisibleSymbolForSelection(NULL)
     198             :     , m_nCurrentAttributedPoint(-1)
     199             :     , m_nMissingValueTreatment(::com::sun::star::chart::MissingValueTreatment::LEAVE_GAP)
     200         123 :     , m_bAllowPercentValueInDataLabel(false)
     201             : {
     202         123 :     ::rtl::math::setNan( & m_fXMeanValue );
     203         123 :     ::rtl::math::setNan( & m_fYMeanValue );
     204             : 
     205             :     uno::Reference<data::XDataSource> xDataSource =
     206         123 :             uno::Reference<data::XDataSource>( xDataSeries, uno::UNO_QUERY );
     207             : 
     208         123 :     m_aDataSequences = xDataSource->getDataSequences();
     209             : 
     210         369 :     for(sal_Int32 nN = m_aDataSequences.getLength();nN--;)
     211             :     {
     212         123 :         if(!m_aDataSequences[nN].is())
     213           0 :             continue;
     214         123 :         uno::Reference<data::XDataSequence>  xDataSequence( m_aDataSequences[nN]->getValues());
     215         123 :         uno::Reference<beans::XPropertySet> xProp(xDataSequence, uno::UNO_QUERY );
     216         123 :         if( xProp.is())
     217             :         {
     218             :             try
     219             :             {
     220         123 :                 uno::Any aARole = xProp->getPropertyValue( C2U( "Role" ) );
     221         123 :                 rtl::OUString aRole;
     222         123 :                 aARole >>= aRole;
     223             : 
     224         123 :                 if( aRole.equals(C2U("values-x")) )
     225             :                 {
     226           0 :                     m_aValues_X.init( xDataSequence );
     227           0 :                     lcl_clearIfNoValuesButTextIsContained( m_aValues_X, xDataSequence );
     228             :                 }
     229         123 :                 else if( aRole.equals(C2U("values-y")) )
     230         123 :                     m_aValues_Y.init( xDataSequence );
     231           0 :                 else if( aRole.equals(C2U("values-min")) )
     232           0 :                     m_aValues_Y_Min.init( xDataSequence );
     233           0 :                 else if( aRole.equals(C2U("values-max")) )
     234           0 :                     m_aValues_Y_Max.init( xDataSequence );
     235           0 :                 else if( aRole.equals(C2U("values-first")) )
     236           0 :                     m_aValues_Y_First.init( xDataSequence );
     237           0 :                 else if( aRole.equals(C2U("values-last")) )
     238           0 :                     m_aValues_Y_Last.init( xDataSequence );
     239           0 :                 else if( aRole.equals(C2U("values-size")) )
     240           0 :                     m_aValues_Bubble_Size.init( xDataSequence );
     241             :             }
     242           0 :             catch( const uno::Exception& e )
     243             :             {
     244             :                 ASSERT_EXCEPTION( e );
     245             :             }
     246             :         }
     247         123 :     }
     248             : 
     249             :     //determine the point count
     250         123 :     m_nPointCount = m_aValues_Y.getLength();
     251             :     {
     252         123 :         if( m_nPointCount < m_aValues_Bubble_Size.getLength() )
     253           0 :             m_nPointCount = m_aValues_Bubble_Size.getLength();
     254         123 :         if( m_nPointCount < m_aValues_Y_Min.getLength() )
     255           0 :             m_nPointCount = m_aValues_Y_Min.getLength();
     256         123 :         if( m_nPointCount < m_aValues_Y_Max.getLength() )
     257           0 :             m_nPointCount = m_aValues_Y_Max.getLength();
     258         123 :         if( m_nPointCount < m_aValues_Y_First.getLength() )
     259           0 :             m_nPointCount = m_aValues_Y_First.getLength();
     260         123 :         if( m_nPointCount < m_aValues_Y_Last.getLength() )
     261           0 :             m_nPointCount = m_aValues_Y_Last.getLength();
     262             :     }
     263             : 
     264         123 :     uno::Reference<beans::XPropertySet> xProp(xDataSeries, uno::UNO_QUERY );
     265         123 :     if( xProp.is())
     266             :     {
     267             :         try
     268             :         {
     269             :             //get AttributedDataPoints
     270         123 :             xProp->getPropertyValue( C2U( "AttributedDataPoints" ) ) >>= m_aAttributedDataPointIndexList;
     271             : 
     272         123 :             xProp->getPropertyValue( C2U( "StackingDirection" ) ) >>= m_eStackingDirection;
     273             : 
     274         123 :             xProp->getPropertyValue( C2U( "AttachedAxisIndex" ) ) >>= m_nAxisIndex;
     275         123 :             if(m_nAxisIndex<0)
     276           0 :                 m_nAxisIndex=0;
     277             :         }
     278           0 :         catch( const uno::Exception& e )
     279             :         {
     280             :             ASSERT_EXCEPTION( e );
     281             :         }
     282         123 :     }
     283         123 : }
     284             : 
     285         246 : VDataSeries::~VDataSeries()
     286             : {
     287         246 : }
     288             : 
     289           0 : void VDataSeries::doSortByXValues()
     290             : {
     291           0 :     if( m_aValues_X.is() && m_aValues_X.Doubles.getLength() )
     292             :     {
     293             :         //prepare a vector for sorting
     294           0 :         std::vector< ::std::vector< double > > aTmp;//outer vector are points, inner vector are the different values of athe point
     295             :         double fNan;
     296           0 :         ::rtl::math::setNan( & fNan );
     297           0 :         sal_Int32 nPointIndex = 0;
     298           0 :         for( nPointIndex=0; nPointIndex < m_nPointCount; nPointIndex++ )
     299             :         {
     300           0 :             std::vector< double > aSinglePoint;
     301           0 :             aSinglePoint.push_back( (nPointIndex < m_aValues_X.Doubles.getLength()) ? m_aValues_X.Doubles[nPointIndex] : fNan );
     302           0 :             aSinglePoint.push_back( (nPointIndex < m_aValues_Y.Doubles.getLength()) ? m_aValues_Y.Doubles[nPointIndex] : fNan );
     303           0 :             aTmp.push_back( aSinglePoint );
     304           0 :         }
     305             : 
     306             :         //do sort
     307           0 :         std::sort( aTmp.begin(), aTmp.end(), lcl_LessXOfPoint() );
     308             : 
     309             :         //fill the sorted points back to the members
     310           0 :         m_aValues_X.Doubles.realloc( m_nPointCount );
     311           0 :         m_aValues_Y.Doubles.realloc( m_nPointCount );
     312             : 
     313           0 :         for( nPointIndex=0; nPointIndex < m_nPointCount; nPointIndex++ )
     314             :         {
     315           0 :             m_aValues_X.Doubles[nPointIndex]=aTmp[nPointIndex][0];
     316           0 :             m_aValues_Y.Doubles[nPointIndex]=aTmp[nPointIndex][1];
     317           0 :         }
     318             :     }
     319           0 : }
     320             : 
     321         492 : uno::Reference< XDataSeries > VDataSeries::getModel() const
     322             : {
     323         492 :     return m_xDataSeries;
     324             : }
     325             : 
     326           0 : void VDataSeries::releaseShapes()
     327             : {
     328           0 :     m_xGroupShape.set(0);
     329           0 :     m_xLabelsGroupShape.set(0);
     330           0 :     m_xErrorXBarsGroupShape.set(0);
     331           0 :     m_xErrorYBarsGroupShape.set(0);
     332           0 :     m_xFrontSubGroupShape.set(0);
     333           0 :     m_xBackSubGroupShape.set(0);
     334             : 
     335           0 :     m_aPolyPolygonShape3D.SequenceX.realloc(0);
     336           0 :     m_aPolyPolygonShape3D.SequenceY.realloc(0);
     337           0 :     m_aPolyPolygonShape3D.SequenceZ.realloc(0);
     338           0 :     m_nPolygonIndex = 0;
     339           0 : }
     340             : 
     341         123 : void VDataSeries::setCategoryXAxis()
     342             : {
     343         123 :     m_aValues_X.clear();
     344         123 :     m_bAllowPercentValueInDataLabel = true;
     345         123 : }
     346             : 
     347           0 : void VDataSeries::setXValues( const Reference< chart2::data::XDataSequence >& xValues )
     348             : {
     349           0 :     m_aValues_X.clear();
     350           0 :     m_aValues_X.init( xValues );
     351           0 :     m_bAllowPercentValueInDataLabel = true;
     352           0 : }
     353             : 
     354           0 : void VDataSeries::setXValuesIfNone( const Reference< chart2::data::XDataSequence >& xValues )
     355             : {
     356           0 :     if( m_aValues_X.is() )
     357           0 :         return;
     358             : 
     359           0 :     m_aValues_X.init( xValues );
     360           0 :     lcl_clearIfNoValuesButTextIsContained( m_aValues_X, xValues );
     361             : }
     362             : 
     363         123 : void VDataSeries::setGlobalSeriesIndex( sal_Int32 nGlobalSeriesIndex )
     364             : {
     365         123 :     m_nGlobalSeriesIndex = nGlobalSeriesIndex;
     366         123 : }
     367             : 
     368         123 : void VDataSeries::setParticle( const rtl::OUString& rSeriesParticle )
     369             : {
     370         123 :     m_aSeriesParticle = rSeriesParticle;
     371             : 
     372             :     //get CID
     373         123 :     m_aCID = ObjectIdentifier::createClassifiedIdentifierForParticle( m_aSeriesParticle );
     374         123 :     m_aPointCID_Stub = ObjectIdentifier::createSeriesSubObjectStub( OBJECTTYPE_DATA_POINT, m_aSeriesParticle );
     375             : 
     376             :     m_aLabelCID_Stub = ObjectIdentifier::createClassifiedIdentifierWithParent(
     377         123 :                         OBJECTTYPE_DATA_LABEL, ::rtl::OUString(), getLabelsCID() );
     378         123 : }
     379         123 : rtl::OUString VDataSeries::getSeriesParticle() const
     380             : {
     381         123 :     return m_aSeriesParticle;
     382             : }
     383         123 : rtl::OUString VDataSeries::getCID() const
     384             : {
     385         123 :     return m_aCID;
     386             : }
     387         492 : rtl::OUString VDataSeries::getPointCID_Stub() const
     388             : {
     389         492 :     return m_aPointCID_Stub;
     390             : }
     391           0 : rtl::OUString VDataSeries::getErrorBarsCID(bool bYError) const
     392             : {
     393             :     rtl::OUString aChildParticle( ObjectIdentifier::getStringForType(
     394           0 :                                       bYError ? OBJECTTYPE_DATA_ERRORS_Y : OBJECTTYPE_DATA_ERRORS_X ) );
     395           0 :     aChildParticle+=(C2U("="));
     396             : 
     397             :     return ObjectIdentifier::createClassifiedIdentifierForParticles(
     398           0 :             m_aSeriesParticle, aChildParticle );
     399             : }
     400         123 : rtl::OUString VDataSeries::getLabelsCID() const
     401             : {
     402         123 :     rtl::OUString aChildParticle( ObjectIdentifier::getStringForType( OBJECTTYPE_DATA_LABELS ) );
     403         123 :     aChildParticle+=(C2U("="));
     404             : 
     405             :     return ObjectIdentifier::createClassifiedIdentifierForParticles(
     406         123 :             m_aSeriesParticle, aChildParticle );
     407             : }
     408           0 : rtl::OUString VDataSeries::getLabelCID_Stub() const
     409             : {
     410           0 :     return m_aLabelCID_Stub;
     411             : }
     412           0 : rtl::OUString VDataSeries::getDataCurveCID( sal_Int32 nCurveIndex, bool bAverageLine ) const
     413             : {
     414           0 :     rtl::OUString aRet;
     415           0 :     aRet = ObjectIdentifier::createDataCurveCID( m_aSeriesParticle, nCurveIndex, bAverageLine );
     416           0 :     return aRet;
     417             : }
     418             : 
     419           0 : rtl::OUString VDataSeries::getDataCurveEquationCID( sal_Int32 nCurveIndex ) const
     420             : {
     421           0 :     rtl::OUString aRet;
     422           0 :     aRet = ObjectIdentifier::createDataCurveEquationCID( m_aSeriesParticle, nCurveIndex );
     423           0 :     return aRet;
     424             : }
     425         123 : void VDataSeries::setPageReferenceSize( const awt::Size & rPageRefSize )
     426             : {
     427         123 :     m_aReferenceSize = rPageRefSize;
     428         123 : }
     429             : 
     430         246 : StackingDirection VDataSeries::getStackingDirection() const
     431             : {
     432         246 :     return m_eStackingDirection;
     433             : }
     434        1722 : sal_Int32 VDataSeries::getAttachedAxisIndex() const
     435             : {
     436        1722 :     return m_nAxisIndex;
     437             : }
     438         123 : void VDataSeries::setConnectBars( sal_Bool bConnectBars )
     439             : {
     440         123 :     m_bConnectBars = bConnectBars;
     441         123 : }
     442          41 : sal_Bool VDataSeries::getConnectBars() const
     443             : {
     444          41 :     return m_bConnectBars;
     445             : }
     446         123 : void VDataSeries::setGroupBarsPerAxis( sal_Bool bGroupBarsPerAxis )
     447             : {
     448         123 :     m_bGroupBarsPerAxis = bGroupBarsPerAxis;
     449         123 : }
     450         164 : sal_Bool VDataSeries::getGroupBarsPerAxis() const
     451             : {
     452         164 :     return m_bGroupBarsPerAxis;
     453             : }
     454             : 
     455         123 : void VDataSeries::setStartingAngle( sal_Int32 nStartingAngle )
     456             : {
     457         123 :     m_nStartingAngle = nStartingAngle;
     458         123 : }
     459           0 : sal_Int32 VDataSeries::getStartingAngle() const
     460             : {
     461           0 :     return m_nStartingAngle;
     462             : }
     463             : 
     464           0 : void VDataSeries::setAttachedAxisIndex( sal_Int32 nAttachedAxisIndex )
     465             : {
     466           0 :     if( nAttachedAxisIndex < 0 )
     467           0 :         nAttachedAxisIndex = 0;
     468           0 :     m_nAxisIndex = nAttachedAxisIndex;
     469           0 : }
     470             : 
     471         615 : sal_Int32 VDataSeries::getTotalPointCount() const
     472             : {
     473         615 :     return m_nPointCount;
     474             : }
     475             : 
     476        2460 : double VDataSeries::getXValue( sal_Int32 index ) const
     477             : {
     478        2460 :     double fRet = 0.0;
     479        2460 :     if(m_aValues_X.is())
     480             :     {
     481           0 :         if( 0<=index && index<m_aValues_X.getLength() )
     482           0 :             fRet = m_aValues_X.Doubles[index];
     483             :         else
     484           0 :             ::rtl::math::setNan( &fRet );
     485             :     }
     486             :     else
     487             :     {
     488             :         // #i70133# always return correct X position - needed for short data series
     489        2460 :         if( 0<=index /*&& index < m_nPointCount*/ )
     490        2460 :             fRet = index+1;//first category (index 0) matches with real number 1.0
     491             :         else
     492           0 :             ::rtl::math::setNan( &fRet );
     493             :     }
     494        2460 :     lcl_maybeReplaceNanWithZero( fRet, getMissingValueTreatment() );
     495        2460 :     return fRet;
     496             : }
     497             : 
     498        1476 : double VDataSeries::getYValue( sal_Int32 index ) const
     499             : {
     500        1476 :     double fRet = 0.0;
     501        1476 :     if(m_aValues_Y.is())
     502             :     {
     503        1476 :         if( 0<=index && index<m_aValues_Y.getLength() )
     504        1476 :             fRet = m_aValues_Y.Doubles[index];
     505             :         else
     506           0 :             ::rtl::math::setNan( &fRet );
     507             :     }
     508             :     else
     509             :     {
     510             :         // #i70133# always return correct X position - needed for short data series
     511           0 :         if( 0<=index /*&& index < m_nPointCount*/ )
     512           0 :             fRet = index+1;//first category (index 0) matches with real number 1.0
     513             :         else
     514           0 :             ::rtl::math::setNan( &fRet );
     515             :     }
     516        1476 :     lcl_maybeReplaceNanWithZero( fRet, getMissingValueTreatment() );
     517        1476 :     return fRet;
     518             : }
     519             : 
     520           0 : double VDataSeries::getY_Min( sal_Int32 index ) const
     521             : {
     522           0 :     return m_aValues_Y_Min.getValue( index );
     523             : }
     524           0 : double VDataSeries::getY_Max( sal_Int32 index ) const
     525             : {
     526           0 :     return m_aValues_Y_Max.getValue( index );
     527             : }
     528           0 : double VDataSeries::getY_First( sal_Int32 index ) const
     529             : {
     530           0 :     return m_aValues_Y_First.getValue( index );
     531             : }
     532           0 : double VDataSeries::getY_Last( sal_Int32 index ) const
     533             : {
     534           0 :     return m_aValues_Y_Last.getValue( index );
     535             : }
     536           0 : double VDataSeries::getBubble_Size( sal_Int32 index ) const
     537             : {
     538           0 :     return m_aValues_Bubble_Size.getValue( index );
     539             : }
     540             : 
     541           0 : bool VDataSeries::hasExplicitNumberFormat( sal_Int32 nPointIndex, bool bForPercentage ) const
     542             : {
     543           0 :     rtl::OUString aPropName( bForPercentage ? C2U( "PercentageNumberFormat" ) : C2U( "NumberFormat" ) );
     544           0 :     bool bHasNumberFormat = false;
     545           0 :     uno::Reference< beans::XPropertySet > xPointProp( this->getPropertiesOfPoint( nPointIndex ));
     546           0 :     sal_Int32 nNumberFormat = -1;
     547           0 :     if( xPointProp.is() && (xPointProp->getPropertyValue(aPropName) >>= nNumberFormat) )
     548           0 :         bHasNumberFormat = true;
     549           0 :     return bHasNumberFormat;
     550             : }
     551           0 : sal_Int32 VDataSeries::getExplicitNumberFormat( sal_Int32 nPointIndex, bool bForPercentage ) const
     552             : {
     553           0 :     rtl::OUString aPropName( bForPercentage ? C2U( "PercentageNumberFormat" ) : C2U( "NumberFormat" ) );
     554           0 :     sal_Int32 nNumberFormat = -1;
     555           0 :     uno::Reference< beans::XPropertySet > xPointProp( this->getPropertiesOfPoint( nPointIndex ));
     556           0 :     if( xPointProp.is() )
     557           0 :         xPointProp->getPropertyValue(aPropName) >>= nNumberFormat;
     558           0 :     return nNumberFormat;
     559             : }
     560         123 : void VDataSeries::setRoleOfSequenceForDataLabelNumberFormatDetection( const rtl::OUString& rRole )
     561             : {
     562         123 :     if( rRole.equals(C2U("values-y")) )
     563         123 :         m_pValueSequenceForDataLabelNumberFormatDetection = &m_aValues_Y;
     564           0 :     else if( rRole.equals(C2U("values-size")) )
     565           0 :         m_pValueSequenceForDataLabelNumberFormatDetection = &m_aValues_Bubble_Size;
     566           0 :     else if( rRole.equals(C2U("values-min")) )
     567           0 :         m_pValueSequenceForDataLabelNumberFormatDetection = &m_aValues_Y_Min;
     568           0 :     else if( rRole.equals(C2U("values-max")) )
     569           0 :         m_pValueSequenceForDataLabelNumberFormatDetection = &m_aValues_Y_Max;
     570           0 :     else if( rRole.equals(C2U("values-first")) )
     571           0 :         m_pValueSequenceForDataLabelNumberFormatDetection = &m_aValues_Y_First;
     572           0 :     else if( rRole.equals(C2U("values-last")) )
     573           0 :         m_pValueSequenceForDataLabelNumberFormatDetection = &m_aValues_Y_Last;
     574           0 :     else if( rRole.equals(C2U("values-x")) )
     575           0 :         m_pValueSequenceForDataLabelNumberFormatDetection = &m_aValues_X;
     576         123 : }
     577           0 : bool VDataSeries::shouldLabelNumberFormatKeyBeDetectedFromYAxis() const
     578             : {
     579           0 :     if( m_pValueSequenceForDataLabelNumberFormatDetection == &m_aValues_Bubble_Size )
     580           0 :         return false;
     581           0 :     else if( m_pValueSequenceForDataLabelNumberFormatDetection == &m_aValues_X )
     582           0 :         return false;
     583           0 :     return true;
     584             : }
     585           0 : sal_Int32 VDataSeries::detectNumberFormatKey( sal_Int32 index ) const
     586             : {
     587           0 :     sal_Int32 nRet = 0;
     588           0 :     if( m_pValueSequenceForDataLabelNumberFormatDetection )
     589           0 :         nRet = m_pValueSequenceForDataLabelNumberFormatDetection->detectNumberFormatKey( index );
     590           0 :     return nRet;
     591             : }
     592             : 
     593           0 : sal_Int32 VDataSeries::getLabelPlacement( sal_Int32 nPointIndex, const uno::Reference< chart2::XChartType >& xChartType, sal_Int32 nDimensionCount, sal_Bool bSwapXAndY ) const
     594             : {
     595           0 :     sal_Int32 nLabelPlacement=0;
     596             :     try
     597             :     {
     598           0 :         uno::Reference< beans::XPropertySet > xPointProps( this->getPropertiesOfPoint( nPointIndex ) );
     599           0 :         if( xPointProps.is() )
     600           0 :             xPointProps->getPropertyValue( C2U( "LabelPlacement" ) ) >>= nLabelPlacement;
     601             : 
     602             :         //ensure that the set label placement is supported by this charttype
     603             : 
     604             :         uno::Sequence < sal_Int32 > aAvailablePlacements( ChartTypeHelper::getSupportedLabelPlacements(
     605           0 :                 xChartType, nDimensionCount, bSwapXAndY, m_xDataSeries ) );
     606             : 
     607           0 :         for( sal_Int32 nN = 0; nN < aAvailablePlacements.getLength(); nN++ )
     608           0 :             if( aAvailablePlacements[nN] == nLabelPlacement )
     609           0 :                 return nLabelPlacement; //ok
     610             : 
     611             :         //otherwise use the first supported one
     612           0 :         if( aAvailablePlacements.getLength() )
     613             :         {
     614           0 :             nLabelPlacement = aAvailablePlacements[0];
     615           0 :             return nLabelPlacement;
     616             :         }
     617             : 
     618           0 :         OSL_FAIL("no label placement supported");
     619             :     }
     620           0 :     catch( const uno::Exception& e )
     621             :     {
     622             :         ASSERT_EXCEPTION( e );
     623             :     }
     624           0 :     return nLabelPlacement;
     625             : }
     626             : 
     627         492 : double VDataSeries::getMinimumofAllDifferentYValues( sal_Int32 index ) const
     628             : {
     629         492 :     double fMin=0.0;
     630         492 :     ::rtl::math::setInf(&fMin, false);
     631             : 
     632         492 :     if( !m_aValues_Y.is() &&
     633           0 :         (m_aValues_Y_Min.is() || m_aValues_Y_Max.is()
     634           0 :         || m_aValues_Y_First.is() || m_aValues_Y_Last.is() ) )
     635             :     {
     636           0 :         double fY_Min = getY_Min( index );
     637           0 :         double fY_Max = getY_Max( index );
     638           0 :         double fY_First = getY_First( index );
     639           0 :         double fY_Last = getY_Last( index );
     640             : 
     641           0 :         if(fMin>fY_First)
     642           0 :             fMin=fY_First;
     643           0 :         if(fMin>fY_Last)
     644           0 :             fMin=fY_Last;
     645           0 :         if(fMin>fY_Min)
     646           0 :             fMin=fY_Min;
     647           0 :         if(fMin>fY_Max)
     648           0 :             fMin=fY_Max;
     649             :     }
     650             :     else
     651             :     {
     652         492 :         double fY = getYValue( index );
     653         492 :         if(fMin>fY)
     654         492 :             fMin=fY;
     655             :     }
     656             : 
     657         492 :     if( ::rtl::math::isInf(fMin) )
     658           0 :         ::rtl::math::setNan(&fMin);
     659             : 
     660         492 :     return fMin;
     661             : }
     662             : 
     663         492 : double VDataSeries::getMaximumofAllDifferentYValues( sal_Int32 index ) const
     664             : {
     665         492 :     double fMax=0.0;
     666         492 :     ::rtl::math::setInf(&fMax, true);
     667             : 
     668         492 :     if( !m_aValues_Y.is() &&
     669           0 :         (m_aValues_Y_Min.is() || m_aValues_Y_Max.is()
     670           0 :         || m_aValues_Y_First.is() || m_aValues_Y_Last.is() ) )
     671             :     {
     672           0 :         double fY_Min = getY_Min( index );
     673           0 :         double fY_Max = getY_Max( index );
     674           0 :         double fY_First = getY_First( index );
     675           0 :         double fY_Last = getY_Last( index );
     676             : 
     677           0 :         if(fMax<fY_First)
     678           0 :             fMax=fY_First;
     679           0 :         if(fMax<fY_Last)
     680           0 :             fMax=fY_Last;
     681           0 :         if(fMax<fY_Min)
     682           0 :             fMax=fY_Min;
     683           0 :         if(fMax<fY_Max)
     684           0 :             fMax=fY_Max;
     685             :     }
     686             :     else
     687             :     {
     688         492 :         double fY = getYValue( index );
     689         492 :         if(fMax<fY)
     690         492 :             fMax=fY;
     691             :     }
     692             : 
     693         492 :     if( ::rtl::math::isInf(fMax) )
     694           0 :         ::rtl::math::setNan(&fMax);
     695             : 
     696         492 :     return fMax;
     697             : }
     698             : 
     699           0 : uno::Sequence< double > VDataSeries::getAllX() const
     700             : {
     701           0 :     if(!m_aValues_X.is() && !m_aValues_X.getLength() && m_nPointCount)
     702             :     {
     703             :         //init x values from category indexes
     704             :         //first category (index 0) matches with real number 1.0
     705           0 :         m_aValues_X.Doubles.realloc( m_nPointCount );
     706           0 :         for(sal_Int32 nN=m_aValues_X.getLength();nN--;)
     707           0 :             m_aValues_X.Doubles[nN] = nN+1;
     708             :     }
     709           0 :     return m_aValues_X.Doubles;
     710             : }
     711             : 
     712           0 : uno::Sequence< double > VDataSeries::getAllY() const
     713             : {
     714           0 :     if(!m_aValues_Y.is() && !m_aValues_Y.getLength() && m_nPointCount)
     715             :     {
     716             :         //init y values from indexes
     717             :         //first y-value (index 0) matches with real number 1.0
     718           0 :         m_aValues_Y.Doubles.realloc( m_nPointCount );
     719           0 :         for(sal_Int32 nN=m_aValues_Y.getLength();nN--;)
     720           0 :             m_aValues_Y.Doubles[nN] = nN+1;
     721             :     }
     722           0 :     return m_aValues_Y.Doubles;
     723             : }
     724             : 
     725           0 : double VDataSeries::getXMeanValue() const
     726             : {
     727           0 :     if( ::rtl::math::isNan( m_fXMeanValue ) )
     728             :     {
     729           0 :         uno::Reference< XRegressionCurveCalculator > xCalculator( RegressionCurveHelper::createRegressionCurveCalculatorByServiceName( "com.sun.star.chart2.MeanValueRegressionCurve" ) );
     730           0 :         uno::Sequence< double > aXValuesDummy;
     731           0 :         xCalculator->recalculateRegression( aXValuesDummy, getAllX() );
     732           0 :         double fXDummy = 1.0;
     733           0 :         m_fXMeanValue = xCalculator->getCurveValue( fXDummy );
     734             :     }
     735           0 :     return m_fXMeanValue;
     736             : }
     737             : 
     738           0 : double VDataSeries::getYMeanValue() const
     739             : {
     740           0 :     if( ::rtl::math::isNan( m_fYMeanValue ) )
     741             :     {
     742           0 :         uno::Reference< XRegressionCurveCalculator > xCalculator( RegressionCurveHelper::createRegressionCurveCalculatorByServiceName( C2U("com.sun.star.chart2.MeanValueRegressionCurve") ) );
     743           0 :         uno::Sequence< double > aXValuesDummy;
     744           0 :         xCalculator->recalculateRegression( aXValuesDummy, getAllY() );
     745           0 :         double fXDummy = 1.0;
     746           0 :         m_fYMeanValue = xCalculator->getCurveValue( fXDummy );
     747             :     }
     748           0 :     return m_fYMeanValue;
     749             : }
     750             : 
     751             : SAL_WNODEPRECATED_DECLARATIONS_PUSH
     752           0 : ::std::auto_ptr< Symbol > getSymbolPropertiesFromPropertySet(
     753             :         const uno::Reference< beans::XPropertySet >& xProp )
     754             : {
     755           0 :     ::std::auto_ptr< Symbol > apSymbolProps( new Symbol() );
     756             :     try
     757             :     {
     758           0 :         if( xProp->getPropertyValue( C2U( "Symbol" ) ) >>= *apSymbolProps )
     759             :         {
     760             :             //use main color to fill symbols
     761           0 :             xProp->getPropertyValue( C2U( "Color" ) ) >>= apSymbolProps->FillColor;
     762             :             // border of symbols always same as fill color
     763           0 :             apSymbolProps->BorderColor = apSymbolProps->FillColor;
     764             :         }
     765             :         else
     766           0 :             apSymbolProps.reset();
     767             :     }
     768           0 :     catch(const uno::Exception &e)
     769             :     {
     770             :         ASSERT_EXCEPTION( e );
     771             :     }
     772           0 :     return apSymbolProps;
     773             : }
     774             : SAL_WNODEPRECATED_DECLARATIONS_PUSH
     775             : 
     776           0 : Symbol* VDataSeries::getSymbolProperties( sal_Int32 index ) const
     777             : {
     778           0 :     Symbol* pRet=NULL;
     779           0 :     if( isAttributedDataPoint( index ) )
     780             :     {
     781           0 :         adaptPointCache( index );
     782           0 :         if(!m_apSymbolProperties_AttributedPoint.get())
     783           0 :             m_apSymbolProperties_AttributedPoint = getSymbolPropertiesFromPropertySet( this->getPropertiesOfPoint( index ) );
     784           0 :         pRet = m_apSymbolProperties_AttributedPoint.get();
     785             :         //if a single data point does not have symbols but the dataseries itself has symbols
     786             :         //we create an invisible symbol shape to enable selection of that point
     787           0 :         if( !pRet || pRet->Style == SymbolStyle_NONE )
     788             :         {
     789           0 :             if(!m_apSymbolProperties_Series.get())
     790           0 :                 m_apSymbolProperties_Series = getSymbolPropertiesFromPropertySet( this->getPropertiesOfSeries() );
     791           0 :             if( m_apSymbolProperties_Series.get() && m_apSymbolProperties_Series->Style != SymbolStyle_NONE )
     792             :             {
     793           0 :                 if(!m_apSymbolProperties_InvisibleSymbolForSelection.get())
     794             :                 {
     795             :                     SAL_WNODEPRECATED_DECLARATIONS_PUSH
     796           0 :                     m_apSymbolProperties_InvisibleSymbolForSelection = ::std::auto_ptr< Symbol >( new Symbol() );
     797             :                     SAL_WNODEPRECATED_DECLARATIONS_POP
     798           0 :                     m_apSymbolProperties_InvisibleSymbolForSelection->Style = SymbolStyle_STANDARD;
     799           0 :                     m_apSymbolProperties_InvisibleSymbolForSelection->StandardSymbol = 0;//square
     800           0 :                     m_apSymbolProperties_InvisibleSymbolForSelection->Size = m_apSymbolProperties_Series->Size;
     801           0 :                     m_apSymbolProperties_InvisibleSymbolForSelection->BorderColor = 0xff000000;//invisible
     802           0 :                     m_apSymbolProperties_InvisibleSymbolForSelection->FillColor = 0xff000000;//invisible
     803             :                 }
     804           0 :                 pRet = m_apSymbolProperties_InvisibleSymbolForSelection.get();
     805             :             }
     806             :         }
     807             :     }
     808             :     else
     809             :     {
     810           0 :         if(!m_apSymbolProperties_Series.get())
     811           0 :             m_apSymbolProperties_Series = getSymbolPropertiesFromPropertySet( this->getPropertiesOfSeries() );
     812           0 :         pRet = m_apSymbolProperties_Series.get();
     813             :     }
     814             : 
     815           0 :     if( pRet && pRet->Style == SymbolStyle_AUTO )
     816             :     {
     817           0 :         pRet->Style = SymbolStyle_STANDARD;
     818             : 
     819           0 :         sal_Int32 nIndex = m_nGlobalSeriesIndex;
     820           0 :         if(m_aValues_X.is())
     821           0 :             nIndex++;
     822           0 :         pRet->StandardSymbol = nIndex;
     823             :     }
     824             : 
     825           0 :     return pRet;
     826             : }
     827             : 
     828           0 : uno::Reference< beans::XPropertySet > VDataSeries::getXErrorBarProperties( sal_Int32 index ) const
     829             : {
     830           0 :     uno::Reference< beans::XPropertySet > xErrorBarProp;
     831             : 
     832           0 :     uno::Reference< beans::XPropertySet > xPointProp( this->getPropertiesOfPoint( index ));
     833           0 :     if( xPointProp.is() )
     834           0 :         xPointProp->getPropertyValue( C2U( "ErrorBarX" )) >>= xErrorBarProp;
     835           0 :     return xErrorBarProp;
     836             : }
     837             : 
     838         492 : uno::Reference< beans::XPropertySet > VDataSeries::getYErrorBarProperties( sal_Int32 index ) const
     839             : {
     840         492 :     uno::Reference< beans::XPropertySet > xErrorBarProp;
     841             : 
     842         492 :     uno::Reference< beans::XPropertySet > xPointProp( this->getPropertiesOfPoint( index ));
     843         492 :     if( xPointProp.is() )
     844         492 :         xPointProp->getPropertyValue( C2U( "ErrorBarY" )) >>= xErrorBarProp;
     845         492 :     return xErrorBarProp;
     846             : }
     847             : 
     848           0 : bool VDataSeries::hasPointOwnColor( sal_Int32 index ) const
     849             : {
     850           0 :     if( !isAttributedDataPoint(index) )
     851           0 :         return false;
     852             : 
     853             :     try
     854             :     {
     855           0 :         uno::Reference< beans::XPropertyState > xPointState( this->getPropertiesOfPoint(index), uno::UNO_QUERY_THROW );
     856           0 :         return (xPointState->getPropertyState( C2U("Color")) != beans::PropertyState_DEFAULT_VALUE );
     857             :     }
     858           0 :     catch(const uno::Exception& e)
     859             :     {
     860             :         ASSERT_EXCEPTION( e );
     861             :     }
     862           0 :     return false;
     863             : }
     864             : 
     865        2091 : bool VDataSeries::isAttributedDataPoint( sal_Int32 index ) const
     866             : {
     867             :     //returns true if the data point assigned by the given index has set it's own properties
     868        2091 :     if( index>=m_nPointCount || m_nPointCount==0)
     869           0 :         return false;
     870        4182 :     for(sal_Int32 nN=m_aAttributedDataPointIndexList.getLength();nN--;)
     871             :     {
     872           0 :         if(index==m_aAttributedDataPointIndexList[nN])
     873           0 :             return true;
     874             :     }
     875        2091 :     return false;
     876             : }
     877             : 
     878         164 : bool VDataSeries::isVaryColorsByPoint() const
     879             : {
     880         164 :     bool bVaryColorsByPoint = false;
     881         164 :     Reference< beans::XPropertySet > xSeriesProp( this->getPropertiesOfSeries() );
     882         164 :     if( xSeriesProp.is() )
     883         164 :         xSeriesProp->getPropertyValue( C2U("VaryColorsByPoint") ) >>= bVaryColorsByPoint;
     884         164 :     return bVaryColorsByPoint;
     885             : }
     886             : 
     887        1107 : uno::Reference< beans::XPropertySet > VDataSeries::getPropertiesOfPoint( sal_Int32 index ) const
     888             : {
     889        1107 :     if( isAttributedDataPoint( index ) )
     890           0 :         return m_xDataSeries->getDataPointByIndex(index);
     891        1107 :     return this->getPropertiesOfSeries();
     892             : }
     893             : 
     894        1394 : uno::Reference< beans::XPropertySet > VDataSeries::getPropertiesOfSeries() const
     895             : {
     896        1394 :     return  uno::Reference<beans::XPropertySet>(m_xDataSeries, uno::UNO_QUERY );
     897             : }
     898             : 
     899             : SAL_WNODEPRECATED_DECLARATIONS_PUSH
     900         123 : ::std::auto_ptr< DataPointLabel > getDataPointLabelFromPropertySet(
     901             :         const uno::Reference< beans::XPropertySet >& xProp )
     902             : {
     903         123 :     ::std::auto_ptr< DataPointLabel > apLabel( new DataPointLabel() );
     904             :     try
     905             :     {
     906         123 :         if( !(xProp->getPropertyValue( C2U( "Label" ) ) >>= *apLabel) )
     907           0 :             apLabel.reset();
     908             :     }
     909           0 :     catch(const uno::Exception &e)
     910             :     {
     911             :         ASSERT_EXCEPTION( e );
     912             :     }
     913         123 :     return apLabel;
     914             : }
     915             : SAL_WNODEPRECATED_DECLARATIONS_POP
     916             : 
     917           0 : void VDataSeries::adaptPointCache( sal_Int32 nNewPointIndex ) const
     918             : {
     919           0 :     if( m_nCurrentAttributedPoint != nNewPointIndex )
     920             :     {
     921           0 :         m_apLabel_AttributedPoint.reset();
     922           0 :         m_apLabelPropNames_AttributedPoint.reset();
     923           0 :         m_apLabelPropValues_AttributedPoint.reset();
     924           0 :         m_apSymbolProperties_AttributedPoint.reset();
     925           0 :         m_nCurrentAttributedPoint = nNewPointIndex;
     926             :     }
     927           0 : }
     928             : 
     929         492 : DataPointLabel* VDataSeries::getDataPointLabel( sal_Int32 index ) const
     930             : {
     931         492 :     DataPointLabel* pRet = NULL;
     932         492 :     if( isAttributedDataPoint( index ) )
     933             :     {
     934           0 :         adaptPointCache( index );
     935           0 :         if( !m_apLabel_AttributedPoint.get() )
     936           0 :             m_apLabel_AttributedPoint = getDataPointLabelFromPropertySet( this->getPropertiesOfPoint( index ) );
     937           0 :         pRet = m_apLabel_AttributedPoint.get();
     938             :     }
     939             :     else
     940             :     {
     941         492 :         if(!m_apLabel_Series.get())
     942         123 :             m_apLabel_Series = getDataPointLabelFromPropertySet( this->getPropertiesOfPoint( index ) );
     943         492 :         pRet = m_apLabel_Series.get();
     944             :     }
     945         492 :     if( !m_bAllowPercentValueInDataLabel )
     946             :     {
     947           0 :         if( pRet )
     948           0 :             pRet->ShowNumberInPercent = false;
     949             :     }
     950         492 :     return pRet;
     951             : }
     952             : 
     953         492 : DataPointLabel* VDataSeries::getDataPointLabelIfLabel( sal_Int32 index ) const
     954             : {
     955         492 :     DataPointLabel* pLabel = this->getDataPointLabel( index );
     956         984 :     if( !pLabel || (!pLabel->ShowNumber && !pLabel->ShowNumberInPercent
     957         492 :         && !pLabel->ShowCategoryName ) )
     958         492 :         return 0;
     959           0 :     return pLabel;
     960             : }
     961             : 
     962           0 : bool VDataSeries::getTextLabelMultiPropertyLists( sal_Int32 index
     963             :     , tNameSequence*& pPropNames
     964             :     , tAnySequence*& pPropValues ) const
     965             : {
     966           0 :     pPropNames = NULL; pPropValues = NULL;
     967           0 :     uno::Reference< beans::XPropertySet > xTextProp;
     968           0 :     bool bDoDynamicFontResize = false;
     969           0 :     if( isAttributedDataPoint( index ) )
     970             :     {
     971           0 :         adaptPointCache( index );
     972           0 :         if(!m_apLabelPropValues_AttributedPoint.get())
     973             :         {
     974           0 :             pPropNames = new tNameSequence();
     975           0 :             pPropValues = new tAnySequence();
     976           0 :             xTextProp.set( this->getPropertiesOfPoint( index ));
     977           0 :             PropertyMapper::getTextLabelMultiPropertyLists( xTextProp, *pPropNames, *pPropValues );
     978             :             SAL_WNODEPRECATED_DECLARATIONS_PUSH
     979           0 :             m_apLabelPropNames_AttributedPoint = ::std::auto_ptr< tNameSequence >(pPropNames);
     980           0 :             m_apLabelPropValues_AttributedPoint = ::std::auto_ptr< tAnySequence >(pPropValues);
     981             :             SAL_WNODEPRECATED_DECLARATIONS_POP
     982           0 :             bDoDynamicFontResize = true;
     983             :         }
     984           0 :         pPropNames = m_apLabelPropNames_AttributedPoint.get();
     985           0 :         pPropValues = m_apLabelPropValues_AttributedPoint.get();
     986             :     }
     987             :     else
     988             :     {
     989           0 :         if(!m_apLabelPropValues_Series.get())
     990             :         {
     991           0 :             pPropNames = new tNameSequence();
     992           0 :             pPropValues = new tAnySequence();
     993           0 :             xTextProp.set( this->getPropertiesOfPoint( index ));
     994           0 :             PropertyMapper::getTextLabelMultiPropertyLists( xTextProp, *pPropNames, *pPropValues );
     995             :             SAL_WNODEPRECATED_DECLARATIONS_PUSH
     996           0 :             m_apLabelPropNames_Series = ::std::auto_ptr< tNameSequence >(pPropNames);
     997           0 :             m_apLabelPropValues_Series = ::std::auto_ptr< tAnySequence >(pPropValues);
     998             :             SAL_WNODEPRECATED_DECLARATIONS_POP
     999           0 :             bDoDynamicFontResize = true;
    1000             :         }
    1001           0 :         pPropNames = m_apLabelPropNames_Series.get();
    1002           0 :         pPropValues = m_apLabelPropValues_Series.get();
    1003             :     }
    1004             : 
    1005           0 :     if( bDoDynamicFontResize &&
    1006             :         pPropNames && pPropValues &&
    1007           0 :         xTextProp.is())
    1008             :     {
    1009           0 :         LabelPositionHelper::doDynamicFontResize( *pPropValues, *pPropNames, xTextProp, m_aReferenceSize );
    1010             :     }
    1011           0 :     if(pPropNames&&pPropValues)
    1012           0 :         return true;
    1013           0 :     return false;
    1014             : }
    1015             : 
    1016         123 : void VDataSeries::setMissingValueTreatment( sal_Int32 nMissingValueTreatment )
    1017             : {
    1018         123 :     m_nMissingValueTreatment = nMissingValueTreatment;
    1019         123 : }
    1020             : 
    1021        3936 : sal_Int32 VDataSeries::getMissingValueTreatment() const
    1022             : {
    1023        3936 :     return m_nMissingValueTreatment;
    1024             : }
    1025             : 
    1026             : //.............................................................................
    1027             : } //namespace chart
    1028             : //.............................................................................
    1029             : 
    1030             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10