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>
22 #include <xmloff/xmlnamespace.hxx>
23 #include <xmloff/namespacemap.hxx>
24 #include <xmloff/xmltoken.hxx>
25 #include <sal/log.hxx>
26 
27 using ::com::sun::star::uno::Reference;
28 using ::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: */
virtual ~XMLChangeImportContext() override
SvXMLImport & GetImport()
Definition: xmlictxt.hxx:59
bool IsXMLToken(std::u16string_view rString, enum XMLTokenEnum eToken)
compare eToken to the string
Definition: xmltoken.cxx:3485
FastAttributeList & castToFastAttributeList(const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList)
rtl::Reference< XMLTextImportHelper > const & GetTextImport()
Definition: xmlimp.hxx:600
XMLChangeImportContext(SvXMLImport &rImport, Element eElement, bool bIsOutsideOfParagraph)
import a change mark (, , ) Note: a ma...
#define XMLOFF_WARN_UNKNOWN(area, rIter)
Definition: xmlictxt.hxx:113
This class deliberately does not support XWeak, to improve performance when loading large documents...
Definition: xmlictxt.hxx:44
virtual void SAL_CALL startFastElement(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList) override
#define XML_ELEMENT(prefix, name)
Definition: xmlimp.hxx:97
TEXT