bump product version to 4.1.6.2
[LibreOffice.git] / oox / source / drawingml / effectproperties.cxx
blob799169bf0f5486c8b517b1662cd9cdc6b91aab5f
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-baosic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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 */
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"
16 #include <basegfx/numeric/ftools.hxx>
18 namespace oox {
19 namespace drawingml {
21 // ============================================================================
23 void EffectShadowProperties::assignUsed(const EffectShadowProperties& rSourceProps)
25 moShadowDist.assignIfUsed( rSourceProps.moShadowDist );
26 moShadowDir.assignIfUsed( rSourceProps.moShadowDir );
27 moShadowColor.assignIfUsed( rSourceProps.moShadowColor );
30 void EffectProperties::assignUsed( const EffectProperties& rSourceProps )
32 maShadow.assignUsed(rSourceProps.maShadow);
35 void EffectProperties::pushToPropMap( PropertyMap& rPropMap,
36 const GraphicHelper& rGraphicHelper ) const
38 if (maShadow.moShadowDist.has())
40 // Negative X or Y dist indicates left or up, respectively
41 double nAngle = (maShadow.moShadowDir.get(0) / PER_DEGREE) * F_PI180;
42 sal_Int32 nDist = convertEmuToHmm(maShadow.moShadowDist.get(0));
43 sal_Int32 nXDist = cos(nAngle) * nDist;
44 sal_Int32 nYDist = sin(nAngle) * nDist;
46 rPropMap.setProperty( PROP_Shadow, sal_True );
47 rPropMap.setProperty( PROP_ShadowXDistance, nXDist);
48 rPropMap.setProperty( PROP_ShadowYDistance, nYDist);
49 rPropMap.setProperty( PROP_ShadowColor, maShadow.moShadowColor.getColor(rGraphicHelper, -1 ) );
50 rPropMap.setProperty( PROP_ShadowTransparence, maShadow.moShadowColor.getTransparency());
54 // ============================================================================
56 } // namespace drawingml
57 } // namespace oox
59 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */