nss: upgrade to release 3.73
[LibreOffice.git] / xmloff / source / text / XMLChangeInfoContext.cxx
blobfd51c12f55d56b2834032ac63eafc2e925e68e3e
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #include "XMLChangeInfoContext.hxx"
21 #include "XMLChangedRegionImportContext.hxx"
22 #include <XMLStringBufferImportContext.hxx>
23 #include <com/sun/star/uno/Reference.h>
24 #include <xmloff/xmlnamespace.hxx>
25 #include <xmloff/xmltoken.hxx>
26 #include <xmloff/xmlimp.hxx>
27 #include <sal/log.hxx>
30 using namespace ::xmloff::token;
32 using ::com::sun::star::uno::Reference;
33 using ::com::sun::star::xml::sax::XAttributeList;
36 XMLChangeInfoContext::XMLChangeInfoContext(
37 SvXMLImport& rImport,
38 sal_uInt16 nPrefix,
39 const OUString& rLocalName,
40 XMLChangedRegionImportContext& rPParent,
41 const OUString& rChangeType)
42 : SvXMLImportContext(rImport, nPrefix, rLocalName)
43 , rType(rChangeType)
44 , rChangedRegion(rPParent)
48 XMLChangeInfoContext::~XMLChangeInfoContext()
52 css::uno::Reference< css::xml::sax::XFastContextHandler > XMLChangeInfoContext::createFastChildContext(
53 sal_Int32 nElement,
54 const css::uno::Reference< css::xml::sax::XFastAttributeList >& )
56 SvXMLImportContextRef xContext;
58 switch (nElement)
60 case XML_ELEMENT(DC, XML_CREATOR):
61 xContext = new XMLStringBufferImportContext(GetImport(), sAuthorBuffer);
62 break;
63 case XML_ELEMENT(DC, XML_DATE):
64 xContext = new XMLStringBufferImportContext(GetImport(), sDateTimeBuffer);
65 break;
66 case XML_ELEMENT(TEXT, XML_P):
67 case XML_ELEMENT(LO_EXT, XML_P):
68 xContext = new XMLStringBufferImportContext(GetImport(), sCommentBuffer);
69 break;
70 default:
71 XMLOFF_WARN_UNKNOWN_ELEMENT("xmloff", nElement);
74 return xContext.get();
77 void XMLChangeInfoContext::endFastElement(sal_Int32 )
79 // set values at changed region context
80 rChangedRegion.SetChangeInfo(rType, sAuthorBuffer.makeStringAndClear(),
81 sCommentBuffer.makeStringAndClear(),
82 sDateTimeBuffer.makeStringAndClear());
85 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */