LCOV - code coverage report
Current view: top level - oox/source/drawingml - effectproperties.cxx (source / functions) Hit Total Coverage
Test: commit 0e63ca4fde4e446f346e35849c756a30ca294aab Lines: 21 21 100.0 %
Date: 2014-04-11 Functions: 5 5 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             : 
      10             : #include "oox/drawingml/effectproperties.hxx"
      11             : #include "oox/drawingml/drawingmltypes.hxx"
      12             : #include "oox/drawingml/shapepropertymap.hxx"
      13             : #include "oox/helper/graphichelper.hxx"
      14             : #include "oox/token/tokens.hxx"
      15             : 
      16             : #include <basegfx/numeric/ftools.hxx>
      17             : 
      18             : namespace oox {
      19             : namespace drawingml {
      20             : 
      21             : 
      22             : 
      23        1937 : void EffectShadowProperties::assignUsed(const EffectShadowProperties& rSourceProps)
      24             : {
      25        1937 :     moShadowDist.assignIfUsed( rSourceProps.moShadowDist );
      26        1937 :     moShadowDir.assignIfUsed( rSourceProps.moShadowDir );
      27        1937 :     moShadowColor.assignIfUsed( rSourceProps.moShadowColor );
      28        1937 : }
      29             : 
      30        1937 : void EffectProperties::assignUsed( const EffectProperties& rSourceProps )
      31             : {
      32        1937 :     maShadow.assignUsed(rSourceProps.maShadow);
      33        1937 : }
      34             : 
      35        1865 : void EffectProperties::pushToPropMap( PropertyMap& rPropMap,
      36             :         const GraphicHelper& rGraphicHelper ) const
      37             : {
      38        1865 :     if (maShadow.moShadowDist.has())
      39             :     {
      40             :         // Negative X or Y dist indicates left or up, respectively
      41         101 :         double nAngle = (maShadow.moShadowDir.get(0) / PER_DEGREE) * F_PI180;
      42         101 :         sal_Int32 nDist = convertEmuToHmm(maShadow.moShadowDist.get(0));
      43         101 :         sal_Int32 nXDist = cos(nAngle) * nDist;
      44         101 :         sal_Int32 nYDist = sin(nAngle) * nDist;
      45             : 
      46         101 :         rPropMap.setProperty( PROP_Shadow, sal_True );
      47         101 :         rPropMap.setProperty( PROP_ShadowXDistance, nXDist);
      48         101 :         rPropMap.setProperty( PROP_ShadowYDistance, nYDist);
      49         101 :         rPropMap.setProperty( PROP_ShadowColor, maShadow.moShadowColor.getColor(rGraphicHelper, -1 ) );
      50         101 :         rPropMap.setProperty( PROP_ShadowTransparence, maShadow.moShadowColor.getTransparency());
      51             :     }
      52        1865 : }
      53             : 
      54             : 
      55             : 
      56             : } // namespace drawingml
      57         177 : } // namespace oox
      58             : 
      59             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10