diff options
author | Fridrich Štrba <fridrich.strba@bluewin.ch> | 2010-09-14 11:07:30 +0200 |
---|---|---|
committer | Fridrich Štrba <fridrich.strba@bluewin.ch> | 2010-09-14 11:07:30 +0200 |
commit | fc263c4f068ae706e05d0dc0546400301f381303 (patch) | |
tree | 11995b3c447fac87ca2e2a263b945d5e815cef13 /writerperfect | |
parent | 6e69e849c63d7f44611967fa79133ab6b6bb0bee (diff) |
wpsimport-writerperfect.diff: WPS Import filter - core implementation.
Diffstat (limited to 'writerperfect')
-rw-r--r-- | writerperfect/prj/build.lst | 5 | ||||
-rw-r--r-- | writerperfect/prj/d.lst | 4 | ||||
-rw-r--r-- | writerperfect/source/filter/DocumentCollector.cxx | 2 | ||||
-rw-r--r-- | writerperfect/source/filter/DocumentCollector.hxx | 7 | ||||
-rw-r--r-- | writerperfect/source/filter/DocumentHandler.cxx | 10 | ||||
-rw-r--r-- | writerperfect/source/filter/SectionStyle.cxx | 2 | ||||
-rw-r--r-- | writerperfect/source/filter/makefile.mk | 12 | ||||
-rw-r--r-- | writerperfect/source/stream/WPXSvStream.cxx | 2 | ||||
-rw-r--r-- | writerperfect/source/stream/WPXSvStream.h | 3 | ||||
-rw-r--r-- | writerperfect/source/stream/makefile.mk | 6 | ||||
-rw-r--r-- | writerperfect/source/wpdimp/WordPerfectCollector.cxx | 5 | ||||
-rw-r--r-- | writerperfect/source/wpdimp/WordPerfectCollector.hxx | 4 | ||||
-rw-r--r-- | writerperfect/source/wpdimp/makefile.mk | 12 | ||||
-rw-r--r-- | writerperfect/util/makefile.mk | 47 |
14 files changed, 88 insertions, 33 deletions
diff --git a/writerperfect/prj/build.lst b/writerperfect/prj/build.lst index 3bb3867d8633..d708c33341d0 100644 --- a/writerperfect/prj/build.lst +++ b/writerperfect/prj/build.lst @@ -1,6 +1,7 @@ -wp writerperfect : LIBWPD:libwpd sot comphelper xmloff NULL +wp writerperfect : LIBWPS:libwps LIBWPD:libwpd sot comphelper xmloff svtools NULL wp writerperfect usr1 - all wp_mkout NULL wp writerperfect\source\stream nmake - all wp_stream NULL wp writerperfect\source\filter nmake - all wp_filter NULL wp writerperfect\source\wpdimp nmake - all wp_wpdimp NULL -wp writerperfect\util nmake - all wp_util wp_wpdimp wp_filter wp_stream NULL +wp writerperfect\source\wpsimp nmake - all wp_wpsimp NULL +wp writerperfect\util nmake - all wp_util wp_wpsimp wp_wpdimp wp_filter wp_stream NULL diff --git a/writerperfect/prj/d.lst b/writerperfect/prj/d.lst index 5b5852c6a86f..fb11fa974311 100644 --- a/writerperfect/prj/d.lst +++ b/writerperfect/prj/d.lst @@ -1,4 +1,4 @@ -..\%__SRC%\lib\libwpft*.so %_DEST%\lib%_EXT% -..\%__SRC%\bin\wpft*.dll %_DEST%\bin%_EXT% +..\%__SRC%\lib\lib*.so %_DEST%\lib%_EXT% +..\%__SRC%\bin\*.dll %_DEST%\bin%_EXT% ..\%__SRC%\bin\wpftgo.dll %_DEST%\bin%_EXT%\wpftgo.dll ..\%__SRC%\lib\*.dylib %_DEST%\lib%_EXT%\*.dylib diff --git a/writerperfect/source/filter/DocumentCollector.cxx b/writerperfect/source/filter/DocumentCollector.cxx index e258d2212518..e20ce6bca132 100644 --- a/writerperfect/source/filter/DocumentCollector.cxx +++ b/writerperfect/source/filter/DocumentCollector.cxx @@ -58,7 +58,7 @@ _WriterDocumentState::_WriterDocumentState() : { } -DocumentCollector::DocumentCollector(WPXInputStream *pInput, DocumentHandler *pHandler) : +DocumentCollector::DocumentCollector(WPSInputStream *pInput, DocumentHandler *pHandler) : mpInput(pInput), mpHandler(pHandler), mbUsed(false), diff --git a/writerperfect/source/filter/DocumentCollector.hxx b/writerperfect/source/filter/DocumentCollector.hxx index 18ebcdb43418..a1e7fbc6de11 100644 --- a/writerperfect/source/filter/DocumentCollector.hxx +++ b/writerperfect/source/filter/DocumentCollector.hxx @@ -35,6 +35,7 @@ #if defined _MSC_VER #pragma warning( push, 1 ) #endif +#include <libwps/libwps.h> #include <libwpd/libwpd.h> #if defined _MSC_VER #pragma warning( pop ) @@ -82,7 +83,7 @@ struct ltstr class DocumentCollector : public WPXHLListenerImpl { public: - DocumentCollector(WPXInputStream *pInput, DocumentHandler *pHandler); + DocumentCollector(WPSInputStream *pInput, DocumentHandler *pHandler); virtual ~DocumentCollector(); bool filter(); @@ -133,7 +134,7 @@ public: virtual void closeTableCell(); virtual void insertCoveredTableCell(const WPXPropertyList &propList); virtual void closeTable(); - virtual bool parseSourceDocument(WPXInputStream &input) = 0; + virtual bool parseSourceDocument(WPSInputStream &input) = 0; protected: void _resetDocumentState(); @@ -147,7 +148,7 @@ private: void _openListLevel(TagOpenElement *pListLevelOpenElement); void _closeListLevel(const char *szListType); - WPXInputStream *mpInput; + WPSInputStream *mpInput; DocumentHandler *mpHandler; bool mbUsed; // whether or not it has been before (you can only use me once!) diff --git a/writerperfect/source/filter/DocumentHandler.cxx b/writerperfect/source/filter/DocumentHandler.cxx index 5877b8acd5df..a5204c519830 100644 --- a/writerperfect/source/filter/DocumentHandler.cxx +++ b/writerperfect/source/filter/DocumentHandler.cxx @@ -42,19 +42,19 @@ DocumentHandler::DocumentHandler(Reference < XDocumentHandler > &xHandler) : void DocumentHandler::startDocument() { - WRITER_DEBUG_MSG(("DocumentHandler::startDocument")); + WRITER_DEBUG_MSG(("DocumentHandler::startDocument\n")); mxHandler->startDocument(); } void DocumentHandler::endDocument() { - WRITER_DEBUG_MSG(("DocumentHandler::endDocument")); + WRITER_DEBUG_MSG(("DocumentHandler::endDocument\n")); mxHandler->endDocument(); } void DocumentHandler::startElement(const char *psName, const WPXPropertyList &xPropList) { - WRITER_DEBUG_MSG(("DocumentHandler::startElement")); + WRITER_DEBUG_MSG(("DocumentHandler::startElement\n")); SvXMLAttributeList *pAttrList = new SvXMLAttributeList(); Reference < XAttributeList > xAttrList(pAttrList); WPXPropertyList::Iter i(xPropList); @@ -71,13 +71,13 @@ void DocumentHandler::startElement(const char *psName, const WPXPropertyList &xP void DocumentHandler::endElement(const char *psName) { - WRITER_DEBUG_MSG(("DocumentHandler::endElement")); + WRITER_DEBUG_MSG(("DocumentHandler::endElement\n")); mxHandler->endElement(OUString::createFromAscii(psName)); } void DocumentHandler::characters(const WPXString &sCharacters) { - WRITER_DEBUG_MSG(("DocumentHandler::characters")); + WRITER_DEBUG_MSG(("DocumentHandler::characters\n")); OUString sCharU16(sCharacters.cstr(), strlen(sCharacters.cstr()), RTL_TEXTENCODING_UTF8); mxHandler->characters(sCharU16); } diff --git a/writerperfect/source/filter/SectionStyle.cxx b/writerperfect/source/filter/SectionStyle.cxx index 51dd9fc398f1..10e46d3612d2 100644 --- a/writerperfect/source/filter/SectionStyle.cxx +++ b/writerperfect/source/filter/SectionStyle.cxx @@ -33,7 +33,7 @@ #ifdef _MSC_VER double rint(double x); -#endif /* _WIN32 */ +#endif /* _MSC_VER */ SectionStyle::SectionStyle(const WPXPropertyList &xPropList, const WPXPropertyListVector &xColumns, diff --git a/writerperfect/source/filter/makefile.mk b/writerperfect/source/filter/makefile.mk index e535d2aebbe0..a092ce27db2e 100644 --- a/writerperfect/source/filter/makefile.mk +++ b/writerperfect/source/filter/makefile.mk @@ -7,12 +7,16 @@ ENABLE_EXCEPTIONS=true .INCLUDE : settings.mk .IF "$(SYSTEM_LIBWPD)" == "YES" -INCPRE+=$(LIBWPD_CFLAGS) -I.. -.ELSE -# broken but ... necessary, internal include shafted ... -INCPRE+=-I.. +INCPRE+=$(LIBWPD_CFLAGS) +.ENDIF + +.IF "$(SYSTEM_LIBWPS)" == "YES" +INCPRE+=$(LIBWPS_CFLAGS) .ENDIF +# broken but ... necessary, internal include shafted ... +INCPRE+= -I.. + SLOFILES= \ $(SLO)$/DocumentElement.obj \ $(SLO)$/FontStyle.obj \ diff --git a/writerperfect/source/stream/WPXSvStream.cxx b/writerperfect/source/stream/WPXSvStream.cxx index 973fb5ab31d9..0fc62657786c 100644 --- a/writerperfect/source/stream/WPXSvStream.cxx +++ b/writerperfect/source/stream/WPXSvStream.cxx @@ -9,7 +9,7 @@ using namespace ::com::sun::star::uno; using namespace ::com::sun::star::io; WPXSvInputStream::WPXSvInputStream( Reference< XInputStream > xStream ) : - WPXInputStream(true), + WPSInputStream(), mxChildStorage(), mxChildStream(), mxStream(xStream), diff --git a/writerperfect/source/stream/WPXSvStream.h b/writerperfect/source/stream/WPXSvStream.h index 099c5a76eccf..f4f3b7eb81ad 100644 --- a/writerperfect/source/stream/WPXSvStream.h +++ b/writerperfect/source/stream/WPXSvStream.h @@ -12,12 +12,13 @@ #if defined _MSC_VER #pragma warning( push, 1 ) #endif +#include <libwps/WPSStream.h> #include <libwpd/WPXStream.h> #if defined _MSC_VER #pragma warning( pop ) #endif -class WPXSvInputStream : public WPXInputStream +class WPXSvInputStream : public WPSInputStream { public: WPXSvInputStream( ::com::sun::star::uno::Reference< diff --git a/writerperfect/source/stream/makefile.mk b/writerperfect/source/stream/makefile.mk index 7e684b71bdb1..97262e7b7486 100644 --- a/writerperfect/source/stream/makefile.mk +++ b/writerperfect/source/stream/makefile.mk @@ -10,6 +10,12 @@ ENABLE_EXCEPTIONS=true INCPRE+=$(LIBWPD_CFLAGS) .ENDIF +.IF "$(SYSTEM_LIBWPS)" == "YES" +INCPRE+=$(LIBWPS_CFLAGS) +.ELSE +INCPRE+=$(SOLARVER)$/$(UPD)$/$(INPATH)$/inc$/libwps +.ENDIF + # broken but ... necessary, internal include shafted ... INCPRE+= -I.. diff --git a/writerperfect/source/wpdimp/WordPerfectCollector.cxx b/writerperfect/source/wpdimp/WordPerfectCollector.cxx index 0bc10cc0ba5b..9d32fdec0333 100644 --- a/writerperfect/source/wpdimp/WordPerfectCollector.cxx +++ b/writerperfect/source/wpdimp/WordPerfectCollector.cxx @@ -30,11 +30,12 @@ #pragma warning( push, 1 ) #endif #include "WordPerfectCollector.hxx" +#include <libwpd/WPDocument.h> #if defined _MSC_VER #pragma warning( pop ) #endif -WordPerfectCollector::WordPerfectCollector(WPXInputStream *pInput, DocumentHandler *pHandler) : +WordPerfectCollector::WordPerfectCollector(WPSInputStream *pInput, DocumentHandler *pHandler) : DocumentCollector(pInput, pHandler) { } @@ -43,7 +44,7 @@ WordPerfectCollector::~WordPerfectCollector() { } -bool WordPerfectCollector::parseSourceDocument(WPXInputStream &input) +bool WordPerfectCollector::parseSourceDocument(WPSInputStream &input) { WPDResult result = WPDocument::parse(&input, static_cast<WPXHLListenerImpl *>(this)); if (result != WPD_OK) diff --git a/writerperfect/source/wpdimp/WordPerfectCollector.hxx b/writerperfect/source/wpdimp/WordPerfectCollector.hxx index 400a5ca8c856..95ed7afdda57 100644 --- a/writerperfect/source/wpdimp/WordPerfectCollector.hxx +++ b/writerperfect/source/wpdimp/WordPerfectCollector.hxx @@ -34,8 +34,8 @@ class WordPerfectCollector : public DocumentCollector { public: - WordPerfectCollector(WPXInputStream *pInput, DocumentHandler *pHandler); + WordPerfectCollector(WPSInputStream *pInput, DocumentHandler *pHandler); virtual ~WordPerfectCollector(); - bool parseSourceDocument(WPXInputStream &pInput); + bool parseSourceDocument(WPSInputStream &pInput); }; #endif diff --git a/writerperfect/source/wpdimp/makefile.mk b/writerperfect/source/wpdimp/makefile.mk index bc2a3cda544b..745887eb8588 100644 --- a/writerperfect/source/wpdimp/makefile.mk +++ b/writerperfect/source/wpdimp/makefile.mk @@ -7,12 +7,16 @@ ENABLE_EXCEPTIONS=true .INCLUDE : settings.mk .IF "$(SYSTEM_LIBWPD)" == "YES" -INCPRE+=$(LIBWPD_CFLAGS) -I.. -.ELSE -# broken but ... necessary, internal include shafted ... -INCPRE+=-I.. +INCPRE+=$(LIBWPD_CFLAGS) +.ENDIF + +.IF "$(SYSTEM_LIBWPS)" == "YES" +INCPRE+=$(LIBWPS_CFLAGS) .ENDIF +# broken but ... necessary, internal include shafted ... +INCPRE+= -I.. + SLOFILES= \ $(SLO)$/WordPerfectCollector.obj \ $(SLO)$/WordPerfectImportFilter.obj \ diff --git a/writerperfect/util/makefile.mk b/writerperfect/util/makefile.mk index dca29e005287..56bdfb2c60cb 100644 --- a/writerperfect/util/makefile.mk +++ b/writerperfect/util/makefile.mk @@ -4,18 +4,26 @@ TARGET=writerperfect .INCLUDE : settings.mk -.IF "$(GUI)"=="UNX" + +.IF "$(GUI)"=="UNX" || "$(GUI)$(COM)"=="WNTGCC" + .IF "$(SYSTEM_LIBWPD)" == "YES" LIBWPD=$(LIBWPD_LIBS) .ELSE LIBWPD=-lwpdlib .ENDIF + +.IF "$(SYSTEM_LIBWPS)" == "YES" +LIBWPS=$(LIBWPS_LIBS) .ELSE -.IF "$(GUI)$(COM)"=="WNTGCC" -LIBWPD=-lwpdlib -.ELSE - LIBWPD=$(LIBPRE) wpdlib.lib +LIBWPS=-lwpslib .ENDIF + +.ELSE + +LIBWPD=$(LIBPRE) wpdlib.lib +LIBWPS=$(LIBPRE) wpslib.lib + .ENDIF LIB1TARGET= $(SLB)$/wpft.lib @@ -42,4 +50,33 @@ SHL1LIBS = $(LIB1TARGET) SHL1VERSIONMAP=$(SOLARENV)/src/component.map DEF1NAME=$(SHL1TARGET) + +LIB2TARGET= $(SLB)$/msworks.lib +LIB2FILES= \ + $(SLB)$/stream.lib \ + $(SLB)$/filter.lib \ + $(SLB)$/wpsimp.lib +SHL2LIBS=$(LIB2TARGET) +SHL2STDLIBS+= \ + $(SVLLIB) \ + $(SOTLIB) \ + $(SO2LIB) \ + $(SVTOOLLIB) \ + $(UNOTOOLSLIB) \ + $(TOOLSLIB) \ + $(COMPHELPERLIB) \ + $(UCBHELPERLIB) \ + $(CPPUHELPERLIB) \ + $(CPPULIB) \ + $(SALLIB) \ + $(XMLOFFLIB) \ + $(LIBWPS) \ + $(LIBWPD) + +SHL2TARGET = msworks$(DLLPOSTFIX) +SHL2IMPLIB = i$(SHL2TARGET) +SHL2LIBS = $(LIB2TARGET) +SHL2VERSIONMAP = $(SOLARENV)/src/component.map +DEF2NAME = $(SHL2TARGET) + .INCLUDE : target.mk |