LibreOffice Module xmloff (master) 1
XMLChangeImportContext.cxx
Go to the documentation of this file.
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
21#include <xmloff/xmlimp.hxx>
24#include <xmloff/xmltoken.hxx>
25#include <sal/log.hxx>
26
27using ::com::sun::star::uno::Reference;
28using ::com::sun::star::xml::sax::XAttributeList;
31
32
34 SvXMLImport& rImport,
35 Element const eElement,
36 bool bOutsideOfParagraph)
37 : SvXMLImportContext(rImport)
38 , m_Element(eElement)
39 , m_bIsOutsideOfParagraph(bOutsideOfParagraph)
40{
41}
42
44{
45}
46
48 sal_Int32 /*nElement*/,
49 const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList )
50{
51 for( auto& aIter : sax_fastparser::castToFastAttributeList(xAttrList) )
52 {
53 switch(aIter.getToken())
54 {
56 {
57 // Id found! Now call RedlineImportHelper
58
59 // prepare parameters
62 OUString sID = aIter.toString();
63
64 // <text:change> is both start and end
66 rHelper->RedlineSetCursor(sID, true, m_bIsOutsideOfParagraph);
68 rHelper->RedlineSetCursor(sID, false, m_bIsOutsideOfParagraph);
69
70 // outside of paragraph and still open? set open redline ID
72 {
73 rHelper->SetOpenRedlineId(sID);
74 }
75 break;
76 }
77 // else: ignore
78 default:
79 XMLOFF_WARN_UNKNOWN("xmloff", aIter);
80 }
81 }
82}
83
84/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
This class deliberately does not support XWeak, to improve performance when loading large documents.
Definition: xmlictxt.hxx:48
SvXMLImport & GetImport()
Definition: xmlictxt.hxx:60
rtl::Reference< XMLTextImportHelper > const & GetTextImport()
Definition: xmlimp.hxx:602
virtual ~XMLChangeImportContext() override
virtual void SAL_CALL startFastElement(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList) override
XMLChangeImportContext(SvXMLImport &rImport, Element eElement, bool bIsOutsideOfParagraph)
import a change mark (<text:change>, <text:change-start>, <text:change-end>) Note: a <text:change> ma...
FastAttributeList & castToFastAttributeList(const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList)
bool IsXMLToken(std::u16string_view rString, enum XMLTokenEnum eToken)
compare eToken to the string
Definition: xmltoken.cxx:3581
TEXT
#define XMLOFF_WARN_UNKNOWN(area, rIter)
Definition: xmlictxt.hxx:114
#define XML_ELEMENT(prefix, name)
Definition: xmlimp.hxx:98