Kaydet (Commit) e1ffd555 authored tarafından Fridrich Štrba's avatar Fridrich Štrba

simplify writerperfect structure and prepare for libodfgen

Change-Id: Ib2e56280a5a6bfdfee18a5b213dd67b9fbfc8949
üst 51ba7dbe
...@@ -36,19 +36,19 @@ $(eval $(call gb_StaticLibrary_use_api,writerperfect,\ ...@@ -36,19 +36,19 @@ $(eval $(call gb_StaticLibrary_use_api,writerperfect,\
)) ))
$(eval $(call gb_StaticLibrary_add_exception_objects,writerperfect,\ $(eval $(call gb_StaticLibrary_add_exception_objects,writerperfect,\
writerperfect/source/filter/DocumentElement \ writerperfect/source/common/DocumentElement \
writerperfect/source/filter/DocumentHandler \ writerperfect/source/common/DocumentHandler \
writerperfect/source/filter/FilterInternal \ writerperfect/source/common/FilterInternal \
writerperfect/source/filter/FontStyle \ writerperfect/source/common/FontStyle \
writerperfect/source/filter/InternalHandler \ writerperfect/source/common/InternalHandler \
writerperfect/source/filter/ListStyle \ writerperfect/source/common/ListStyle \
writerperfect/source/filter/OdgGenerator \ writerperfect/source/common/OdgGenerator \
writerperfect/source/filter/OdtGenerator \ writerperfect/source/common/OdtGenerator \
writerperfect/source/filter/PageSpan \ writerperfect/source/common/PageSpan \
writerperfect/source/filter/SectionStyle \ writerperfect/source/common/SectionStyle \
writerperfect/source/filter/TableStyle \ writerperfect/source/common/TableStyle \
writerperfect/source/filter/TextRunStyle \ writerperfect/source/common/TextRunStyle \
writerperfect/source/stream/WPXSvStream \ writerperfect/source/common/WPXSvStream \
)) ))
# vim: set noet sw=4 ts=4: # vim: set noet sw=4 ts=4:
...@@ -15,8 +15,6 @@ ...@@ -15,8 +15,6 @@
#include <xmloff/attrlist.hxx> #include <xmloff/attrlist.hxx>
// #define DEBUG_XML 1
using com::sun::star::xml::sax::XAttributeList; using com::sun::star::xml::sax::XAttributeList;
DocumentHandler::DocumentHandler(Reference < XDocumentHandler > &xHandler) : DocumentHandler::DocumentHandler(Reference < XDocumentHandler > &xHandler) :
...@@ -36,9 +34,6 @@ void DocumentHandler::endDocument() ...@@ -36,9 +34,6 @@ void DocumentHandler::endDocument()
void DocumentHandler::startElement(const char *psName, const WPXPropertyList &xPropList) void DocumentHandler::startElement(const char *psName, const WPXPropertyList &xPropList)
{ {
#ifdef DEBUG_XML
printf("<%s", psName);
#endif
SvXMLAttributeList *pAttrList = new SvXMLAttributeList(); SvXMLAttributeList *pAttrList = new SvXMLAttributeList();
Reference < XAttributeList > xAttrList(pAttrList); Reference < XAttributeList > xAttrList(pAttrList);
WPXPropertyList::Iter i(xPropList); WPXPropertyList::Iter i(xPropList);
...@@ -49,33 +44,20 @@ void DocumentHandler::startElement(const char *psName, const WPXPropertyList &xP ...@@ -49,33 +44,20 @@ void DocumentHandler::startElement(const char *psName, const WPXPropertyList &xP
{ {
pAttrList->AddAttribute(OUString::createFromAscii(i.key()), pAttrList->AddAttribute(OUString::createFromAscii(i.key()),
OUString::createFromAscii(i()->getStr().cstr())); OUString::createFromAscii(i()->getStr().cstr()));
#ifdef DEBUG_XML
printf(" %s=\"%s\"", i.key(), i()->getStr().cstr());
#endif
} }
} }
#ifdef DEBUG_XML
printf(">");
#endif
mxHandler->startElement(OUString::createFromAscii(psName), xAttrList); mxHandler->startElement(OUString::createFromAscii(psName), xAttrList);
} }
void DocumentHandler::endElement(const char *psName) void DocumentHandler::endElement(const char *psName)
{ {
#ifdef DEBUG_XML
printf("</%s>", psName);
#endif
mxHandler->endElement(OUString::createFromAscii(psName)); mxHandler->endElement(OUString::createFromAscii(psName));
} }
void DocumentHandler::characters(const WPXString &sCharacters) void DocumentHandler::characters(const WPXString &sCharacters)
{ {
OUString sCharU16(sCharacters.cstr(), strlen(sCharacters.cstr()), RTL_TEXTENCODING_UTF8); OUString sCharU16(sCharacters.cstr(), strlen(sCharacters.cstr()), RTL_TEXTENCODING_UTF8);
#ifdef DEBUG_XML
WPXString sEscapedCharacters(sCharacters, true);
printf("%s", sEscapedCharacters.cstr());
#endif
mxHandler->characters(sCharU16); mxHandler->characters(sCharU16);
} }
......
...@@ -17,8 +17,8 @@ ...@@ -17,8 +17,8 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 . * the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/ */
#ifndef _OODOCUMENTHANDLER_HXX_ #ifndef _DOCUMENTHANDLER_HXX_
#define _OODOCUMENTHANDLER_HXX_ #define _DOCUMENTHANDLER_HXX_
#include <com/sun/star/xml/sax/XDocumentHandler.hpp> #include <com/sun/star/xml/sax/XDocumentHandler.hpp>
...@@ -43,6 +43,6 @@ private: ...@@ -43,6 +43,6 @@ private:
Reference < XDocumentHandler > mxHandler; Reference < XDocumentHandler > mxHandler;
}; };
#endif // _OODOCUMENTHANDLER_HXX_ #endif // _DOCUMENTHANDLER_HXX_
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
...@@ -7,8 +7,8 @@ ...@@ -7,8 +7,8 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. * file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/ */
#include "WPXSvStream.h" #include "WPXSvStream.hxx"
#include "filter/FilterInternal.hxx" #include "FilterInternal.hxx"
#include <tools/stream.hxx> #include <tools/stream.hxx>
#include <unotools/streamwrap.hxx> #include <unotools/streamwrap.hxx>
#include <unotools/ucbstreamhelper.hxx> #include <unotools/ucbstreamhelper.hxx>
......
...@@ -26,10 +26,10 @@ ...@@ -26,10 +26,10 @@
#include <xmloff/attrlist.hxx> #include <xmloff/attrlist.hxx>
#include <libcdr/libcdr.h> #include <libcdr/libcdr.h>
#include "filter/DocumentHandler.hxx" #include "common/DocumentHandler.hxx"
#include "filter/OdgGenerator.hxx" #include "common/OdgGenerator.hxx"
#include "CDRImportFilter.hxx" #include "CDRImportFilter.hxx"
#include "stream/WPXSvStream.h" #include "common/WPXSvStream.hxx"
#include <iostream> #include <iostream>
......
...@@ -26,10 +26,10 @@ ...@@ -26,10 +26,10 @@
#include <xmloff/attrlist.hxx> #include <xmloff/attrlist.hxx>
#include <libcdr/libcdr.h> #include <libcdr/libcdr.h>
#include "filter/DocumentHandler.hxx" #include "common/DocumentHandler.hxx"
#include "filter/OdgGenerator.hxx" #include "common/OdgGenerator.hxx"
#include "CMXImportFilter.hxx" #include "CMXImportFilter.hxx"
#include "stream/WPXSvStream.h" #include "common/WPXSvStream.hxx"
#include <iostream> #include <iostream>
......
...@@ -22,10 +22,10 @@ ...@@ -22,10 +22,10 @@
#include <xmloff/attrlist.hxx> #include <xmloff/attrlist.hxx>
#include <libmspub/libmspub.h> #include <libmspub/libmspub.h>
#include "filter/DocumentHandler.hxx" #include "common/DocumentHandler.hxx"
#include "filter/OdgGenerator.hxx" #include "common/OdgGenerator.hxx"
#include "MSPUBImportFilter.hxx" #include "MSPUBImportFilter.hxx"
#include "stream/WPXSvStream.h" #include "common/WPXSvStream.hxx"
#include <iostream> #include <iostream>
......
...@@ -22,10 +22,10 @@ ...@@ -22,10 +22,10 @@
#include <xmloff/attrlist.hxx> #include <xmloff/attrlist.hxx>
#include <libvisio/libvisio.h> #include <libvisio/libvisio.h>
#include "filter/DocumentHandler.hxx" #include "common/DocumentHandler.hxx"
#include "filter/OdgGenerator.hxx" #include "common/OdgGenerator.hxx"
#include "VisioImportFilter.hxx" #include "VisioImportFilter.hxx"
#include "stream/WPXSvStream.h" #include "common/WPXSvStream.hxx"
#include <iostream> #include <iostream>
......
...@@ -27,10 +27,10 @@ ...@@ -27,10 +27,10 @@
#include <comphelper/componentcontext.hxx> #include <comphelper/componentcontext.hxx>
#include <xmloff/attrlist.hxx> #include <xmloff/attrlist.hxx>
#include "filter/DocumentHandler.hxx" #include "common/DocumentHandler.hxx"
#include "filter/OdgGenerator.hxx" #include "common/OdgGenerator.hxx"
#include "WPGImportFilter.hxx" #include "WPGImportFilter.hxx"
#include "stream/WPXSvStream.h" #include "common/WPXSvStream.hxx"
#include <iostream> #include <iostream>
......
...@@ -26,11 +26,11 @@ ...@@ -26,11 +26,11 @@
#include <libwps/libwps.h> #include <libwps/libwps.h>
#include "filter/FilterInternal.hxx" #include "common/FilterInternal.hxx"
#include "filter/DocumentHandler.hxx" #include "common/DocumentHandler.hxx"
#include "filter/OdtGenerator.hxx" #include "common/OdtGenerator.hxx"
#include "MSWorksImportFilter.hxx" #include "MSWorksImportFilter.hxx"
#include "stream/WPXSvStream.h" #include "common/WPXSvStream.hxx"
#include <iostream> #include <iostream>
......
...@@ -26,11 +26,11 @@ ...@@ -26,11 +26,11 @@
#include <libmwaw/libmwaw.hxx> #include <libmwaw/libmwaw.hxx>
#include "filter/FilterInternal.hxx" #include "common/FilterInternal.hxx"
#include "filter/DocumentHandler.hxx" #include "common/DocumentHandler.hxx"
#include "filter/OdtGenerator.hxx" #include "common/OdtGenerator.hxx"
#include "MWAWImportFilter.hxx" #include "MWAWImportFilter.hxx"
#include "stream/WPXSvStream.h" #include "common/WPXSvStream.hxx"
#include <iostream> #include <iostream>
......
...@@ -27,11 +27,11 @@ ...@@ -27,11 +27,11 @@
#include <libwpd/libwpd.h> #include <libwpd/libwpd.h>
#include "filter/FilterInternal.hxx" #include "common/FilterInternal.hxx"
#include "filter/DocumentHandler.hxx" #include "common/DocumentHandler.hxx"
#include "filter/OdgGenerator.hxx" #include "common/OdgGenerator.hxx"
#include "filter/OdtGenerator.hxx" #include "common/OdtGenerator.hxx"
#include "stream/WPXSvStream.h" #include "common/WPXSvStream.hxx"
#include "WordPerfectImportFilter.hxx" #include "WordPerfectImportFilter.hxx"
using ::ucbhelper::Content; using ::ucbhelper::Content;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment