Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This Source Code Form is subject to the terms of the Mozilla Public
4 : * License, v. 2.0. If a copy of the MPL was not distributed with this
5 : * file, You can obtain one at http://mozilla.org/MPL/2.0/.
6 : */
7 :
8 : /* "This product is not manufactured, approved, or supported by
9 : * Corel Corporation or Corel Corporation Limited."
10 : */
11 :
12 : #include "InternalHandler.hxx"
13 :
14 : #include <string.h>
15 :
16 0 : InternalHandler::InternalHandler(std::vector<DocumentElement *> *elements):
17 0 : mpElements(elements)
18 : {
19 0 : }
20 :
21 0 : void InternalHandler::startElement(const char *psName, const WPXPropertyList &xPropList)
22 : {
23 0 : TagOpenElement *element = new TagOpenElement(psName);
24 0 : WPXPropertyList::Iter i(xPropList);
25 0 : for (i.rewind(); i.next(); )
26 : {
27 : // filter out libwpd elements
28 0 : if (strncmp(i.key(), "libwpd", 6) != 0)
29 0 : element->addAttribute(i.key(), i()->getStr());
30 : }
31 0 : mpElements->push_back(element);
32 0 : }
33 :
34 0 : void InternalHandler::endElement(const char *psName)
35 : {
36 0 : mpElements->push_back(new TagCloseElement(psName));
37 0 : }
38 :
39 0 : void InternalHandler::characters(const WPXString &sCharacters)
40 : {
41 0 : mpElements->push_back(new CharDataElement(sCharacters.cstr()));
42 0 : }
43 :
44 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|