LCOV - code coverage report
Current view: top level - chart2/source/tools - LineProperties.cxx (source / functions) Hit Total Coverage
Test: commit c8344322a7af75b84dd3ca8f78b05543a976dfd5 Lines: 33 39 84.6 %
Date: 2015-06-13 12:38:46 Functions: 3 4 75.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             : 
      10             : #include "LineProperties.hxx"
      11             : 
      12             : using namespace com::sun::star;
      13             : 
      14          26 : LineProperties::LineProperties():
      15             :     mnLineWidth(0),
      16             :     meLineStyle(drawing::LineStyle_SOLID),
      17             :     maLineColor(0),
      18             :     mnLineTransparence(0),
      19          26 :     meLineJoint(drawing::LineJoint_ROUND)
      20             : {
      21          26 : }
      22             : 
      23           0 : LineProperties::LineProperties(const LineProperties& r):
      24             :     maDashName(r.maDashName),
      25             :     maLineDash(r.maLineDash),
      26             :     mnLineWidth(r.mnLineWidth),
      27             :     meLineStyle(r.meLineStyle),
      28             :     maLineColor(r.maLineColor),
      29             :     mnLineTransparence(r.mnLineTransparence),
      30           0 :     meLineJoint(r.meLineJoint)
      31             : {
      32           0 : }
      33             : 
      34        1515 : uno::Any LineProperties::getPropertyValue(const OUString& rName)
      35             : {
      36        1515 :     uno::Any aRet;
      37        1515 :     if(rName == "LineDashName")
      38             :     {
      39         251 :         aRet <<= maDashName;
      40             :     }
      41        1264 :     else if(rName == "LineDash")
      42             :     {
      43           0 :         aRet <<= maLineDash;
      44             :     }
      45        1264 :     else if(rName == "LineWidth")
      46             :     {
      47         253 :         aRet <<= mnLineWidth;
      48             :     }
      49        1011 :     else if(rName == "LineStyle")
      50             :     {
      51         253 :         aRet = uno::makeAny(meLineStyle);
      52             :     }
      53         758 :     else if(rName == "LineColor")
      54             :     {
      55         254 :         aRet <<= maLineColor;
      56             :     }
      57         504 :     else if(rName == "LineTransparence")
      58             :     {
      59         253 :         aRet <<= mnLineTransparence;
      60             :     }
      61         251 :     else if(rName == "LineJoint")
      62             :     {
      63         251 :         aRet <<= meLineJoint;
      64             :     }
      65        1515 :     return aRet;
      66             : }
      67             : 
      68          85 : void LineProperties::setPropertyValue(const OUString& rName, const uno::Any& rAny)
      69             : {
      70          85 :     if(rName == "LineDashName")
      71             :     {
      72           0 :         rAny >>= maDashName;
      73             :     }
      74          85 :     else if(rName == "LineDash")
      75             :     {
      76           0 :         rAny >>= maLineDash;
      77             :     }
      78          85 :     else if(rName == "LineWidth")
      79             :     {
      80          19 :         rAny >>= mnLineWidth;
      81             :     }
      82          66 :     else if(rName == "LineStyle")
      83             :     {
      84          18 :         rAny >>= meLineStyle;
      85             :     }
      86          48 :     else if(rName == "LineColor")
      87             :     {
      88          18 :         rAny >>= maLineColor;
      89             :     }
      90          30 :     else if(rName == "LineTransparence")
      91             :     {
      92          12 :         rAny >>= mnLineTransparence;
      93             :     }
      94          18 :     else if(rName == "LineJoint")
      95             :     {
      96          12 :         rAny >>= meLineJoint;
      97             :     }
      98          85 : }
      99             : 
     100             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.11