29#include "DocumentElement.h"
30#include "DocumentHandler.h"
31#include "FilterInternal.h"
34#define ASCII_SPACE 0x0020
36void TagElement::print() const
38 WRITER_DEBUG_MSG(( "%s\n", msTagName.cstr()));
41void TagOpenElement::write(DocumentHandler &xHandler) const
43 xHandler.startElement(getTagName().cstr(), maAttrList);
46void TagOpenElement::print() const
51void TagOpenElement::addAttribute( const char *szAttributeName, const _SH_String &sAttributeValue)
53 maAttrList.insert(szAttributeName, sAttributeValue);
56void TagCloseElement::write(DocumentHandler &xHandler) const
58 WRITER_DEBUG_MSG(( "TagCloseElement: write (%s)\n", getTagName().cstr()));
60 xHandler.endElement(getTagName().cstr());
63void CharDataElement::write(DocumentHandler &xHandler) const
65 WRITER_DEBUG_MSG(( "TextElement: write\n"));
66 xHandler.characters(msData);
69TextElement::TextElement( const _SH_String & sTextBuf) :
70#ifdef HAVE_LIBWPD_0100
73 msTextBuf(sTextBuf, false)
80void TextElement::write(DocumentHandler &xHandler) const
82 _SH_PropertyList xBlankAttrList;
86 int iNumConsecutiveSpaces = 0;
87 _SH_String::Iter i(msTextBuf);
88 for (i.rewind(); i.next();)
90 if (*(i()) == ASCII_SPACE)
91 iNumConsecutiveSpaces++;
93 iNumConsecutiveSpaces = 0;
95 if (iNumConsecutiveSpaces > 1) {
96 if (sTemp.len() > 0) {
97 xHandler.characters(sTemp);
100 xHandler.startElement( "text:s", xBlankAttrList);
101 xHandler.endElement( "text:s");
107 xHandler.characters(sTemp);
|