diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-08-02 03:02:23 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-08-02 03:02:23 +0000 |
commit | 86ea45fe5947020ff39e593b7f86f3c8b518d79b (patch) | |
tree | 0dab1c5e6d332b708d74232a24e884dfd10f21dd /filters/kword | |
parent | 0e3990bf18ab06b277c045b47a998dca5140797e (diff) | |
download | koffice-86ea45fe5947020ff39e593b7f86f3c8b518d79b.tar.gz koffice-86ea45fe5947020ff39e593b7f86f3c8b518d79b.zip |
Fail if libwpd >= 0.9.0 is present
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/koffice@1244351 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'filters/kword')
-rw-r--r-- | filters/kword/wordperfect/configure.in.in | 24 | ||||
-rw-r--r-- | filters/kword/wordperfect/import/PageSpan.cxx | 10 | ||||
-rw-r--r-- | filters/kword/wordperfect/import/WordPerfectCollector.cxx | 10 | ||||
-rw-r--r-- | filters/kword/wordperfect/import/WordPerfectCollector.hxx | 4 | ||||
-rw-r--r-- | filters/kword/wordperfect/import/wpimport.cc | 9 |
5 files changed, 57 insertions, 0 deletions
diff --git a/filters/kword/wordperfect/configure.in.in b/filters/kword/wordperfect/configure.in.in index 82174da2..a4919660 100644 --- a/filters/kword/wordperfect/configure.in.in +++ b/filters/kword/wordperfect/configure.in.in @@ -22,6 +22,30 @@ if test -n "$PKGCONFIG"; then fi fi +if test -z "$LIBWPD_LIBS"; then + if test -n "$PKGCONFIG"; then + vers=`$PKGCONFIG libwpd-0.9 --modversion 2>/dev/null` + if test -n "$vers" + then + LIBWPD_LIBS="`$PKGCONFIG libwpd-0.9 --libs`" + LIBWPD_RPATH= + for args in $LIBWPD_LIBS; do + case $args in + -L*) + LIBWPD_RPATH="$LIBWPD_RPATH $args" + ;; + esac + done + LIBWPD_RPATH=`echo $LIBWPD_RPATH | $SED -e "s/-L/-R/g"` + LIBWPD_CFLAGS="`$PKGCONFIG libwpd-0.9 --cflags`" + + AC_DEFINE_UNQUOTED(HAVE_WPD, 1, [Defines if your system has the libwpd library]) + AC_DEFINE_UNQUOTED(HAVE_LIBWPD_090, 1, [Defines if your system has libpwd greater than or equal to v0.9.0]) + + AC_MSG_ERROR([[libwpd >= 0.9.0 is not yet supported!]]) + fi + fi +fi AC_SUBST(LIBWPD_LIBS) AC_SUBST(LIBWPD_CFLAGS) diff --git a/filters/kword/wordperfect/import/PageSpan.cxx b/filters/kword/wordperfect/import/PageSpan.cxx index c56fbe54..b2596690 100644 --- a/filters/kword/wordperfect/import/PageSpan.cxx +++ b/filters/kword/wordperfect/import/PageSpan.cxx @@ -26,6 +26,8 @@ /* "This product is not manufactured, approved, or supported by * Corel Corporation or Corel Corporation Limited." */ +#include <config.h> + #include "FilterInternal.hxx" #include "PageSpan.hxx" #include "DocumentElement.hxx" @@ -71,7 +73,11 @@ int PageSpan::getSpan() const float PageSpan::getMarginLeft() const { if (mxPropList["fo:margin-left"]) +#ifdef HAVE_LIBWPD_090 + return mxPropList["fo:margin-left"]->getDouble(); +#else return mxPropList["fo:margin-left"]->getFloat(); +#endif return 0.0f; } @@ -79,7 +85,11 @@ float PageSpan::getMarginLeft() const float PageSpan::getMarginRight() const { if (mxPropList["fo:margin-right"]) +#ifdef HAVE_LIBWPD_090 + return mxPropList["fo:margin-right"]->getDouble(); +#else return mxPropList["fo:margin-right"]->getFloat(); +#endif return 0.0f; } diff --git a/filters/kword/wordperfect/import/WordPerfectCollector.cxx b/filters/kword/wordperfect/import/WordPerfectCollector.cxx index ad732702..bfcd4359 100644 --- a/filters/kword/wordperfect/import/WordPerfectCollector.cxx +++ b/filters/kword/wordperfect/import/WordPerfectCollector.cxx @@ -29,6 +29,8 @@ * Corel Corporation or Corel Corporation Limited." */ +#include <config.h> + #include <libwpd/libwpd.h> #include <string.h> // for strcmp @@ -135,7 +137,11 @@ bool WordPerfectCollector::filter() bool WordPerfectCollector::_parseSourceDocument(WPXInputStream &input) { +#ifdef HAVE_LIBWPD_090 + WPDResult result = WPDocument::parse(&input, static_cast<WPXHLListenerImpl *>(this), NULL); +#else WPDResult result = WPDocument::parse(&input, static_cast<WPXHLListenerImpl *>(this)); +#endif if (result != WPD_OK) return false; @@ -427,7 +433,11 @@ void WordPerfectCollector::openSection(const WPXPropertyList &propList, const WP if (iNumColumns > 1) { +#ifdef HAVE_LIBWPD_090 + mfSectionSpaceAfter = propList["fo:margin-bottom"]->getDouble(); +#else mfSectionSpaceAfter = propList["fo:margin-bottom"]->getFloat(); +#endif WPXString sSectionName; sSectionName.sprintf("Section%i", mSectionStyles.size()); diff --git a/filters/kword/wordperfect/import/WordPerfectCollector.hxx b/filters/kword/wordperfect/import/WordPerfectCollector.hxx index 561796f3..d593224a 100644 --- a/filters/kword/wordperfect/import/WordPerfectCollector.hxx +++ b/filters/kword/wordperfect/import/WordPerfectCollector.hxx @@ -33,7 +33,11 @@ #define _WORDPERFECTCOLLECTOR_H #include "SectionStyle.hxx" +#include <config.h> #include <libwpd/libwpd.h> +#ifdef HAVE_LIBWPD_090 +#define WPXHLListenerImpl WPXDocumentInterface +#endif #include <vector> #include <map> #include <stack> diff --git a/filters/kword/wordperfect/import/wpimport.cc b/filters/kword/wordperfect/import/wpimport.cc index 5554f6e0..f462fd09 100644 --- a/filters/kword/wordperfect/import/wpimport.cc +++ b/filters/kword/wordperfect/import/wpimport.cc @@ -35,7 +35,12 @@ typedef KGenericFactory<WPImport, KoFilter> WPImportFactory; K_EXPORT_COMPONENT_FACTORY( libwpimport, WPImportFactory( "kofficefilters" ) ) #include <libwpd/libwpd.h> +#ifdef HAVE_LIBWPD_090 +#include <libwpd-stream/libwpd-stream.h> +#define uint8_t uchar +#else #include <libwpd/WPXStream.h> +#endif #include "DocumentHandler.hxx" #include "WordPerfectCollector.hxx" @@ -62,7 +67,11 @@ private: WPXMemoryInputStream::WPXMemoryInputStream(uint8_t *data, size_t size) : +#ifdef HAVE_LIBWPD_090 + WPXInputStream(), +#else WPXInputStream(false), +#endif m_offset(0), m_data(data), m_size(size), |