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

Generated by: LCOV version 1.10