LCOV - code coverage report
Current view: top level - chart2/source/model/main - DataSeriesProperties.cxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 17 17 100.0 %
Date: 2012-08-25 Functions: 2 2 100.0 %
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 15 30 50.0 %

           Branch data     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 ::rtl::OUString;
      33                 :            : using ::com::sun::star::beans::Property;
      34                 :            : using ::com::sun::star::uno::Reference;
      35                 :            : 
      36                 :            : namespace chart
      37                 :            : {
      38                 :            : 
      39                 :         14 : void DataSeriesProperties::AddPropertiesToVector(
      40                 :            :     ::std::vector< Property > & rOutProperties )
      41                 :            : {
      42                 :            :     rOutProperties.push_back(
      43                 :            :         Property( C2U( "AttributedDataPoints" ),
      44                 :            :                   PROP_DATASERIES_ATTRIBUTED_DATA_POINTS,
      45         [ +  - ]:         14 :                   ::getCppuType( reinterpret_cast< const uno::Sequence< sal_Int32 > * >(0)),
      46                 :            :                   beans::PropertyAttribute::BOUND
      47 [ +  - ][ +  - ]:         14 :                   | beans::PropertyAttribute::MAYBEVOID ));
      48                 :            : 
      49                 :            :     rOutProperties.push_back(
      50                 :            :         Property( C2U( "StackingDirection" ),
      51                 :            :                   PROP_DATASERIES_STACKING_DIRECTION,
      52         [ +  - ]:         14 :                   ::getCppuType( reinterpret_cast< const chart2::StackingDirection * >(0)),
      53                 :            :                   beans::PropertyAttribute::BOUND
      54 [ +  - ][ +  - ]:         14 :                   | beans::PropertyAttribute::MAYBEDEFAULT ));
      55                 :            : 
      56                 :            :     rOutProperties.push_back(
      57                 :            :         Property( C2U( "VaryColorsByPoint" ),
      58                 :            :                   PROP_DATASERIES_VARY_COLORS_BY_POINT,
      59         [ +  - ]:         14 :                   ::getBooleanCppuType(),
      60                 :            :                   beans::PropertyAttribute::BOUND
      61 [ +  - ][ +  - ]:         14 :                   | beans::PropertyAttribute::MAYBEDEFAULT ));
      62                 :            : 
      63                 :            :     rOutProperties.push_back(
      64                 :            :         Property( C2U( "AttachedAxisIndex" ),
      65                 :            :                   PROP_DATASERIES_ATTACHED_AXIS_INDEX,
      66         [ +  - ]:         14 :                   ::getCppuType( reinterpret_cast< const sal_Int32 * >(0)),
      67                 :            :                   beans::PropertyAttribute::BOUND
      68                 :            :                   | beans::PropertyAttribute::MAYBEVOID
      69 [ +  - ][ +  - ]:         14 :                   | beans::PropertyAttribute::MAYBEDEFAULT ));
      70                 :            : 
      71                 :            :     // add properties of service DataPointProperties
      72                 :         14 :     DataPointProperties::AddPropertiesToVector( rOutProperties );
      73                 :         14 : }
      74                 :            : 
      75                 :         14 : void DataSeriesProperties::AddDefaultsToMap(
      76                 :            :     tPropertyValueMap & rOutMap )
      77                 :            : {
      78         [ +  - ]:         14 :     PropertyHelper::setPropertyValueDefault( rOutMap, PROP_DATASERIES_STACKING_DIRECTION, chart2::StackingDirection_NO_STACKING );
      79         [ +  - ]:         14 :     PropertyHelper::setPropertyValueDefault( rOutMap, PROP_DATASERIES_VARY_COLORS_BY_POINT, false );
      80         [ +  - ]:         14 :     PropertyHelper::setPropertyValueDefault< sal_Int32 >( rOutMap, PROP_DATASERIES_ATTACHED_AXIS_INDEX, 0 );
      81                 :            : 
      82                 :            :     // PROP_DATASERIES_ATTRIBUTED_DATA_POINTS has no default
      83                 :            : 
      84                 :            :     // add properties of service DataPointProperties
      85                 :         14 :      DataPointProperties::AddDefaultsToMap( rOutMap );
      86                 :         14 : }
      87                 :            : 
      88                 :            : }  // namespace chart
      89                 :            : 
      90                 :            : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10