LCOV - code coverage report
Current view: top level - chart2/source/view/main - VLineProperties.cxx (source / functions) Hit Total Coverage
Test: commit 0e63ca4fde4e446f346e35849c756a30ca294aab Lines: 25 33 75.8 %
Date: 2014-04-11 Functions: 3 3 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 "VLineProperties.hxx"
      21             : #include "macros.hxx"
      22             : #include <com/sun/star/drawing/LineStyle.hpp>
      23             : 
      24             : namespace chart
      25             : {
      26             : using namespace ::com::sun::star;
      27             : 
      28             : //  get line properties from a propertyset
      29             : 
      30        4621 : VLineProperties::VLineProperties()
      31             : {
      32        4621 :     this->Color = uno::makeAny( sal_Int32(0x000000) ); //type sal_Int32 UNO_NAME_LINECOLOR
      33        4621 :     this->LineStyle = uno::makeAny( drawing::LineStyle_SOLID ); //type drawing::LineStyle for property UNO_NAME_LINESTYLE
      34        4621 :     this->Transparence = uno::makeAny( sal_Int16(0) );//type sal_Int16 for property UNO_NAME_LINETRANSPARENCE
      35        4621 :     this->Width = uno::makeAny( sal_Int32(0) );//type sal_Int32 for property UNO_NAME_LINEWIDTH
      36        4621 : }
      37             : 
      38        1776 : void VLineProperties::initFromPropertySet( const uno::Reference< beans::XPropertySet >& xProp, bool bUseSeriesPropertyNames )
      39             : {
      40        1776 :     if(xProp.is())
      41             :     {
      42        1776 :         if( bUseSeriesPropertyNames ) try
      43             :         {
      44           0 :             this->Color = xProp->getPropertyValue( "BorderColor" );
      45           0 :             this->LineStyle = xProp->getPropertyValue( "BorderStyle" );
      46           0 :             this->Transparence = xProp->getPropertyValue( "BorderTransparency" );
      47           0 :             this->Width = xProp->getPropertyValue( "BorderWidth" );
      48           0 :             this->DashName = xProp->getPropertyValue( "BorderDashName" );
      49             :         }
      50           0 :         catch( const uno::Exception& e )
      51             :         {
      52             :             ASSERT_EXCEPTION( e );
      53             :         }
      54             :         else try
      55             :         {
      56        1776 :             this->Color = xProp->getPropertyValue( "LineColor" );
      57        1776 :             this->LineStyle = xProp->getPropertyValue( "LineStyle" );
      58        1776 :             this->Transparence = xProp->getPropertyValue( "LineTransparence" );
      59        1776 :             this->Width = xProp->getPropertyValue( "LineWidth" );
      60        1776 :             this->DashName = xProp->getPropertyValue( "LineDashName" );
      61             :         }
      62           0 :         catch( const uno::Exception& e )
      63             :         {
      64             :             ASSERT_EXCEPTION( e );
      65             :         }
      66             :     }
      67             :     else
      68           0 :         this->LineStyle = uno::makeAny( drawing::LineStyle_NONE );
      69        1776 : }
      70             : 
      71        2430 : bool VLineProperties::isLineVisible() const
      72             : {
      73        2430 :     bool bRet = false;
      74             : 
      75        2430 :     drawing::LineStyle aLineStyle(drawing::LineStyle_SOLID);
      76        2430 :     this->LineStyle >>= aLineStyle;
      77        2430 :     if( aLineStyle != drawing::LineStyle_NONE )
      78             :     {
      79         507 :         sal_Int16 nLineTransparence=0;
      80         507 :         this->Transparence >>= nLineTransparence;
      81         507 :         if(100!=nLineTransparence)
      82             :         {
      83         507 :             bRet = true;
      84             :         }
      85             :     }
      86             : 
      87        2430 :     return bRet;
      88             : }
      89             : 
      90             : } //namespace chart
      91             : 
      92             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10