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/.
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
;
35 XMLChangeInfoContext::XMLChangeInfoContext(
37 XMLChangedRegionImportContext
& rPParent
,
38 const OUString
& rChangeType
)
39 : SvXMLImportContext(rImport
)
41 , rChangedRegion(rPParent
)
45 XMLChangeInfoContext::~XMLChangeInfoContext()
49 css::uno::Reference
< css::xml::sax::XFastContextHandler
> XMLChangeInfoContext::createFastChildContext(
51 const css::uno::Reference
< css::xml::sax::XFastAttributeList
>& )
53 SvXMLImportContextRef xContext
;
57 case XML_ELEMENT(DC
, XML_CREATOR
):
58 xContext
= new XMLStringBufferImportContext(GetImport(), sAuthorBuffer
);
60 case XML_ELEMENT(DC
, XML_DATE
):
61 xContext
= new XMLStringBufferImportContext(GetImport(), sDateTimeBuffer
);
63 case XML_ELEMENT(LO_EXT
, XML_MOVE_ID
):
64 xContext
= new XMLStringBufferImportContext(GetImport(), sMovedIDBuffer
);
66 case XML_ELEMENT(TEXT
, XML_P
):
67 case XML_ELEMENT(LO_EXT
, XML_P
):
68 xContext
= new XMLStringBufferImportContext(GetImport(), sCommentBuffer
);
71 XMLOFF_WARN_UNKNOWN_ELEMENT("xmloff", nElement
);
77 void XMLChangeInfoContext::endFastElement(sal_Int32
)
79 // set values at changed region context
80 rChangedRegion
.SetChangeInfo(rType
, sAuthorBuffer
.makeStringAndClear(),
81 sCommentBuffer
.makeStringAndClear(), sDateTimeBuffer
,
82 sMovedIDBuffer
.makeStringAndClear());
83 sDateTimeBuffer
.setLength(0);
86 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */