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
v3.5.13-sru
tpearson 14 years ago
parent 0e3990bf18
commit 86ea45fe59

@ -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)

@ -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;
}

@ -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());

@ -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>

@ -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),

Loading…
Cancel
Save