Coverage Report

Created: 2026-11-06 11:29

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/libreoffice/writerperfect/source/writer/exp/xmltext.cxx
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
10
#include "xmltext.hxx"
11
12
#include "txtparai.hxx"
13
#include "xmltbli.hxx"
14
#include "XMLSectionContext.hxx"
15
#include "XMLTextListContext.hxx"
16
#include "xmlimp.hxx"
17
18
using namespace com::sun::star;
19
20
namespace writerperfect::exp
21
{
22
XMLBodyContentContext::XMLBodyContentContext(XMLImport& rImport)
23
0
    : XMLImportContext(rImport)
24
0
{
25
0
}
26
27
void XMLBodyContentContext::endElement(const OUString& /*rName*/)
28
0
{
29
0
    if (GetImport().GetIsInPageSpan())
30
0
        GetImport().GetGenerator().closePageSpan();
31
0
}
32
33
rtl::Reference<XMLImportContext> XMLBodyContentContext::CreateChildContext(
34
    const OUString& rName, const css::uno::Reference<css::xml::sax::XAttributeList>& /*xAttribs*/)
35
0
{
36
0
    return CreateTextChildContext(GetImport(), rName, true);
37
0
}
38
39
rtl::Reference<XMLImportContext> CreateTextChildContext(XMLImport& rImport,
40
                                                        std::u16string_view rName, bool bTopLevel)
41
0
{
42
0
    if (rName == u"text:p" || rName == u"text:h")
43
0
        return new XMLParaContext(rImport, bTopLevel);
44
0
    if (rName == u"text:section")
45
0
        return new XMLSectionContext(rImport);
46
0
    if (rName == u"table:table")
47
0
        return new XMLTableContext(rImport, bTopLevel);
48
0
    if (rName == u"text:list")
49
0
        return new XMLTextListContext(rImport);
50
0
    return nullptr;
51
0
}
52
53
} // namespace writerperfect::exp
54
55
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */