Coverage Report

Created: 2025-07-07 10:01

/src/libreoffice/xmloff/source/text/txtparai.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
#pragma once
20
21
22
#include <com/sun/star/container/XIndexReplace.hpp>
23
#include <com/sun/star/uno/Reference.h>
24
#include <xmloff/xmlictxt.hxx>
25
#include "txthints.hxx"
26
27
namespace com::sun::star {
28
    namespace text {  class XTextRange; }
29
    namespace xml::sax { class XAttributeList; }
30
}
31
32
33.5k
#define CONV_FROM_STAR_BATS 1
33
33.5k
#define CONV_FROM_STAR_MATH 2
34
1.56k
#define CONV_STAR_FONT_FLAGS_VALID 4
35
36
class XMLParaContext : public SvXMLImportContext
37
{
38
    css::uno::Reference < css::text::XTextRange > xStart;
39
    OUString             sStyleName;
40
    OUString             m_sXmlId;
41
    OUString             m_sAbout;
42
    OUString             m_sProperty;
43
    OUString             m_sContent;
44
    OUString             m_sDatatype;
45
    css::uno::Any        m_aMarkerStyleName;
46
    bool                 m_bHaveAbout;
47
    sal_Int8             nOutlineLevel;
48
    std::optional<XMLHints_Impl> m_oHints;
49
    // Lost outline numbering in master document (#i73509#)
50
    bool                 mbOutlineLevelAttrFound;
51
    bool                 mbOutlineContentVisible;
52
    bool                 bIgnoreLeadingSpace;
53
    bool                 bHeading;
54
    bool                 bIsListHeader;
55
    bool                 bIsRestart;
56
    sal_Int16            nStartValue;
57
    sal_uInt8            nStarFontsConvFlags;
58
59
public:
60
61
62
    XMLParaContext( SvXMLImport& rImport,
63
            sal_Int32 nElement,
64
            const css::uno::Reference< css::xml::sax::XFastAttributeList > & xAttrList );
65
66
    virtual void SAL_CALL endFastElement(sal_Int32 nElement) override;
67
68
    virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(
69
        sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList >& AttrList ) override;
70
71
    virtual void SAL_CALL characters( const OUString& rChars ) override;
72
73
};
74
75
class XMLNumberedParaContext : public SvXMLImportContext
76
{
77
    /// text:list-level MINUS 1
78
    sal_Int16 m_Level;
79
    /// text:start-value
80
    sal_Int16 m_StartValue;
81
    /// text:list-id
82
    OUString m_ListId;
83
    /// text:style-name
84
    css::uno::Reference< css::container::XIndexReplace > m_xNumRules;
85
86
public:
87
88
89
    XMLNumberedParaContext( SvXMLImport& i_rImport,
90
            sal_Int32 nElement,
91
            const css::uno::Reference< css::xml::sax::XFastAttributeList > & i_xAttrList );
92
93
    virtual void SAL_CALL endFastElement(sal_Int32 nElement) override;
94
95
    virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(
96
        sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList >& AttrList ) override;
97
98
74.1k
    sal_Int16 GetLevel() const { return m_Level; }
99
    const css::uno::Reference< css::container::XIndexReplace >& GetNumRules() const
100
74.1k
        { return m_xNumRules; }
101
74.1k
    const OUString& GetListId() const { return m_ListId; }
102
74.1k
    sal_Int16 GetStartValue() const { return m_StartValue; }
103
104
};
105
106
class XMLHints_Impl;
107
class XMLStyleHint_Impl;
108
109
class XMLImpSpanContext_Impl : public SvXMLImportContext
110
{
111
    XMLHints_Impl&      m_rHints;
112
    XMLStyleHint_Impl   *pHint;
113
114
    bool&                rIgnoreLeadingSpace;
115
116
    sal_uInt8            nStarFontsConvFlags;
117
118
public:
119
120
121
    XMLImpSpanContext_Impl(
122
            SvXMLImport& rImport,
123
            sal_Int32 nElement,
124
            const css::uno::Reference< css::xml::sax::XFastAttributeList > & xAttrList,
125
            XMLHints_Impl& rHints,
126
            bool& rIgnLeadSpace,
127
            sal_uInt8 nSFConvFlags
128
                          );
129
130
    static css::uno::Reference< css::xml::sax::XFastContextHandler > CreateSpanContext(
131
            SvXMLImport& rImport,
132
            sal_Int32 nElement,
133
            const css::uno::Reference< css::xml::sax::XFastAttributeList > & xAttrList,
134
            XMLHints_Impl& rHints,
135
            bool& rIgnLeadSpace,
136
            sal_uInt8 nStarFontsConvFlags = 0
137
             );
138
139
    virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(
140
        sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList >& AttrList ) override;
141
142
    virtual void SAL_CALL endFastElement( sal_Int32 nElement ) override;
143
    virtual void SAL_CALL characters( const OUString& rChars ) override;
144
};
145
146
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */