LCOV - code coverage report
Current view: top level - drawinglayer/source/attribute - lineattribute.cxx (source / functions) Hit Total Coverage
Test: commit e02a6cb2c3e2b23b203b422e4e0680877f232636 Lines: 0 42 0.0 %
Date: 2014-04-14 Functions: 0 20 0.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 <drawinglayer/attribute/lineattribute.hxx>
      21             : #include <basegfx/color/bcolor.hxx>
      22             : #include <rtl/instance.hxx>
      23             : 
      24             : 
      25             : 
      26             : namespace drawinglayer
      27             : {
      28             :     namespace attribute
      29             :     {
      30           0 :         class ImpLineAttribute
      31             :         {
      32             :         public:
      33             :             // data definitions
      34             :             basegfx::BColor                         maColor;                // color
      35             :             double                                  mfWidth;                // absolute line width
      36             :             basegfx::B2DLineJoin                    meLineJoin;             // type of LineJoin
      37             :             com::sun::star::drawing::LineCap        meLineCap;              // BUTT, ROUND, or SQUARE
      38             : 
      39           0 :             ImpLineAttribute(
      40             :                 const basegfx::BColor& rColor,
      41             :                 double fWidth,
      42             :                 basegfx::B2DLineJoin aB2DLineJoin,
      43             :                 com::sun::star::drawing::LineCap aLineCap)
      44             :             :   maColor(rColor),
      45             :                 mfWidth(fWidth),
      46             :                 meLineJoin(aB2DLineJoin),
      47           0 :                 meLineCap(aLineCap)
      48             :             {
      49           0 :             }
      50             : 
      51           0 :             ImpLineAttribute()
      52             :             :   maColor(basegfx::BColor()),
      53             :                 mfWidth(0.0),
      54             :                 meLineJoin(basegfx::B2DLINEJOIN_ROUND),
      55           0 :                 meLineCap(com::sun::star::drawing::LineCap_BUTT)
      56             :             {
      57           0 :             }
      58             : 
      59             :             // data read access
      60           0 :             const basegfx::BColor& getColor() const { return maColor; }
      61           0 :             double getWidth() const { return mfWidth; }
      62           0 :             basegfx::B2DLineJoin getLineJoin() const { return meLineJoin; }
      63           0 :             com::sun::star::drawing::LineCap getLineCap() const { return meLineCap; }
      64             : 
      65           0 :             bool operator==(const ImpLineAttribute& rCandidate) const
      66             :             {
      67           0 :                 return (getColor() == rCandidate.getColor()
      68           0 :                     && getWidth() == rCandidate.getWidth()
      69           0 :                     && getLineJoin() == rCandidate.getLineJoin()
      70           0 :                     && getLineCap() == rCandidate.getLineCap());
      71             :             }
      72             :         };
      73             : 
      74             :         namespace
      75             :         {
      76             :             struct theGlobalDefault :
      77             :                 public rtl::Static< LineAttribute::ImplType, theGlobalDefault > {};
      78             :         }
      79             : 
      80           0 :         LineAttribute::LineAttribute(
      81             :             const basegfx::BColor& rColor,
      82             :             double fWidth,
      83             :             basegfx::B2DLineJoin aB2DLineJoin,
      84             :             com::sun::star::drawing::LineCap aLineCap)
      85             :         :   mpLineAttribute(
      86             :                 ImpLineAttribute(
      87             :                     rColor,
      88             :                     fWidth,
      89             :                     aB2DLineJoin,
      90           0 :                     aLineCap))
      91             :         {
      92           0 :         }
      93             : 
      94           0 :         LineAttribute::LineAttribute()
      95           0 :         :   mpLineAttribute(theGlobalDefault::get())
      96             :         {
      97           0 :         }
      98             : 
      99           0 :         LineAttribute::LineAttribute(const LineAttribute& rCandidate)
     100           0 :         :   mpLineAttribute(rCandidate.mpLineAttribute)
     101             :         {
     102           0 :         }
     103             : 
     104           0 :         LineAttribute::~LineAttribute()
     105             :         {
     106           0 :         }
     107             : 
     108           0 :         bool LineAttribute::isDefault() const
     109             :         {
     110           0 :             return mpLineAttribute.same_object(theGlobalDefault::get());
     111             :         }
     112             : 
     113           0 :         LineAttribute& LineAttribute::operator=(const LineAttribute& rCandidate)
     114             :         {
     115           0 :             mpLineAttribute = rCandidate.mpLineAttribute;
     116           0 :             return *this;
     117             :         }
     118             : 
     119           0 :         bool LineAttribute::operator==(const LineAttribute& rCandidate) const
     120             :         {
     121           0 :             return rCandidate.mpLineAttribute == mpLineAttribute;
     122             :         }
     123             : 
     124           0 :         const basegfx::BColor& LineAttribute::getColor() const
     125             :         {
     126           0 :             return mpLineAttribute->getColor();
     127             :         }
     128             : 
     129           0 :         double LineAttribute::getWidth() const
     130             :         {
     131           0 :             return mpLineAttribute->getWidth();
     132             :         }
     133             : 
     134           0 :         basegfx::B2DLineJoin LineAttribute::getLineJoin() const
     135             :         {
     136           0 :             return mpLineAttribute->getLineJoin();
     137             :         }
     138             : 
     139           0 :         com::sun::star::drawing::LineCap LineAttribute::getLineCap() const
     140             :         {
     141           0 :             return mpLineAttribute->getLineCap();
     142             :         }
     143             : 
     144             :     } // end of namespace attribute
     145             : } // end of namespace drawinglayer
     146             : 
     147             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10