LCOV - code coverage report
Current view: top level - chart2/source/controller/itemsetwrapper - MultipleChartConverters.cxx (source / functions) Hit Total Coverage
Test: commit e02a6cb2c3e2b23b203b422e4e0680877f232636 Lines: 0 75 0.0 %
Date: 2014-04-14 Functions: 0 20 0.0 %
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 "MultipleChartConverters.hxx"
      21             : 
      22             : #include "chartview/ChartSfxItemIds.hxx"
      23             : #include "SchWhichPairs.hxx"
      24             : #include "AxisItemConverter.hxx"
      25             : #include "StatisticsItemConverter.hxx"
      26             : #include "GraphicPropertyItemConverter.hxx"
      27             : #include "DataPointItemConverter.hxx"
      28             : #include "ChartModelHelper.hxx"
      29             : #include "TitleHelper.hxx"
      30             : #include "TitleItemConverter.hxx"
      31             : #include "AxisHelper.hxx"
      32             : #include "chartview/ExplicitValueProvider.hxx"
      33             : #include "DiagramHelper.hxx"
      34             : 
      35             : using namespace ::com::sun::star;
      36             : using namespace ::com::sun::star::chart2;
      37             : using ::com::sun::star::uno::Reference;
      38             : using ::com::sun::star::uno::Sequence;
      39             : 
      40             : namespace chart
      41             : {
      42             : namespace wrapper
      43             : {
      44             : 
      45             : SAL_WNODEPRECATED_DECLARATIONS_PUSH
      46           0 : AllAxisItemConverter::AllAxisItemConverter(
      47             :     const uno::Reference< frame::XModel > & xChartModel,
      48             :     SfxItemPool& rItemPool,
      49             :     SdrModel& rDrawModel,
      50             :     const uno::Reference< lang::XMultiServiceFactory > & /*xNamedPropertyContainerFactory*/,
      51             :     ::std::auto_ptr< awt::Size > pRefSize )
      52           0 :         : MultipleItemConverter( rItemPool )
      53             : {
      54           0 :     Reference< XDiagram > xDiagram( ChartModelHelper::findDiagram( xChartModel ) );
      55           0 :     Sequence< Reference< XAxis > > aElementList( AxisHelper::getAllAxesOfDiagram( xDiagram ) );
      56           0 :     for( sal_Int32 nA = 0; nA < aElementList.getLength(); nA++ )
      57             :     {
      58           0 :         uno::Reference< beans::XPropertySet > xObjectProperties(aElementList[nA], uno::UNO_QUERY);
      59           0 :         if( pRefSize.get())
      60             :             m_aConverters.push_back( new ::chart::wrapper::AxisItemConverter(
      61             :                                          xObjectProperties, rItemPool, rDrawModel,
      62             :                                          uno::Reference< chart2::XChartDocument >( xChartModel, uno::UNO_QUERY ), 0, 0,
      63           0 :                                          ::std::auto_ptr< awt::Size >( new awt::Size( *pRefSize )) ));
      64             :         else
      65             :             m_aConverters.push_back( new ::chart::wrapper::AxisItemConverter(
      66             :                                          xObjectProperties, rItemPool, rDrawModel,
      67           0 :                                          uno::Reference< chart2::XChartDocument >( xChartModel, uno::UNO_QUERY ), 0, 0 ) );
      68           0 :     }
      69           0 : }
      70             : SAL_WNODEPRECATED_DECLARATIONS_POP
      71             : 
      72           0 : AllAxisItemConverter::~AllAxisItemConverter()
      73             : {
      74           0 : }
      75             : 
      76           0 : const sal_uInt16 * AllAxisItemConverter::GetWhichPairs() const
      77             : {
      78             :     // must span all used items!
      79           0 :     return nAllAxisWhichPairs;
      80             : }
      81             : 
      82           0 : AllGridItemConverter::AllGridItemConverter(
      83             :     const uno::Reference< frame::XModel > & xChartModel,
      84             :     SfxItemPool& rItemPool,
      85             :     SdrModel& rDrawModel,
      86             :     const uno::Reference< lang::XMultiServiceFactory > & xNamedPropertyContainerFactory )
      87           0 :         : MultipleItemConverter( rItemPool )
      88             : {
      89           0 :     Reference< XDiagram > xDiagram( ChartModelHelper::findDiagram( xChartModel ) );
      90           0 :     Sequence< Reference< beans::XPropertySet > > aElementList( AxisHelper::getAllGrids( xDiagram ) );
      91           0 :     for( sal_Int32 nA = 0; nA < aElementList.getLength(); nA++ )
      92             :     {
      93           0 :         Reference< beans::XPropertySet > xObjectProperties(aElementList[nA]);
      94             :         m_aConverters.push_back( new ::chart::wrapper::GraphicPropertyItemConverter(
      95             :                                         xObjectProperties, rItemPool, rDrawModel, xNamedPropertyContainerFactory,
      96           0 :                                         ::chart::wrapper::GraphicPropertyItemConverter::LINE_PROPERTIES ) );
      97           0 :     }
      98           0 : }
      99             : 
     100           0 : AllGridItemConverter::~AllGridItemConverter()
     101             : {
     102           0 : }
     103             : 
     104           0 : const sal_uInt16 * AllGridItemConverter::GetWhichPairs() const
     105             : {
     106             :     // must span all used items!
     107           0 :     return nGridWhichPairs;
     108             : }
     109             : 
     110             : SAL_WNODEPRECATED_DECLARATIONS_PUSH
     111           0 : AllDataLabelItemConverter::AllDataLabelItemConverter(
     112             :     const uno::Reference< frame::XModel > & xChartModel,
     113             :     SfxItemPool& rItemPool,
     114             :     SdrModel& rDrawModel,
     115             :     const uno::Reference< lang::XMultiServiceFactory > & xNamedPropertyContainerFactory,
     116             :     ::std::auto_ptr< awt::Size > pRefSize )
     117           0 :         : MultipleItemConverter( rItemPool )
     118             : {
     119             :     ::std::vector< uno::Reference< chart2::XDataSeries > > aSeriesList(
     120           0 :         ::chart::ChartModelHelper::getDataSeries( xChartModel ));
     121             : 
     122           0 :     ::std::vector< uno::Reference< chart2::XDataSeries > >::const_iterator aIt;
     123           0 :     for( aIt = aSeriesList.begin(); aIt != aSeriesList.end(); ++aIt )
     124             :     {
     125           0 :         uno::Reference< beans::XPropertySet > xObjectProperties( *aIt, uno::UNO_QUERY);
     126           0 :         uno::Reference< uno::XComponentContext> xContext(0);//do not need Context for label properties
     127             : 
     128           0 :         sal_Int32 nNumberFormat=ExplicitValueProvider::getExplicitNumberFormatKeyForDataLabel( xObjectProperties, *aIt, -1/*nPointIndex*/, ChartModelHelper::findDiagram( xChartModel ) );
     129             :         sal_Int32 nPercentNumberFormat=ExplicitValueProvider::getExplicitPercentageNumberFormatKeyForDataLabel(
     130           0 :                 xObjectProperties,uno::Reference< util::XNumberFormatsSupplier >(xChartModel, uno::UNO_QUERY));
     131             : 
     132             :         m_aConverters.push_back( new ::chart::wrapper::DataPointItemConverter(
     133             :                                          xChartModel, xContext,
     134             :                                          xObjectProperties, *aIt, rItemPool, rDrawModel,
     135             :                                          xNamedPropertyContainerFactory,
     136             :                                          GraphicPropertyItemConverter::FILLED_DATA_POINT,
     137           0 :                                          ::std::auto_ptr< awt::Size >( pRefSize.get() ? new awt::Size( *pRefSize ) : 0),
     138             :                                          true, /*bDataSeries*/
     139             :                                          false, /*bUseSpecialFillColor*/
     140             :                                          0, /*nSpecialFillColor*/
     141             :                                          true /*bOverwriteLabelsForAttributedDataPointsAlso*/,
     142             :                                          nNumberFormat, nPercentNumberFormat
     143           0 :                                          ));
     144           0 :     }
     145           0 : }
     146             : SAL_WNODEPRECATED_DECLARATIONS_POP
     147             : 
     148           0 : AllDataLabelItemConverter::~AllDataLabelItemConverter()
     149             : {
     150           0 : }
     151             : 
     152           0 : const sal_uInt16 * AllDataLabelItemConverter::GetWhichPairs() const
     153             : {
     154             :     // must span all used items!
     155           0 :     return nDataLabelWhichPairs;
     156             : }
     157             : 
     158             : SAL_WNODEPRECATED_DECLARATIONS_PUSH
     159           0 : AllTitleItemConverter::AllTitleItemConverter(
     160             :     const uno::Reference< frame::XModel > & xChartModel,
     161             :     SfxItemPool& rItemPool,
     162             :     SdrModel& rDrawModel,
     163             :     const uno::Reference< lang::XMultiServiceFactory > & xNamedPropertyContainerFactory,
     164             :     ::std::auto_ptr< awt::Size > pRefSize )
     165           0 :         : MultipleItemConverter( rItemPool )
     166             : {
     167           0 :     for(sal_Int32 nTitle = TitleHelper::TITLE_BEGIN; nTitle < TitleHelper::NORMAL_TITLE_END; nTitle++ )
     168             :     {
     169           0 :         uno::Reference< chart2::XTitle > xTitle( TitleHelper::getTitle( TitleHelper::eTitleType(nTitle), xChartModel ) );
     170           0 :         if(!xTitle.is())
     171           0 :             continue;
     172           0 :         uno::Reference< beans::XPropertySet > xObjectProperties( xTitle, uno::UNO_QUERY);
     173           0 :         ::std::auto_ptr< awt::Size > pSingleRefSize(0);
     174           0 :         if( pRefSize.get())
     175           0 :             pSingleRefSize = ::std::auto_ptr< awt::Size >( new awt::Size( *pRefSize ));
     176             :         m_aConverters.push_back( new ::chart::wrapper::TitleItemConverter(
     177           0 :                                      xObjectProperties, rItemPool, rDrawModel, xNamedPropertyContainerFactory, pSingleRefSize ));
     178           0 :     }
     179           0 : }
     180             : SAL_WNODEPRECATED_DECLARATIONS_POP
     181             : 
     182           0 : AllTitleItemConverter::~AllTitleItemConverter()
     183             : {
     184           0 : }
     185             : 
     186           0 : const sal_uInt16 * AllTitleItemConverter::GetWhichPairs() const
     187             : {
     188             :     // must span all used items!
     189           0 :     return nTitleWhichPairs;
     190             : }
     191             : 
     192           0 : AllSeriesStatisticsConverter::AllSeriesStatisticsConverter(
     193             :     const uno::Reference< frame::XModel > & xChartModel,
     194             :     SfxItemPool& rItemPool )
     195           0 :         : MultipleItemConverter( rItemPool )
     196             : {
     197             :     ::std::vector< uno::Reference< chart2::XDataSeries > > aSeriesList(
     198           0 :         ::chart::ChartModelHelper::getDataSeries( xChartModel ));
     199             : 
     200           0 :     ::std::vector< uno::Reference< chart2::XDataSeries > >::const_iterator aIt;
     201           0 :     for( aIt = aSeriesList.begin(); aIt != aSeriesList.end(); ++aIt )
     202             :     {
     203           0 :         uno::Reference< beans::XPropertySet > xObjectProperties( *aIt, uno::UNO_QUERY);
     204             :         m_aConverters.push_back( new ::chart::wrapper::StatisticsItemConverter(
     205           0 :                                      xChartModel, xObjectProperties, rItemPool ));
     206           0 :     }
     207           0 : }
     208             : 
     209           0 : AllSeriesStatisticsConverter::~AllSeriesStatisticsConverter()
     210           0 : {}
     211             : 
     212           0 : const sal_uInt16 * AllSeriesStatisticsConverter::GetWhichPairs() const
     213             : {
     214             :     // must span all used items!
     215           0 :     return nStatWhichPairs;
     216             : }
     217             : 
     218             : } //  namespace wrapper
     219             : } //  namespace chart
     220             : 
     221             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10