1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
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/.
14 #include <librevenge/librevenge.h>
16 #include "xmlictxt.hxx"
18 namespace writerperfect::exp
20 /// Handler for <text:p>/<text:h>.
21 class XMLParaContext
: public XMLImportContext
24 XMLParaContext(XMLImport
& rImport
, bool bTopLevel
= false);
26 rtl::Reference
<XMLImportContext
> CreateChildContext(
27 const OUString
& rName
,
28 const css::uno::Reference
<css::xml::sax::XAttributeList
>& /*xAttribs*/) override
;
31 startElement(const OUString
& rName
,
32 const css::uno::Reference
<css::xml::sax::XAttributeList
>& xAttribs
) override
;
33 void SAL_CALL
endElement(const OUString
& rName
) override
;
34 void SAL_CALL
characters(const OUString
& rChars
) override
;
37 OUString m_aStyleName
;
38 /// List of properties spans should inherit from this paragraph.
39 librevenge::RVNGPropertyList m_aTextPropertyList
;
40 /// If the context is a direct child of XMLBodyContentContext.
41 /// Only direct child of XMLBodyContentContext has to handle page span.
45 /// Shared child context factory for paragraph and span contexts.
46 rtl::Reference
<XMLImportContext
>
47 CreateParagraphOrSpanChildContext(XMLImport
& rImport
, const OUString
& rName
,
48 const librevenge::RVNGPropertyList
& rTextPropertyList
);
50 /// Looks for rName in rAutomaticStyles (and failing that, in rNamedStyles) and
51 /// fills rPropertyList based on that.
52 void FillStyles(const OUString
& rName
,
53 std::map
<OUString
, librevenge::RVNGPropertyList
>& rAutomaticStyles
,
54 std::map
<OUString
, librevenge::RVNGPropertyList
>& rNamedStyles
,
55 librevenge::RVNGPropertyList
& rPropertyList
);
57 } // namespace writerperfect::exp
59 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */