Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /* DocumentElement: The items we are collecting to be put into the Writer
3 : : * document: paragraph and spans of text, as well as section breaks.
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 : :
10 : : #include "DocumentElement.hxx"
11 : : #include "OdfDocumentHandler.hxx"
12 : : #include "FilterInternal.hxx"
13 : : #include <string.h>
14 : :
15 : : #define ASCII_SPACE 0x0020
16 : :
17 : 0 : void TagElement::print() const
18 : : {
19 : : WRITER_DEBUG_MSG(("%s\n", msTagName.cstr()));
20 : 0 : }
21 : :
22 : 0 : void TagOpenElement::write(OdfDocumentHandler *pHandler) const
23 : : {
24 : 0 : pHandler->startElement(getTagName().cstr(), maAttrList);
25 : 0 : }
26 : :
27 : 0 : void TagOpenElement::print() const
28 : : {
29 : 0 : TagElement::print();
30 : 0 : }
31 : :
32 : 0 : void TagOpenElement::addAttribute(const WPXString &szAttributeName, const WPXString &sAttributeValue)
33 : : {
34 : 0 : maAttrList.insert(szAttributeName.cstr(), sAttributeValue);
35 : 0 : }
36 : :
37 : 0 : void TagCloseElement::write(OdfDocumentHandler *pHandler) const
38 : : {
39 : : WRITER_DEBUG_MSG(("TagCloseElement: write (%s)\n", getTagName().cstr()));
40 : :
41 : 0 : pHandler->endElement(getTagName().cstr());
42 : 0 : }
43 : :
44 : 0 : void CharDataElement::write(OdfDocumentHandler *pHandler) const
45 : : {
46 : : WRITER_DEBUG_MSG(("TextElement: write\n"));
47 : 0 : pHandler->characters(msData);
48 : 0 : }
49 : :
50 : 0 : void TextElement::write(OdfDocumentHandler *pHandler) const
51 : : {
52 [ # # ]: 0 : if (msTextBuf.len() <= 0)
53 : 0 : return;
54 : 0 : pHandler->characters(msTextBuf);
55 : : }
56 : :
57 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|