LCOV - code coverage report
Current view: top level - chart2/source/view/main - VLineProperties.cxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 25 33 75.8 %
Date: 2012-08-25 Functions: 3 3 100.0 %
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 25 84 29.8 %

           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                 :            : 
      21                 :            : #include "VLineProperties.hxx"
      22                 :            : #include "macros.hxx"
      23                 :            : #include <com/sun/star/drawing/LineStyle.hpp>
      24                 :            : 
      25                 :            : //.............................................................................
      26                 :            : namespace chart
      27                 :            : {
      28                 :            : //.............................................................................
      29                 :            : using namespace ::com::sun::star;
      30                 :            : 
      31                 :            : //-----------------------------------------------------------------------------
      32                 :            : //-----------------------------------------------------------------------------
      33                 :            : //  get line properties from a propertyset
      34                 :            : //-----------------------------------------------------------------------------
      35                 :            : //-----------------------------------------------------------------------------
      36                 :            : 
      37                 :       7527 : VLineProperties::VLineProperties()
      38                 :            : {
      39         [ +  - ]:       7527 :     this->Color = uno::makeAny( sal_Int32(0x000000) ); //type sal_Int32 UNO_NAME_LINECOLOR
      40         [ +  - ]:       7527 :     this->LineStyle = uno::makeAny( drawing::LineStyle_SOLID ); //type drawing::LineStyle for property UNO_NAME_LINESTYLE
      41         [ +  - ]:       7527 :     this->Transparence = uno::makeAny( sal_Int16(0) );//type sal_Int16 for property UNO_NAME_LINETRANSPARENCE
      42         [ +  - ]:       7527 :     this->Width = uno::makeAny( sal_Int32(0) );//type sal_Int32 for property UNO_NAME_LINEWIDTH
      43                 :       7527 : }
      44                 :            : 
      45                 :       2783 : void VLineProperties::initFromPropertySet( const uno::Reference< beans::XPropertySet >& xProp, bool bUseSeriesPropertyNames )
      46                 :            : {
      47         [ +  - ]:       2783 :     if(xProp.is())
      48                 :            :     {
      49         [ -  + ]:       2783 :         if( bUseSeriesPropertyNames ) try
      50                 :            :         {
      51 [ #  # ][ #  # ]:          0 :             this->Color = xProp->getPropertyValue( C2U( "BorderColor" ) );
                 [ #  # ]
      52 [ #  # ][ #  # ]:          0 :             this->LineStyle = xProp->getPropertyValue( C2U( "BorderStyle" ) );
                 [ #  # ]
      53 [ #  # ][ #  # ]:          0 :             this->Transparence = xProp->getPropertyValue( C2U( "BorderTransparency" ) );
                 [ #  # ]
      54 [ #  # ][ #  # ]:          0 :             this->Width = xProp->getPropertyValue( C2U( "BorderWidth" ) );
                 [ #  # ]
      55 [ #  # ][ #  # ]:          0 :             this->DashName = xProp->getPropertyValue( C2U( "BorderDashName" ) );
         [ #  # ][ #  # ]
      56                 :            :         }
      57                 :          0 :         catch( const uno::Exception& e )
      58                 :            :         {
      59                 :            :             ASSERT_EXCEPTION( e );
      60                 :            :         }
      61                 :            :         else try
      62                 :            :         {
      63 [ +  - ][ +  - ]:       2783 :             this->Color = xProp->getPropertyValue( C2U( "LineColor" ) );
                 [ +  - ]
      64 [ +  - ][ +  - ]:       2783 :             this->LineStyle = xProp->getPropertyValue( C2U( "LineStyle" ) );
                 [ +  - ]
      65 [ +  - ][ +  - ]:       2783 :             this->Transparence = xProp->getPropertyValue( C2U( "LineTransparence" ) );
                 [ +  - ]
      66 [ +  - ][ +  - ]:       2783 :             this->Width = xProp->getPropertyValue( C2U( "LineWidth" ) );
                 [ +  - ]
      67 [ +  - ][ +  - ]:       2783 :             this->DashName = xProp->getPropertyValue( C2U( "LineDashName" ) );
         [ #  # ][ +  - ]
      68                 :            :         }
      69                 :          0 :         catch( const uno::Exception& e )
      70                 :            :         {
      71                 :            :             ASSERT_EXCEPTION( e );
      72                 :            :         }
      73                 :            :     }
      74                 :            :     else
      75         [ #  # ]:          0 :         this->LineStyle = uno::makeAny( drawing::LineStyle_NONE );
      76                 :       2783 : }
      77                 :            : 
      78                 :       3876 : bool VLineProperties::isLineVisible() const
      79                 :            : {
      80                 :       3876 :     bool bRet = false;
      81                 :            : 
      82                 :       3876 :     drawing::LineStyle aLineStyle(drawing::LineStyle_SOLID);
      83         [ +  - ]:       3876 :     this->LineStyle >>= aLineStyle;
      84         [ +  + ]:       3876 :     if( aLineStyle != drawing::LineStyle_NONE )
      85                 :            :     {
      86                 :        761 :         sal_Int16 nLineTransparence=0;
      87                 :        761 :         this->Transparence >>= nLineTransparence;
      88         [ +  - ]:        761 :         if(100!=nLineTransparence)
      89                 :            :         {
      90                 :        761 :             bRet = true;
      91                 :            :         }
      92                 :            :     }
      93                 :            : 
      94                 :       3876 :     return bRet;
      95                 :            : }
      96                 :            : 
      97                 :            : //.............................................................................
      98                 :            : } //namespace chart
      99                 :            : //.............................................................................
     100                 :            : 
     101                 :            : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10