LCOV - code coverage report
Current view: top level - chart2/source/tools - LineProperties.cxx (source / functions) Hit Total Coverage
Test: commit 10e77ab3ff6f4314137acd6e2702a6e5c1ce1fae Lines: 33 39 84.6 %
Date: 2014-11-03 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          50 : LineProperties::LineProperties():
      15             :     mnLineWidth(0),
      16             :     meLineStyle(drawing::LineStyle_SOLID),
      17             :     maLineColor(0),
      18             :     mnLineTransparence(0),
      19          50 :     meLineJoint(drawing::LineJoint_ROUND)
      20             : {
      21          50 : }
      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        2718 : uno::Any LineProperties::getPropertyValue(const OUString& rName)
      35             : {
      36        2718 :     uno::Any aRet;
      37        2718 :     if(rName == "LineDashName")
      38             :     {
      39         450 :         aRet <<= maDashName;
      40             :     }
      41        2268 :     else if(rName == "LineDash")
      42             :     {
      43           0 :         aRet <<= maLineDash;
      44             :     }
      45        2268 :     else if(rName == "LineWidth")
      46             :     {
      47         454 :         aRet <<= mnLineWidth;
      48             :     }
      49        1814 :     else if(rName == "LineStyle")
      50             :     {
      51         454 :         aRet = uno::makeAny(meLineStyle);
      52             :     }
      53        1360 :     else if(rName == "LineColor")
      54             :     {
      55         456 :         aRet <<= maLineColor;
      56             :     }
      57         904 :     else if(rName == "LineTransparence")
      58             :     {
      59         454 :         aRet <<= mnLineTransparence;
      60             :     }
      61         450 :     else if(rName == "LineJoint")
      62             :     {
      63         450 :         aRet <<= meLineJoint;
      64             :     }
      65        2718 :     return aRet;
      66             : }
      67             : 
      68         170 : void LineProperties::setPropertyValue(const OUString& rName, const uno::Any& rAny)
      69             : {
      70         170 :     if(rName == "LineDashName")
      71             :     {
      72           0 :         rAny >>= maDashName;
      73             :     }
      74         170 :     else if(rName == "LineDash")
      75             :     {
      76           0 :         rAny >>= maLineDash;
      77             :     }
      78         170 :     else if(rName == "LineWidth")
      79             :     {
      80          38 :         rAny >>= mnLineWidth;
      81             :     }
      82         132 :     else if(rName == "LineStyle")
      83             :     {
      84          36 :         rAny >>= meLineStyle;
      85             :     }
      86          96 :     else if(rName == "LineColor")
      87             :     {
      88          36 :         rAny >>= maLineColor;
      89             :     }
      90          60 :     else if(rName == "LineTransparence")
      91             :     {
      92          24 :         rAny >>= mnLineTransparence;
      93             :     }
      94          36 :     else if(rName == "LineJoint")
      95             :     {
      96          24 :         rAny >>= meLineJoint;
      97             :     }
      98         170 : }
      99             : 
     100             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10