1
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
3
* Version: MPL 2.0 / LGPLv2.1+
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
* Major Contributor(s):
10
* Copyright (C) 2002-2004 William Lachance (wrlach@gmail.com)
11
* Copyright (C) 2004-2006 Fridrich Strba (fridrich.strba@bluewin.ch)
13
* For minor contributions see the git repository.
15
* Alternatively, the contents of this file may be used under the terms
16
* of the GNU Lesser General Public License Version 2.1 or later
17
* (LGPLv2.1+), in which case the provisions of the LGPLv2.1+ are
18
* applicable instead of those above.
20
* For further information visit http://libwpd.sourceforge.net
23
#include "DiskDocumentHandler.hxx"
28
#define PUTSTRING(M) gsf_output_puts(mpOutput, M)
29
DiskOdfDocumentHandler::DiskOdfDocumentHandler(GsfOutput *pOutput) :
31
#define PUTSTRING(M) mpOutput->writeString(M)
32
DiskOdfDocumentHandler::DiskOdfDocumentHandler(FemtoZip *pOutput) :
40
void DiskOdfDocumentHandler::startElement(const char *psName, const WPXPropertyList &xPropList)
45
mbIsTagOpened = false;
49
WPXPropertyList::Iter i(xPropList);
50
for (i.rewind(); i.next(); )
52
// filter out libwpd elements
53
if (strncmp(i.key(), "libwpd", 6) != 0)
58
PUTSTRING(i()->getStr().cstr());
64
msOpenedTagName.sprintf("%s", psName);
67
void DiskOdfDocumentHandler::endElement(const char *psName)
71
if( msOpenedTagName == psName )
74
mbIsTagOpened = false;
76
else // should not happen, but handle it
82
mbIsTagOpened = false;
90
mbIsTagOpened = false;
94
void DiskOdfDocumentHandler::characters(const WPXString &sCharacters)
99
mbIsTagOpened = false;
101
WPXString sEscapedCharacters(sCharacters, true);
102
if (sEscapedCharacters.len() > 0)
103
PUTSTRING(sEscapedCharacters.cstr());
106
void DiskOdfDocumentHandler::endDocument()
111
mbIsTagOpened = false;
115
/* vim:set shiftwidth=4 softtabstop=4 noexpandtab: */