Coverage Report

Created: 2025-11-16 09:57

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/libreoffice/sw/inc/ftninfo.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_FTNINFO_HXX
20
#define INCLUDED_SW_INC_FTNINFO_HXX
21
22
#include <rtl/ustring.hxx>
23
#include "swdllapi.h"
24
#include "calbck.hxx"
25
#include <editeng/numitem.hxx>
26
27
class SwTextFormatColl;
28
class SwPageDesc;
29
class SwCharFormat;
30
class SwDoc;
31
class SwSection;
32
33
class SW_DLLPUBLIC SwEndNoteInfo : public SwClient
34
{
35
    mutable sw::WriterMultiListener m_aDepends;
36
    mutable SwTextFormatColl* m_pTextFormatColl;
37
    mutable SwPageDesc* m_pPageDesc;
38
    mutable std::unique_ptr<SwSection> m_pSwSection;
39
    mutable SwCharFormat* m_pCharFormat;
40
    mutable SwCharFormat* m_pAnchorFormat;
41
    OUString m_sPrefix;
42
    OUString m_sSuffix;
43
protected:
44
    bool        m_bEndNote;
45
    virtual void SwClientNotify( const SwModify&, const SfxHint&) override;
46
47
public:
48
    SvxNumberType m_aFormat;
49
    sal_uInt16    m_nFootnoteOffset;
50
51
    void ChgPageDesc(SwPageDesc* pDesc);
52
    SwPageDesc* GetPageDesc(SwDoc& rDoc) const;
53
    bool KnowsPageDesc() const;
54
    bool DependsOn(const SwPageDesc*) const;
55
56
    SwSection* GetSwSection(SwDoc& rDoc) const;
57
    void ResetSwSection();
58
59
    void SetFootnoteTextColl(SwTextFormatColl& rColl);
60
26.7k
    SwTextFormatColl* GetFootnoteTextColl() const { return m_pTextFormatColl; } // can be 0.
61
62
    SwCharFormat* GetCharFormat(SwDoc &rDoc) const;
63
    void SetCharFormat( SwCharFormat* );
64
65
    SwCharFormat* GetAnchorCharFormat(SwDoc &rDoc) const;
66
    void SetAnchorCharFormat(SwCharFormat*);
67
    SwCharFormat* GetCurrentCharFormat(const bool bAnchor) const;
68
69
    SwEndNoteInfo & operator=(const SwEndNoteInfo&);
70
    bool operator==( const SwEndNoteInfo &rInf ) const;
71
72
    SwEndNoteInfo();
73
    SwEndNoteInfo(const SwEndNoteInfo&);
74
75
8.65k
    const OUString& GetPrefix() const  { return m_sPrefix; }
76
7.03k
    const OUString& GetSuffix() const  { return m_sSuffix; }
77
78
3.93k
    void SetPrefix(const OUString& rSet) { m_sPrefix = rSet; }
79
3.93k
    void SetSuffix(const OUString& rSet) { m_sSuffix = rSet; }
80
    void UpdateFormatOrAttr();
81
};
82
83
enum SwFootnotePos
84
{
85
    // Momentarily only PAGE and CHAPTER. CHAPTER == document-endnotes.
86
    FTNPOS_PAGE = 1,
87
    FTNPOS_CHAPTER = 8
88
};
89
90
enum SwFootnoteNum : unsigned
91
{
92
    FTNNUM_PAGE, FTNNUM_CHAPTER, FTNNUM_DOC
93
};
94
95
class SW_DLLPUBLIC SwFootnoteInfo final : public SwEndNoteInfo
96
{
97
    using SwEndNoteInfo::operator ==;
98
99
public:
100
    OUString  m_aQuoVadis;
101
    OUString  m_aErgoSum;
102
    SwFootnotePos  m_ePos;
103
    SwFootnoteNum  m_eNum;
104
105
    SwFootnoteInfo& operator=(const SwFootnoteInfo&);
106
107
    bool operator==( const SwFootnoteInfo &rInf ) const;
108
109
    SwFootnoteInfo();
110
    SwFootnoteInfo(const SwFootnoteInfo&);
111
112
    ~SwFootnoteInfo() override;
113
};
114
115
#endif
116
117
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */