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;
29
30
32 SvXMLImport& rImport,
33 Element const eElement,
34 bool bOutsideOfParagraph)
35 : SvXMLImportContext(rImport)
36 , m_Element(eElement)
37 , m_bIsOutsideOfParagraph(bOutsideOfParagraph)
38{
39}
40
42{
43}
44
46 sal_Int32 /*nElement*/,
47 const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList )
48{
49 for( auto& aIter : sax_fastparser::castToFastAttributeList(xAttrList) )
50 {
51 switch(aIter.getToken())
52 {
54 {
55 // Id found! Now call RedlineImportHelper
56
57 // prepare parameters
59 GetImport().GetTextImport();
60 OUString sID = aIter.toString();
61
62 // <text:change> is both start and end
64 rHelper->RedlineSetCursor(sID, true, m_bIsOutsideOfParagraph);
66 rHelper->RedlineSetCursor(sID, false, m_bIsOutsideOfParagraph);
67
68 // outside of paragraph and still open? set open redline ID
70 {
71 rHelper->SetOpenRedlineId(sID);
72 }
73 break;
74 }
75 // else: ignore
76 default:
77 XMLOFF_WARN_UNKNOWN("xmloff", aIter);
78 }
79 }
80}
81
82/* 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
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)
TEXT
#define XMLOFF_WARN_UNKNOWN(area, rIter)
Definition: xmlictxt.hxx:114
#define XML_ELEMENT(prefix, name)
Definition: xmlimp.hxx:97