Coverage Report

Created: 2026-06-30 11:14

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/libreoffice/xmloff/source/text/XMLTextNumRuleInfo.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
#pragma once
21
22
#include <com/sun/star/uno/Reference.hxx>
23
#include <com/sun/star/container/XIndexReplace.hpp>
24
#include <sal/types.h>
25
26
namespace com::sun::star {
27
    namespace text { class XTextContent; }
28
}
29
30
class XMLTextListAutoStylePool;
31
32
/** information about list and list style for a certain paragraph
33
34
    OD 2008-04-24 #refactorlists#
35
    Complete refactoring of the class and enhancement of the class for lists.
36
    These changes are considered by method <XMLTextParagraphExport::exportListChange(..)>
37
*/
38
class XMLTextNumRuleInfo
39
{
40
    // numbering rules instance and its name
41
    css::uno::Reference < css::container::XIndexReplace > mxNumRules;
42
    OUString            msNumRulesName;
43
44
    // paragraph's list attributes
45
    OUString            msListId;
46
    /// msListId won't be referenced by later lists.
47
    bool mbListIdIsDefault;
48
    sal_Int16           mnListStartValue;
49
    sal_Int16           mnListLevel;
50
    bool                mbIsNumbered;
51
    bool                mbIsRestart;
52
53
    // numbering rules' attributes
54
    sal_Int16           mnListLevelStartValue;
55
56
    // Written OpenDocument file format doesn't fit to the created text document (#i69627#)
57
    bool                mbOutlineStyleAsNormalListStyle;
58
59
    bool                mbContinueingPreviousSubTree;
60
    OUString            msListLabelString;
61
62
public:
63
64
    XMLTextNumRuleInfo();
65
66
    inline XMLTextNumRuleInfo& operator=( const XMLTextNumRuleInfo& rInfo );
67
68
    void Set( const css::uno::Reference < css::text::XTextContent > & rTextContent,
69
              bool bOutlineStyleAsNormalListStyle,
70
              const XMLTextListAutoStylePool& rListAutoPool,
71
              bool bExportTextNumberElement,
72
              bool bListIdIsDefault );
73
    inline void Reset();
74
75
    const OUString& GetNumRulesName() const
76
0
    {
77
0
        return msNumRulesName;
78
0
    }
79
    sal_Int16 GetListLevelStartValue() const
80
0
    {
81
0
        return mnListLevelStartValue;
82
0
    }
83
84
    const OUString& GetListId() const
85
0
    {
86
0
        return msListId;
87
0
    }
88
89
0
    bool IsListIdDefault() const { return mbListIdIsDefault; }
90
91
    sal_Int16 GetLevel() const
92
42.6k
    {
93
42.6k
        return mnListLevel;
94
42.6k
    }
95
96
    bool HasStartValue() const
97
0
    {
98
0
        return mnListStartValue != -1;
99
0
    }
100
    sal_uInt32 GetStartValue() const
101
0
    {
102
0
        return mnListStartValue;
103
0
    }
104
105
    bool IsNumbered() const
106
0
    {
107
0
        return mbIsNumbered;
108
0
    }
109
    bool IsRestart() const
110
0
    {
111
0
        return mbIsRestart;
112
0
    }
113
114
    bool BelongsToSameList( const XMLTextNumRuleInfo& rCmp ) const;
115
116
    bool IsContinueingPreviousSubTree() const
117
0
    {
118
0
        return mbContinueingPreviousSubTree;
119
0
    }
120
    const OUString& ListLabelString() const
121
0
    {
122
0
        return msListLabelString;
123
0
    }
124
};
125
126
inline XMLTextNumRuleInfo& XMLTextNumRuleInfo::operator=(
127
        const XMLTextNumRuleInfo& rInfo )
128
8.44k
{
129
8.44k
    msNumRulesName = rInfo.msNumRulesName;
130
8.44k
    mxNumRules = rInfo.mxNumRules;
131
8.44k
    msListId = rInfo.msListId;
132
8.44k
    mnListStartValue = rInfo.mnListStartValue;
133
8.44k
    mnListLevel = rInfo.mnListLevel;
134
8.44k
    mbIsNumbered = rInfo.mbIsNumbered;
135
8.44k
    mbIsRestart = rInfo.mbIsRestart;
136
    // Written OpenDocument file format doesn't fit to the created text document (#i69627#)
137
8.44k
    mbOutlineStyleAsNormalListStyle = rInfo.mbOutlineStyleAsNormalListStyle;
138
8.44k
    mbContinueingPreviousSubTree = rInfo.mbContinueingPreviousSubTree;
139
8.44k
    msListLabelString = rInfo.msListLabelString;
140
141
8.44k
    return *this;
142
8.44k
}
143
144
inline void XMLTextNumRuleInfo::Reset()
145
37.2k
{
146
37.2k
    mxNumRules = nullptr;
147
37.2k
    msNumRulesName.clear();
148
37.2k
    msListId.clear();
149
37.2k
    mnListStartValue = -1;
150
37.2k
    mnListLevel = 0;
151
    // Written OpenDocument file format doesn't fit to the created text document (#i69627#)
152
37.2k
    mbIsNumbered = mbIsRestart =
153
37.2k
    mbOutlineStyleAsNormalListStyle = false;
154
37.2k
    mbContinueingPreviousSubTree = false;
155
37.2k
    msListLabelString.clear();
156
37.2k
}
157
158
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */