LCOV - code coverage report
Current view: top level - chart2/source/model/main - DataSeriesProperties.cxx (source / functions) Hit Total Coverage
Test: commit c8344322a7af75b84dd3ca8f78b05543a976dfd5 Lines: 17 17 100.0 %
Date: 2015-06-13 12:38:46 Functions: 2 2 100.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 "DataSeriesProperties.hxx"
      21             : #include "DataPointProperties.hxx"
      22             : #include "DataPoint.hxx"
      23             : #include "macros.hxx"
      24             : #include <com/sun/star/beans/PropertyAttribute.hpp>
      25             : #include <com/sun/star/style/XStyle.hpp>
      26             : #include <com/sun/star/chart2/StackingDirection.hpp>
      27             : 
      28             : #include <algorithm>
      29             : 
      30             : using namespace ::com::sun::star;
      31             : 
      32             : using ::com::sun::star::beans::Property;
      33             : using ::com::sun::star::uno::Reference;
      34             : 
      35             : namespace chart
      36             : {
      37             : 
      38          15 : void DataSeriesProperties::AddPropertiesToVector(
      39             :     ::std::vector< Property > & rOutProperties )
      40             : {
      41             :     rOutProperties.push_back(
      42             :         Property( "AttributedDataPoints",
      43             :                   PROP_DATASERIES_ATTRIBUTED_DATA_POINTS,
      44          15 :                   cppu::UnoType<uno::Sequence< sal_Int32 >>::get(),
      45             :                   beans::PropertyAttribute::BOUND
      46          30 :                   | beans::PropertyAttribute::MAYBEVOID ));
      47             : 
      48             :     rOutProperties.push_back(
      49             :         Property( "StackingDirection",
      50             :                   PROP_DATASERIES_STACKING_DIRECTION,
      51          15 :                   cppu::UnoType<chart2::StackingDirection>::get(),
      52             :                   beans::PropertyAttribute::BOUND
      53          30 :                   | beans::PropertyAttribute::MAYBEDEFAULT ));
      54             : 
      55             :     rOutProperties.push_back(
      56             :         Property( "VaryColorsByPoint",
      57             :                   PROP_DATASERIES_VARY_COLORS_BY_POINT,
      58          15 :                   cppu::UnoType<bool>::get(),
      59             :                   beans::PropertyAttribute::BOUND
      60          30 :                   | beans::PropertyAttribute::MAYBEDEFAULT ));
      61             : 
      62             :     rOutProperties.push_back(
      63             :         Property( "AttachedAxisIndex",
      64             :                   PROP_DATASERIES_ATTACHED_AXIS_INDEX,
      65          15 :                   cppu::UnoType<sal_Int32>::get(),
      66             :                   beans::PropertyAttribute::BOUND
      67             :                   | beans::PropertyAttribute::MAYBEVOID
      68          30 :                   | beans::PropertyAttribute::MAYBEDEFAULT ));
      69             : 
      70             :     // add properties of service DataPointProperties
      71          15 :     DataPointProperties::AddPropertiesToVector( rOutProperties );
      72          15 : }
      73             : 
      74          16 : void DataSeriesProperties::AddDefaultsToMap(
      75             :     tPropertyValueMap & rOutMap )
      76             : {
      77          16 :     PropertyHelper::setPropertyValueDefault( rOutMap, PROP_DATASERIES_STACKING_DIRECTION, chart2::StackingDirection_NO_STACKING );
      78          16 :     PropertyHelper::setPropertyValueDefault( rOutMap, PROP_DATASERIES_VARY_COLORS_BY_POINT, false );
      79          16 :     PropertyHelper::setPropertyValueDefault< sal_Int32 >( rOutMap, PROP_DATASERIES_ATTACHED_AXIS_INDEX, 0 );
      80             : 
      81             :     // PROP_DATASERIES_ATTRIBUTED_DATA_POINTS has no default
      82             : 
      83             :     // add properties of service DataPointProperties
      84          16 :      DataPointProperties::AddDefaultsToMap( rOutMap );
      85          16 : }
      86             : 
      87             : }  // namespace chart
      88             : 
      89             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.11