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/textcharacterproperties.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
 * 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
#ifndef INCLUDED_OOX_DRAWINGML_TEXTCHARACTERPROPERTIES_HXX
21
#define INCLUDED_OOX_DRAWINGML_TEXTCHARACTERPROPERTIES_HXX
22
23
#include <oox/helper/helper.hxx>
24
#include <oox/helper/propertymap.hxx>
25
#include <oox/drawingml/color.hxx>
26
#include <oox/drawingml/drawingmltypes.hxx>
27
#include <drawingml/textfont.hxx>
28
#include <drawingml/effectproperties.hxx>
29
30
#include <drawingml/fillproperties.hxx>
31
#include <drawingml/lineproperties.hxx>
32
33
namespace oox { class PropertySet; }
34
35
namespace oox::drawingml {
36
37
struct TextCharacterProperties
38
{
39
    PropertyMap         maHyperlinkPropertyMap;
40
    TextFont            maLatinFont;
41
    TextFont            maLatinThemeFont;
42
    TextFont            maAsianFont;
43
    TextFont            maAsianThemeFont;
44
    TextFont            maComplexFont;
45
    TextFont            maComplexThemeFont;
46
    TextFont            maSymbolFont;
47
    model::ComplexColor maUnderlineColor;
48
    model::ComplexColor maHighlightColor;
49
    std::optional< OUString > moLang;
50
    std::optional< sal_Int32 > moHeight;
51
    /// If a font scale has to be applied manually to moHeight.
52
    std::optional< double > moFontScale;
53
    std::optional< sal_Int32 > moSpacing;
54
    std::optional< sal_Int32 > moUnderline;
55
    std::optional< sal_Int32 > moBaseline;
56
    std::optional< sal_Int32 > moStrikeout;
57
    std::optional< sal_Int32 > moCaseMap;
58
    std::optional< bool >    moBold;
59
    std::optional< bool >    moItalic;
60
    std::optional< bool >    moUnderlineLineFollowText;
61
    std::optional< bool >    moUnderlineFillFollowText;
62
    std::optional<LineProperties> moTextOutlineProperties;
63
64
    Color maHighlightOOXColor;
65
    FillProperties      maFillProperties;
66
    /// Set if there was a property set that alters run visually during import
67
    bool mbHasVisualRunProperties;
68
69
    /// Set if there was an empty paragraph property set during import
70
    /// <a:pPr><a:defRPr/></a:pPr>
71
    /// In that case we use the default paragraph properties from the
72
    /// <c:txPr><a:p><a:pPr><a:defRPr>...</a:defRPr>
73
    bool mbHasEmptyParaProperties;
74
    /// For text effect properties in shapes
75
    EffectPropertiesPtr mpEffectPropertiesPtr;
76
77
    std::vector<css::beans::PropertyValue> maTextEffectsProperties;
78
79
    /** Overwrites all members that are explicitly set in rSourceProps. */
80
    void                assignUsed( const TextCharacterProperties& rSourceProps );
81
82
    /** Returns the current character size. If possible the masterstyle should
83
        have been applied before, otherwise the character size can be zero and
84
        the default value is returned. */
85
    float               getCharHeightPoints( float fDefault ) const;
86
87
    /** Writes the properties to the passed property map. */
88
    void                pushToPropMap(
89
                            PropertyMap& rPropMap,
90
                            const ::oox::core::XmlFilterBase& rFilter ) const;
91
92
    /** Writes the properties to the passed property set. */
93
    void                pushToPropSet(
94
                            PropertySet& rPropSet,
95
                            const ::oox::core::XmlFilterBase& rFilter ) const;
96
97
    /** Get effect properties. */
98
105k
    EffectProperties& getEffectProperties() const { return *mpEffectPropertiesPtr; }
99
100
10.9M
    TextCharacterProperties() : mbHasVisualRunProperties(false), mbHasEmptyParaProperties(false), mpEffectPropertiesPtr(std::make_shared<EffectProperties>()) {}
101
};
102
103
104
} // namespace oox::drawingml
105
106
#endif
107
108
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */