LCOV - code coverage report
Current view: top level - libreoffice/oox/source/drawingml - effectproperties.cxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 21 21 100.0 %
Date: 2012-12-27 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-baosic-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          42 : void EffectShadowProperties::assignUsed(const EffectShadowProperties& rSourceProps)
      24             : {
      25          42 :     moShadowDist.assignIfUsed( rSourceProps.moShadowDist );
      26          42 :     moShadowDir.assignIfUsed( rSourceProps.moShadowDir );
      27          42 :     moShadowColor.assignIfUsed( rSourceProps.moShadowColor );
      28          42 : }
      29             : 
      30          42 : void EffectProperties::assignUsed( const EffectProperties& rSourceProps )
      31             : {
      32          42 :     maShadow.assignUsed(rSourceProps.maShadow);
      33          42 : }
      34             : 
      35          42 : void EffectProperties::pushToPropMap( PropertyMap& rPropMap,
      36             :         const GraphicHelper& rGraphicHelper ) const
      37             : {
      38          42 :     if (maShadow.moShadowDist.has())
      39             :     {
      40             :         // Negative X or Y dist indicates left or up, respectively
      41           6 :         double nAngle = (maShadow.moShadowDir.get(0) / PER_DEGREE) * F_PI180;
      42           6 :         sal_Int32 nDist = convertEmuToHmm(maShadow.moShadowDist.get(0));
      43           6 :         sal_Int32 nXDist = cos(nAngle) * nDist;
      44           6 :         sal_Int32 nYDist = sin(nAngle) * nDist;
      45             : 
      46           6 :         rPropMap.setProperty( PROP_Shadow, sal_True );
      47           6 :         rPropMap.setProperty( PROP_ShadowXDistance, nXDist);
      48           6 :         rPropMap.setProperty( PROP_ShadowYDistance, nYDist);
      49           6 :         rPropMap.setProperty( PROP_ShadowColor, maShadow.moShadowColor.getColor(rGraphicHelper, -1 ) );
      50           6 :         rPropMap.setProperty( PROP_ShadowTransparence, maShadow.moShadowColor.getTransparency());
      51             :     }
      52          42 : }
      53             : 
      54             : // ============================================================================
      55             : 
      56             : } // namespace drawingml
      57          51 : } // namespace oox
      58             : 
      59             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10