LCOV - code coverage report
Current view: top level - drawinglayer/source/attribute - sdrshadowattribute.cxx (source / functions) Hit Total Coverage
Test: commit 10e77ab3ff6f4314137acd6e2702a6e5c1ce1fae Lines: 38 38 100.0 %
Date: 2014-11-03 Functions: 18 18 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 <drawinglayer/attribute/sdrshadowattribute.hxx>
      21             : #include <basegfx/vector/b2dvector.hxx>
      22             : #include <basegfx/color/bcolor.hxx>
      23             : #include <rtl/instance.hxx>
      24             : 
      25             : 
      26             : 
      27             : namespace drawinglayer
      28             : {
      29             :     namespace attribute
      30             :     {
      31        1750 :         class ImpSdrShadowAttribute
      32             :         {
      33             :         public:
      34             :             // shadow definitions
      35             :             basegfx::B2DVector                  maOffset;                   // shadow offset 1/100th mm
      36             :             double                              mfTransparence;             // [0.0 .. 1.0], 0.0==no transp.
      37             :             basegfx::BColor                     maColor;                    // color of shadow
      38             : 
      39         552 :             ImpSdrShadowAttribute(
      40             :                 const basegfx::B2DVector& rOffset,
      41             :                 double fTransparence,
      42             :                 const basegfx::BColor& rColor)
      43             :             :   maOffset(rOffset),
      44             :                 mfTransparence(fTransparence),
      45         552 :                 maColor(rColor)
      46             :             {
      47         552 :             }
      48             : 
      49         100 :             ImpSdrShadowAttribute()
      50             :             :   maOffset(basegfx::B2DVector()),
      51             :                 mfTransparence(0.0),
      52         100 :                 maColor(basegfx::BColor())
      53             :             {
      54         100 :             }
      55             : 
      56             :             // data read access
      57        1428 :             const basegfx::B2DVector& getOffset() const { return maOffset; }
      58        1154 :             double getTransparence() const { return mfTransparence; }
      59         948 :             const basegfx::BColor& getColor() const { return maColor; }
      60             : 
      61         234 :             bool operator==(const ImpSdrShadowAttribute& rCandidate) const
      62             :             {
      63         234 :                 return (getOffset() == rCandidate.getOffset()
      64         234 :                     && getTransparence() == rCandidate.getTransparence()
      65         468 :                     && getColor() == rCandidate.getColor());
      66             :             }
      67             :         };
      68             : 
      69             :         namespace
      70             :         {
      71             :             struct theGlobalDefault :
      72             :                 public rtl::Static< SdrShadowAttribute::ImplType, theGlobalDefault > {};
      73             :         }
      74             : 
      75             : 
      76         552 :         SdrShadowAttribute::SdrShadowAttribute(
      77             :             const basegfx::B2DVector& rOffset,
      78             :             double fTransparence,
      79             :             const basegfx::BColor& rColor)
      80             :         :   mpSdrShadowAttribute(ImpSdrShadowAttribute(
      81         552 :                 rOffset, fTransparence, rColor))
      82             :         {
      83         552 :         }
      84             : 
      85      147478 :         SdrShadowAttribute::SdrShadowAttribute()
      86      147478 :         :   mpSdrShadowAttribute(theGlobalDefault::get())
      87             :         {
      88      147478 :         }
      89             : 
      90      151569 :         SdrShadowAttribute::SdrShadowAttribute(const SdrShadowAttribute& rCandidate)
      91      151569 :         :   mpSdrShadowAttribute(rCandidate.mpSdrShadowAttribute)
      92             :         {
      93      151569 :         }
      94             : 
      95      298658 :         SdrShadowAttribute::~SdrShadowAttribute()
      96             :         {
      97      298658 :         }
      98             : 
      99       46764 :         bool SdrShadowAttribute::isDefault() const
     100             :         {
     101       46764 :             return mpSdrShadowAttribute.same_object(theGlobalDefault::get());
     102             :         }
     103             : 
     104       61232 :         SdrShadowAttribute& SdrShadowAttribute::operator=(const SdrShadowAttribute& rCandidate)
     105             :         {
     106       61232 :             mpSdrShadowAttribute = rCandidate.mpSdrShadowAttribute;
     107       61232 :             return *this;
     108             :         }
     109             : 
     110       54413 :         bool SdrShadowAttribute::operator==(const SdrShadowAttribute& rCandidate) const
     111             :         {
     112       54413 :             return mpSdrShadowAttribute == rCandidate.mpSdrShadowAttribute;
     113             :         }
     114             : 
     115         960 :         const basegfx::B2DVector& SdrShadowAttribute::getOffset() const
     116             :         {
     117         960 :             return mpSdrShadowAttribute->getOffset();
     118             :         }
     119             : 
     120         686 :         double SdrShadowAttribute::getTransparence() const
     121             :         {
     122         686 :             return mpSdrShadowAttribute->getTransparence();
     123             :         }
     124             : 
     125         480 :         const basegfx::BColor& SdrShadowAttribute::getColor() const
     126             :         {
     127         480 :             return mpSdrShadowAttribute->getColor();
     128             :         }
     129             :     } // end of namespace attribute
     130             : } // end of namespace drawinglayer
     131             : 
     132             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10