Coverage Report

Created: 2026-02-14 09:37

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/libreoffice/sw/inc/txtatr.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
#ifndef INCLUDED_SW_INC_TXTATR_HXX
20
#define INCLUDED_SW_INC_TXTATR_HXX
21
22
#include "txatbase.hxx"
23
#include "calbck.hxx"
24
25
class SwTextNode;
26
class SwCharFormat;
27
28
namespace sw {
29
    class MetaFieldManager;
30
    class AutoFormatUsedHint;
31
}
32
33
class SwTextCharFormat final : public SwTextAttrEnd
34
{
35
    SwTextNode * m_pTextNode;
36
    sal_uInt16 m_nSortNumber;
37
38
public:
39
    SwTextCharFormat(
40
        const SfxPoolItemHolder& rAttr,
41
        sal_Int32 nStart,
42
        sal_Int32 nEnd );
43
    virtual ~SwTextCharFormat( ) override;
44
45
    void TriggerNodeUpdate(const sw::LegacyModifyHint&);
46
    void TriggerNodeUpdate(const SwFormatChangeHint&);
47
    void TriggerNodeUpdate(const sw::AttrSetChangeHint&);
48
    void TriggerNodeUpdate(const sw::ObjectDyingHint&);
49
50
    // get and set TextNode pointer
51
214k
    void ChgTextNode( SwTextNode* pNew ) { m_pTextNode = pNew; }
52
53
237k
    void SetSortNumber( sal_uInt16 nSortNumber ) { m_nSortNumber = nSortNumber; }
54
5.60M
    sal_uInt16 GetSortNumber() const { return m_nSortNumber; }
55
    void HandleAutoFormatUsedHint(const sw::AutoFormatUsedHint&);
56
};
57
58
59
class SwTextMeta final : public SwTextAttrNesting
60
{
61
private:
62
    SwTextMeta(
63
        const SfxPoolItemHolder& rAttr,
64
        const sal_Int32 i_nStart,
65
        const sal_Int32 i_nEnd );
66
67
public:
68
    static SwTextMeta * CreateTextMeta(
69
        ::sw::MetaFieldManager & i_rTargetDocManager,
70
        SwTextNode *const i_pTargetTextNode,
71
        const SfxPoolItemHolder& rAttr,
72
        // SwFormatMeta & i_rAttr,
73
        sal_Int32 const i_nStart, sal_Int32 const i_nEnd,
74
        bool const i_bIsCopy);
75
76
    virtual ~SwTextMeta() override;
77
78
    void ChgTextNode(SwTextNode * const pNode);
79
};
80
81
82
class SW_DLLPUBLIC SwTextRuby final: public SwTextAttrNesting, public SvtListener
83
{
84
    SwTextNode* m_pTextNode;
85
    virtual void Notify(const SfxHint&) override;
86
public:
87
    SwTextRuby(
88
        const SfxPoolItemHolder& rAttr,
89
        sal_Int32 nStart,
90
        sal_Int32 nEnd );
91
    virtual ~SwTextRuby() override;
92
93
    SAL_DLLPRIVATE void InitRuby(SwTextNode & rNode);
94
95
    /// Get and set TextNode pointer.
96
    inline const SwTextNode& GetTextNode() const;
97
1.14k
    void ChgTextNode( SwTextNode* pNew ) { m_pTextNode = pNew; }
98
99
          SwCharFormat* GetCharFormat();
100
    const SwCharFormat* GetCharFormat() const
101
1.24k
            { return const_cast<SwTextRuby*>(this)->GetCharFormat(); }
102
};
103
104
inline const SwTextNode& SwTextRuby::GetTextNode() const
105
973
{
106
    assert( m_pTextNode );
107
973
    return *m_pTextNode;
108
973
}
109
110
#endif
111
112
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */