Coverage Report

Created: 2026-02-14 09:37

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/libreoffice/oox/inc/drawingml/effectproperties.hxx
Line
Count
Source
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
#pragma once
11
12
#include <oox/drawingml/color.hxx>
13
#include <oox/helper/propertymap.hxx>
14
15
#include <memory>
16
#include <vector>
17
#include <map>
18
19
namespace model
20
{
21
enum class RectangleAlignment;
22
}
23
24
namespace oox::drawingml
25
{
26
struct EffectGlowProperties
27
{
28
    std::optional<sal_Int64> moGlowRad; // size of glow effect
29
    Color moGlowColor;
30
    // TODO saturation and luminance missing
31
32
    void assignUsed(const EffectGlowProperties& rSourceProps);
33
};
34
35
struct EffectSoftEdgeProperties
36
{
37
    std::optional<sal_Int64> moRad; // size of effect
38
39
    void assignUsed(const EffectSoftEdgeProperties& rSourceProps);
40
};
41
42
struct EffectShadowProperties
43
{
44
    std::optional<sal_Int64> moShadowDist;
45
    std::optional<sal_Int64> moShadowDir;
46
    std::optional<sal_Int64> moShadowSx;
47
    std::optional<sal_Int64> moShadowSy;
48
    Color moShadowColor;
49
    std::optional<sal_Int64> moShadowBlur; // size of blur effect
50
    std::optional<model::RectangleAlignment> moShadowAlignment;
51
52
    /** Overwrites all members that are explicitly set in rSourceProps. */
53
    void assignUsed(const EffectShadowProperties& rSourceProps);
54
};
55
56
struct Effect
57
{
58
    OUString msName;
59
    std::map<OUString, css::uno::Any> maAttribs;
60
    Color moColor;
61
62
    css::beans::PropertyValue getEffect();
63
};
64
65
struct EffectProperties
66
{
67
    EffectShadowProperties maShadow;
68
    EffectGlowProperties maGlow;
69
    EffectSoftEdgeProperties maSoftEdge;
70
71
    /** Stores all effect properties, including those not supported by core yet */
72
    std::vector<std::unique_ptr<Effect>> m_Effects;
73
74
11.4M
    EffectProperties() {}
75
20.5k
    EffectProperties(EffectProperties const& rOther) { assignUsed(rOther); }
76
77
    /** Overwrites all members that are explicitly set in rSourceProps. */
78
    void assignUsed(const EffectProperties& rSourceProps);
79
80
    /** Writes the properties to the passed property map. */
81
    void pushToPropMap(PropertyMap& rPropMap, const GraphicHelper& rGraphicHelper) const;
82
};
83
84
} // namespace oox::drawingml
85
86
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */