[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#754568: src:calligra: please adapt for libwpg 0.3/libwps 0.3/libwpd 0.10/libvisio 0.1 (and librevenge)



Package: src:calligra
Severity: important
Version: 1:2.7.5-1
Tags: patch

Hi,

New upstreams of libwpd, libwpg, libwps and libvisio are there and all of them
are now using librevenge as base, so they changed API and ABI version and it
needs some bigger adaptions to the code.

Fortunately the librevenge authors provided patches[2] (or did it themselves, as
for LO) for all known affected applications - this includes calligra.). The
URL is 404 right now, but the same patch is at [1] in Fedora.

I attach a full git-am'able debdiff for reference. You might want to add
it to the 2.8.x packaging (see below).

Note that
 a) calligra checks for libetonyek-dev but doesn't have it in Build-Depends:
    Interestingly there's no use of it (at least I see no lib depending on it),
    maybe it's just there because the old libodfgen needs it (new one doesn't.)? 
    Thus I left it out for now, if you add it, you need libetonyek-dev (>= 0.1)
 b) the patch we got just applies to the 2.8.x series, originally to 2.8.3 but
    it also works for 2.8.5. Thus fixing this bug is blocked by #748990...

The libraries are all also in experimental to test.

Note that this bug _might_ become serious _before_ the jessie release,
the transition starts. (LO 4.3 also needs all those new libs and doesn't
support the old ones anymore, and I still hope for it for jessie. Which
is why I am constantly asking about the status of 2.8.x because calligra 2.8.x
will block LO 4.3...)

The transition is tracked in #753426.

Regards,

Rene

[1]
http://pkgs.fedoraproject.org/cgit/calligra.git/commit/?id=4573cc7afdd7019682ff8f38663a1b407cb8a610
[2]
#libreoffice-dev.05-27.log:22:16 <@dtardon> _rene_, patches for calligra, inkscape and abiword are available at http://dtardon.fedorapeople.org/librevenge/0001-switch-to-librevenge-based-import-libs.patch, http://people.freedesktop.org/~fridrich/abiword-librevenge.diff and http://people.freedesktop.org/~fridrich/inkscape-librevenge.diff
>From abd553ba57b9ace8a1b3f974c711c3f8abe8ae48 Mon Sep 17 00:00:00 2001
From: Rene Engelhard <rene@debian.org>
Date: Sat, 12 Jul 2014 15:11:29 +0200
Subject: [PATCH] Add patch to build against the new librevenge-based import
 libs and update build-dependencies

---
 debian/changelog                                   |   4 +
 debian/control                                     |  10 +-
 debian/patches/series                              |   1 +
 .../switch-to-librevenge-based-import-libs.patch   | 881 +++++++++++++++++++++
 4 files changed, 891 insertions(+), 5 deletions(-)
 create mode 100644 debian/patches/switch-to-librevenge-based-import-libs.patch

diff --git a/debian/changelog b/debian/changelog
index b319ffe..3890b5b 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -43,6 +43,10 @@ calligra (1:2.8.5-1) UNRELEASED; urgency=medium
   * Refresh patches for 2.8.5.
   * New patch: kisjpegtest_call_kisexiv2_initialize
 
+  [ Rene Engelhard ]
+  * Add patch to build against the new librevenge-based import libs and update
+    build-dependencies
+
  -- Maximiliano Curia <maxy@debian.org>  Fri, 04 Jul 2014 10:46:34 +0200
 
 calligra (1:2.7.5-1) unstable; urgency=low
diff --git a/debian/control b/debian/control
index e5a0f22..f6f6a76 100644
--- a/debian/control
+++ b/debian/control
@@ -28,7 +28,7 @@ Build-Depends: cmake (>= 2.8),
                liblcms2-dev (>= 2.4),
                libmarble-dev (>> 4:4.12),
                libmysqlclient-dev,
-               libodfgen-dev,
+               libodfgen-dev (>= 0.1),
                libopencolorio-dev,
                libopenexr-dev,
                libopenjpeg-dev,
@@ -45,10 +45,10 @@ Build-Depends: cmake (>= 2.8),
                libspnav-dev,
                libsqlite3-dev (>= 3.6.16),
                libtiff-dev,
-               libvisio-dev,
-               libwpd-dev (>= 0.9.1),
-               libwpg-dev (>= 0.2.0),
-               libwps-dev,
+               libvisio-dev (>= 0.1),
+               libwpd-dev (>= 0.10),
+               libwpg-dev (>= 0.3),
+               libwps-dev (>= 0.3),
                libxbase64-dev,
                libxi-dev,
                nepomuk-core-dev,
diff --git a/debian/patches/series b/debian/patches/series
index 530aa78..9fd8b97 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -8,3 +8,4 @@ disable_convolution_failling_tests
 temporarily_disable_failing_tests
 calligra_imports_search_path
 kisjpegtest_call_kisexiv2_initialize
+switch-to-librevenge-based-import-libs.patch
diff --git a/debian/patches/switch-to-librevenge-based-import-libs.patch b/debian/patches/switch-to-librevenge-based-import-libs.patch
new file mode 100644
index 0000000..95a132b
--- /dev/null
+++ b/debian/patches/switch-to-librevenge-based-import-libs.patch
@@ -0,0 +1,881 @@
+From 8e8f99cc314435f100d367f41c110becd19d3885 Mon Sep 17 00:00:00 2001
+From: David Tardon <dtardon@redhat.com>
+Date: Tue, 27 May 2014 16:15:52 +0200
+Subject: [PATCH] switch to librevenge-based import libs
+
+---
+ CMakeLists.txt                                  | 10 ++++++
+ cmake/modules/FindLibEtonyek.cmake              |  6 ++--
+ cmake/modules/FindLibOdfGen.cmake               |  6 ++--
+ cmake/modules/FindLibRevenge.cmake              | 37 +++++++++++++++++++++
+ cmake/modules/FindLibVisio.cmake                |  6 ++--
+ cmake/modules/FindLibWpd.cmake                  | 22 +++----------
+ cmake/modules/FindLibWpg.cmake                  |  6 ++--
+ cmake/modules/FindLibWps.cmake                  |  6 ++--
+ filters/flow/visio/import/CMakeLists.txt        |  3 +-
+ filters/flow/visio/import/VSDXImport.cpp        |  9 ++---
+ filters/flow/wpg/import/CMakeLists.txt          |  3 +-
+ filters/flow/wpg/import/WPGImport.cpp           |  9 ++---
+ filters/karbon/wpg/CMakeLists.txt               |  4 +--
+ filters/karbon/wpg/WPGImport.cpp                | 39 ++++++++--------------
+ filters/libodfhandler/DiskDocumentHandler.cxx   | 13 ++++----
+ filters/libodfhandler/DiskDocumentHandler.hxx   |  8 ++---
+ filters/libodfhandler/OutputFileHelper.cxx      |  6 ++--
+ filters/libodfhandler/OutputFileHelper.hxx      |  9 ++---
+ filters/libodfhandler/StdOutHandler.cxx         | 13 ++++----
+ filters/libodfhandler/StdOutHandler.hxx         |  8 ++---
+ filters/stage/keynote/import/CMakeLists.txt     |  5 +--
+ filters/stage/keynote/import/KeyImport.cpp      | 15 +++++----
+ filters/words/wordperfect/import/CMakeLists.txt |  3 +-
+ filters/words/wordperfect/import/WPDImport.cpp  | 44 ++++++++++++++-----------
+ filters/words/works/import/CMakeLists.txt       |  3 +-
+ filters/words/works/import/WPSImport.cpp        | 18 +++++-----
+ 26 files changed, 177 insertions(+), 134 deletions(-)
+ create mode 100644 cmake/modules/FindLibRevenge.cmake
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 5b6b764..c337864 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -697,6 +697,16 @@ macro_optional_find_package(Okular)
+ macro_log_feature(OKULAR_FOUND "Okular" "Okular ODP Plugin" "http://okular.kde.org/"; FALSE "" "Required to build the Okular OpenDocument Presenter plugin")
+ 
+ ##
++## Test for librevenge
++##
++macro_optional_find_package(LibRevenge)
++macro_log_feature(LIBREVENGE_FOUND "LibRevenge"
++                  "A base library for writing document import filters"
++                  "http://sf.net/p/libwpd/librevenge/"; FALSE ""
++                  "Required by various import filters"
++)
++
++##
+ ## Test for libodfgen
+ ##
+ macro_optional_find_package(LibOdfGen)
+diff --git a/cmake/modules/FindLibEtonyek.cmake b/cmake/modules/FindLibEtonyek.cmake
+index 5b78964..ad10d79 100644
+--- a/cmake/modules/FindLibEtonyek.cmake
++++ b/cmake/modules/FindLibEtonyek.cmake
+@@ -10,16 +10,16 @@
+ 
+ include(LibFindMacros)
+ libfind_package(LIBETONYEK LibWpd)
+-libfind_pkg_check_modules(LIBETONYEK_PKGCONF libetonyek-0.0)
++libfind_pkg_check_modules(LIBETONYEK_PKGCONF libetonyek-0.1)
+ 
+ find_path(LIBETONYEK_INCLUDE_DIR
+     NAMES libetonyek/libetonyek.h
+     HINTS ${LIBETONYEK_PKGCONF_INCLUDE_DIRS} ${LIBETONYEK_PKGCONF_INCLUDEDIR}
+-    PATH_SUFFIXES libetonyek-0.0
++    PATH_SUFFIXES libetonyek-0.1
+ )
+ 
+ find_library(LIBETONYEK_LIBRARY
+-    NAMES etonyek etonyek-0.0
++    NAMES etonyek etonyek-0.1
+     HINTS ${LIBETONYEK_PKGCONF_LIBRARY_DIRS} ${LIBETONYEK_PKGCONF_LIBDIR}
+ )
+ 
+diff --git a/cmake/modules/FindLibOdfGen.cmake b/cmake/modules/FindLibOdfGen.cmake
+index 9ab80d1..355c345 100644
+--- a/cmake/modules/FindLibOdfGen.cmake
++++ b/cmake/modules/FindLibOdfGen.cmake
+@@ -9,16 +9,16 @@
+ # Redistribution and use is allowed according to the terms of the BSD license.
+ 
+ include(LibFindMacros)
+-libfind_pkg_check_modules(LIBODFGEN_PKGCONF libodfgen-0.0)
++libfind_pkg_check_modules(LIBODFGEN_PKGCONF libodfgen-0.1)
+ 
+ find_path(LIBODFGEN_INCLUDE_DIR
+     NAMES libodfgen/libodfgen.hxx
+     HINTS ${LIBODFGEN_PKGCONF_INCLUDE_DIRS} ${LIBODFGEN_PKGCONF_INCLUDEDIR}
+-    PATH_SUFFIXES libodfgen-0.0
++    PATH_SUFFIXES libodfgen-0.1
+ )
+ 
+ find_library(LIBODFGEN_LIBRARY
+-    NAMES odfgen-0.0
++    NAMES odfgen-0.1
+     HINTS ${LIBODFGEN_PKGCONF_LIBRARY_DIRS} ${LIBODFGEN_PKGCONF_LIBDIR}
+ )
+ 
+diff --git a/cmake/modules/FindLibRevenge.cmake b/cmake/modules/FindLibRevenge.cmake
+new file mode 100644
+index 0000000..8ed18b1
+--- /dev/null
++++ b/cmake/modules/FindLibRevenge.cmake
+@@ -0,0 +1,37 @@
++# - Try to find the librevenge
++# Once done this will define
++#
++#  LIBREVENGE_FOUND - system has LIBREVENGE
++#  LIBREVENGE_INCLUDE_DIRS - the LIBREVENGE include directory
++#  LIBREVENGE_LIBRARIES - Link these to use LIBREVENGE
++#  LIBREVENGE_DEFINITIONS - Compiler switches required for using LIBREVENGE
++#
++
++include(LibFindMacros)
++libfind_pkg_check_modules(REVENGE_PKGCONF librevenge-0.0)
++
++find_path(REVENGE_INCLUDE_DIR
++    NAMES librevenge/librevenge.h
++    HINTS ${REVENGE_PKGCONF_INCLUDE_DIRS} ${REVENGE_PKGCONF_INCLUDEDIR}
++    PATH_SUFFIXES librevenge-0.0
++)
++
++find_path(REVENGE_STREAM_INCLUDE_DIR
++    NAMES librevenge-stream/librevenge-stream.h
++    HINTS ${REVENGE_STREAM_PKGCONF_INCLUDE_DIRS} ${REVENGE_STREAM_PKGCONF_INCLUDEDIR}
++    PATH_SUFFIXES librevenge-0.0
++)
++
++find_library(REVENGE_LIBRARY
++    NAMES revenge librevenge revenge-0.0 librevenge-0.0
++    HINTS ${REVENGE_STREAM_PKGCONF_LIBRARY_DIRS} ${REVENGE_STREAM_PKGCONF_LIBDIR}
++)
++
++find_library(REVENGE_STREAM_LIBRARY
++    NAMES revenge-stream librevenge-stream revenge-stream-0.0 librevenge-stream-0.0
++    HINTS ${REVENGE_PKGCONF_LIBRARY_DIRS} ${REVENGE_PKGCONF_LIBDIR}
++)
++
++set(LIBREVENGE_PROCESS_LIBS REVENGE_LIBRARY REVENGE_STREAM_LIBRARY)
++set(LIBREVENGE_PROCESS_INCLUDES REVENGE_INCLUDE_DIR REVENGE_STREAM_INCLUDE_DIR)
++libfind_process(LIBREVENGE)
+diff --git a/cmake/modules/FindLibVisio.cmake b/cmake/modules/FindLibVisio.cmake
+index a8533ee..49871b3 100644
+--- a/cmake/modules/FindLibVisio.cmake
++++ b/cmake/modules/FindLibVisio.cmake
+@@ -12,16 +12,16 @@
+ include(LibFindMacros)
+ libfind_package(LIBWPD LibWpd)
+ libfind_package(LIBWPG LibWpg)
+-libfind_pkg_check_modules(LIBVISIO_PKGCONF libvisio-0.0)
++libfind_pkg_check_modules(LIBVISIO_PKGCONF libvisio-0.1)
+ 
+ find_path(LIBVISIO_INCLUDE_DIR
+     NAMES libvisio/libvisio.h
+     HINTS ${LIBVISIO_PKGCONF_INCLUDE_DIRS} ${LIBVISIO_PKGCONF_INCLUDEDIR}
+-    PATH_SUFFIXES libvisio-0.0
++    PATH_SUFFIXES libvisio-0.1
+ )
+ 
+ find_library(LIBVISIO_LIBRARY
+-    NAMES visio visio-0.0
++    NAMES visio visio-0.1
+     HINTS ${LIBVISIO_PKGCONF_LIBRARY_DIRS} ${LIBVISIO_PKGCONF_LIBDIR}
+ )
+ 
+diff --git a/cmake/modules/FindLibWpd.cmake b/cmake/modules/FindLibWpd.cmake
+index 2a324cc..ed9bc26 100644
+--- a/cmake/modules/FindLibWpd.cmake
++++ b/cmake/modules/FindLibWpd.cmake
+@@ -8,31 +8,19 @@
+ #
+ 
+ include(LibFindMacros)
+-libfind_pkg_check_modules(WPD_PKGCONF libwpd-0.9)
+-libfind_pkg_check_modules(WPD_STREAM_PKGCONF libwpd-stream-0.9)
++libfind_pkg_check_modules(WPD_PKGCONF libwpd-0.10)
+ 
+ find_path(WPD_INCLUDE_DIR
+     NAMES libwpd/libwpd.h
+     HINTS ${WPD_PKGCONF_INCLUDE_DIRS} ${WPD_PKGCONF_INCLUDEDIR}
+-    PATH_SUFFIXES libwpd-0.9
+-)
+-
+-find_path(WPD_STREAM_INCLUDE_DIR
+-    NAMES libwpd-stream/libwpd-stream.h
+-    HINTS ${WPD_STREAM_PKGCONF_INCLUDE_DIRS} ${WPD_STREAM_PKGCONF_INCLUDEDIR}
+-    PATH_SUFFIXES libwpd-0.9
++    PATH_SUFFIXES libwpd-0.10
+ )
+ 
+ find_library(WPD_LIBRARY
+-    NAMES wpd libwpd wpd-0.9 libwpd-0.9
++    NAMES wpd libwpd wpd-0.10 libwpd-0.10
+     HINTS ${WPD_PKGCONF_LIBRARY_DIRS} ${WPD_PKGCONF_LIBDIR}
+ )
+ 
+-find_library(WPD_STREAM_LIBRARY
+-    NAMES wpd-stream libwpd-stream wpd-stream-0.9 libwpd-stream-0.9
+-    HINTS ${WPD_STREAM_PKGCONF_LIBRARY_DIRS} ${WPD_STREAM_PKGCONF_LIBDIR}
+-)
+-
+-set(LIBWPD_PROCESS_LIBS WPD_LIBRARY WPD_STREAM_LIBRARY)
+-set(LIBWPD_PROCESS_INCLUDES WPD_INCLUDE_DIR WPD_STREAM_INCLUDE_DIR)
++set(LIBWPD_PROCESS_LIBS WPD_LIBRARY)
++set(LIBWPD_PROCESS_INCLUDES WPD_INCLUDE_DIR)
+ libfind_process(LIBWPD)
+diff --git a/cmake/modules/FindLibWpg.cmake b/cmake/modules/FindLibWpg.cmake
+index 56d9302..16c2a1c 100644
+--- a/cmake/modules/FindLibWpg.cmake
++++ b/cmake/modules/FindLibWpg.cmake
+@@ -11,16 +11,16 @@
+ 
+ include(LibFindMacros)
+ libfind_package(LIBWPG LibWpd)
+-libfind_pkg_check_modules(LIBWPG_PKGCONF libwpg-0.2)
++libfind_pkg_check_modules(LIBWPG_PKGCONF libwpg-0.3)
+ 
+ find_path(LIBWPG_INCLUDE_DIR
+     NAMES libwpg/libwpg.h
+     HINTS ${LIBWPG_PKGCONF_INCLUDE_DIRS} ${LIBWPG_PKGCONF_INCLUDEDIR}
+-    PATH_SUFFIXES libwpg-0.2
++    PATH_SUFFIXES libwpg-0.3
+ )
+ 
+ find_library(LIBWPG_LIBRARY
+-    NAMES wpg wpg-0.2
++    NAMES wpg wpg-0.3
+     HINTS ${LIBWPG_PKGCONF_LIBRARY_DIRS} ${LIBWPG_PKGCONF_LIBDIR}
+ )
+ 
+diff --git a/cmake/modules/FindLibWps.cmake b/cmake/modules/FindLibWps.cmake
+index 149f34c..f8c8225 100644
+--- a/cmake/modules/FindLibWps.cmake
++++ b/cmake/modules/FindLibWps.cmake
+@@ -10,16 +10,16 @@
+ 
+ include(LibFindMacros)
+ libfind_package(LIBWPS LibWpd)
+-libfind_pkg_check_modules(LIBWPS_PKGCONF libwps-0.2)
++libfind_pkg_check_modules(LIBWPS_PKGCONF libwps-0.3)
+ 
+ find_path(LIBWPS_INCLUDE_DIR
+     NAMES libwps/libwps.h
+     HINTS ${LIBWPS_PKGCONF_INCLUDE_DIRS} ${LIBWPS_PKGCONF_INCLUDEDIR}
+-    PATH_SUFFIXES libwps-0.2
++    PATH_SUFFIXES libwps-0.3
+ )
+ 
+ find_library(LIBWPS_LIBRARY
+-    NAMES wps wps-0.2
++    NAMES wps wps-0.3
+     HINTS ${LIBWPS_PKGCONF_LIBRARY_DIRS} ${LIBWPS_PKGCONF_LIBDIR}
+ )
+ 
+diff --git a/filters/flow/visio/import/CMakeLists.txt b/filters/flow/visio/import/CMakeLists.txt
+index 1de4385..4c2a391 100644
+--- a/filters/flow/visio/import/CMakeLists.txt
++++ b/filters/flow/visio/import/CMakeLists.txt
+@@ -1,6 +1,7 @@
+ include_directories(
+     ../../../libodfhandler/
+     ${LIBODFGEN_INCLUDE_DIRS}
++    ${LIBREVENGE_INCLUDE_DIRS}
+     ${LIBVISIO_INCLUDE_DIRS}
+     ${KOMAIN_INCLUDES}
+ )
+@@ -15,7 +16,7 @@ set(vsdx2odg_PART_SRCS
+ 
+ kde4_add_plugin(calligra_filter_vsdx2odg ${vsdx2odg_PART_SRCS})
+ 
+-target_link_libraries(calligra_filter_vsdx2odg komain ${LIBODFGEN_LIBRARIES} ${LIBVISIO_LIBRARIES})
++target_link_libraries(calligra_filter_vsdx2odg komain ${LIBODFGEN_LIBRARIES} ${LIBREVENGE_LIBRARIES} ${LIBVISIO_LIBRARIES})
+ 
+ install(TARGETS calligra_filter_vsdx2odg DESTINATION ${PLUGIN_INSTALL_DIR})
+ install(FILES calligra_filter_vsdx2odg.desktop DESTINATION ${SERVICES_INSTALL_DIR})
+diff --git a/filters/flow/visio/import/VSDXImport.cpp b/filters/flow/visio/import/VSDXImport.cpp
+index 70a54d9..eb3a208 100644
+--- a/filters/flow/visio/import/VSDXImport.cpp
++++ b/filters/flow/visio/import/VSDXImport.cpp
+@@ -17,7 +17,7 @@
+ #include "VSDXImport.h"
+ 
+ #include <libvisio/libvisio.h>
+-#include <libodfgen/OdgGenerator.hxx>
++#include <libodfgen/libodfgen.hxx>
+ 
+ #include "OutputFileHelper.hxx"
+ #include <KoFilterChain.h>
+@@ -39,7 +39,7 @@ public:
+     ~OdgOutputFileHelper() {}
+ 
+ private:
+-    bool _isSupportedFormat(WPXInputStream *input, const char * /* password */)
++    bool _isSupportedFormat(librevenge::RVNGInputStream *input, const char * /* password */)
+     {
+         if (!libvisio::VisioDocument::isSupported(input))
+         {
+@@ -49,9 +49,10 @@ private:
+         return true;
+     }
+ 
+-    bool _convertDocument(WPXInputStream *input, const char * /* password */, OdfDocumentHandler *handler, OdfStreamType streamType)
++    bool _convertDocument(librevenge::RVNGInputStream *input, const char * /* password */, OdfDocumentHandler *handler, OdfStreamType streamType)
+     {
+-        OdgGenerator exporter(handler, streamType);
++        OdgGenerator exporter;
++        exporter.addDocumentHandler(handler, streamType);
+         return libvisio::VisioDocument::parse(input, &exporter);
+     }
+ };
+diff --git a/filters/flow/wpg/import/CMakeLists.txt b/filters/flow/wpg/import/CMakeLists.txt
+index 524d1b1..e2ee2a5 100644
+--- a/filters/flow/wpg/import/CMakeLists.txt
++++ b/filters/flow/wpg/import/CMakeLists.txt
+@@ -1,6 +1,7 @@
+ include_directories(
+     ../../../libodfhandler/
+     ${LIBODFGEN_INCLUDE_DIRS}
++    ${LIBREVENGE_INCLUDE_DIRS}
+     ${LIBVISIO_INCLUDE_DIRS}
+     ${KOMAIN_INCLUDES}
+ )
+@@ -15,7 +16,7 @@ set(wpg2odg_PART_SRCS
+ 
+ kde4_add_plugin(calligra_filter_wpg2odg ${wpg2odg_PART_SRCS})
+ 
+-target_link_libraries(calligra_filter_wpg2odg komain ${LIBODFGEN_LIBRARIES} ${LIBWPG_LIBRARIES})
++target_link_libraries(calligra_filter_wpg2odg komain ${LIBODFGEN_LIBRARIES} ${LIBREVENGE_LIBRARIES} ${LIBWPG_LIBRARIES})
+ 
+ install(TARGETS calligra_filter_wpg2odg DESTINATION ${PLUGIN_INSTALL_DIR})
+ install(FILES calligra_filter_wpg2odg.desktop DESTINATION ${SERVICES_INSTALL_DIR})
+diff --git a/filters/flow/wpg/import/WPGImport.cpp b/filters/flow/wpg/import/WPGImport.cpp
+index b4e0fa7..563ae6e 100644
+--- a/filters/flow/wpg/import/WPGImport.cpp
++++ b/filters/flow/wpg/import/WPGImport.cpp
+@@ -17,7 +17,7 @@
+ #include "WPGImport.h"
+ 
+ #include <libwpg/libwpg.h>
+-#include <libodfgen/OdgGenerator.hxx>
++#include <libodfgen/libodfgen.hxx>
+ 
+ #include "OutputFileHelper.hxx"
+ #include <KoFilterChain.h>
+@@ -39,7 +39,7 @@ public:
+     ~OdgOutputFileHelper() {}
+ 
+ private:
+-    bool _isSupportedFormat(WPXInputStream *input, const char * /* password */)
++    bool _isSupportedFormat(librevenge::RVNGInputStream *input, const char * /* password */)
+     {
+         if (!libwpg::WPGraphics::isSupported(input))
+         {
+@@ -49,9 +49,10 @@ private:
+         return true;
+     }
+ 
+-    bool _convertDocument(WPXInputStream *input, const char * /* password */, OdfDocumentHandler *handler, OdfStreamType streamType)
++    bool _convertDocument(librevenge::RVNGInputStream *input, const char * /* password */, OdfDocumentHandler *handler, OdfStreamType streamType)
+     {
+-        OdgGenerator exporter(handler, streamType);
++        OdgGenerator exporter;
++        exporter.addDocumentHandler(handler, streamType);
+         return libwpg::WPGraphics::parse(input, &exporter);
+     }
+ };
+diff --git a/filters/karbon/wpg/CMakeLists.txt b/filters/karbon/wpg/CMakeLists.txt
+index 5f578e9..ffa7742 100644
+--- a/filters/karbon/wpg/CMakeLists.txt
++++ b/filters/karbon/wpg/CMakeLists.txt
+@@ -1,11 +1,11 @@
+ 
+-include_directories(${CMAKE_BINARY_DIR}/filters/ ${LIBWPD_INCLUDE_DIRS} ${LIBWPG_INCLUDE_DIR}/)
++include_directories(${CMAKE_BINARY_DIR}/filters/ ${LIBREVENGE_INCLUDE_DIRS} ${LIBWPG_INCLUDE_DIR}/)
+ 
+ set(wpg2svg_PART_SRCS WPGImport.cpp)
+ 
+ kde4_add_plugin(calligra_filter_wpg2svg ${wpg2svg_PART_SRCS})
+ 
+-target_link_libraries(calligra_filter_wpg2svg komain ${LIBWPG_LIBRARIES} ${LIBWPG_STREAM_LIBRARIES} ${LIBWPD_LIBRARIES})
++target_link_libraries(calligra_filter_wpg2svg komain ${LIBWPG_LIBRARIES} ${LIBREVENGE_LIBRARIES})
+ 
+ install(TARGETS calligra_filter_wpg2svg DESTINATION ${PLUGIN_INSTALL_DIR})
+ install(FILES calligra_filter_wpg2svg.desktop DESTINATION ${SERVICES_INSTALL_DIR})
+diff --git a/filters/karbon/wpg/WPGImport.cpp b/filters/karbon/wpg/WPGImport.cpp
+index f1852ee..4457bec 100644
+--- a/filters/karbon/wpg/WPGImport.cpp
++++ b/filters/karbon/wpg/WPGImport.cpp
+@@ -32,14 +32,12 @@
+ #include <QString>
+ #include <QFile>
+ 
++#include <librevenge/librevenge.h>
++#include <librevenge-stream/librevenge-stream.h>
++
+ #include <libwpg/libwpg.h>
+-#if LIBWPG_VERSION_MINOR<2
+-#include <libwpg/WPGStreamImplementation.h>
+-#else
+-#include <libwpd-stream/libwpd-stream.h>
+-#include <libwpd/libwpd.h>
+-#endif
+ 
++#include <cassert>
+ #include <iostream>
+ 
+ K_PLUGIN_FACTORY(WPGImportFactory, registerPlugin<WPGImport>();)
+@@ -63,39 +61,29 @@ KoFilter::ConversionStatus WPGImport::convert(const QByteArray& from, const QByt
+     if (to != "image/svg+xml")
+         return KoFilter::NotImplemented;
+ 
+-#if LIBWPG_VERSION_MINOR<2
+-    WPXInputStream* input = new libwpg::WPGFileStream(m_chain->inputFile().toLocal8Bit());
+-    if (input->isOLEStream()) {
+-        WPXInputStream* olestream = input->getDocumentOLEStream();
+-        if (olestream) {
+-            delete input;
+-            input = olestream;
+-        }
+-    }
+-    libwpg::WPGString output;
+-#else
+-    WPXInputStream* input = new WPXFileStream(m_chain->inputFile().toLocal8Bit());
+-    if (input->isOLEStream()) {
+-        WPXInputStream* olestream = input->getDocumentOLEStream("Anything");
++    librevenge::RVNGInputStream* input = new librevenge::RVNGFileStream(m_chain->inputFile().toLocal8Bit());
++    if (input->isStructured()) {
++        librevenge::RVNGInputStream* olestream = input->getSubStreamByName("Anything");
+         if (olestream) {
+             delete input;
+             input = olestream;
+         }
+      }
+-     ::WPXString output;
+-#endif
+-
+     if (!libwpg::WPGraphics::isSupported(input)) {
+         kWarning() << "ERROR: Unsupported file format (unsupported version) or file is encrypted!";
+         delete input;
+         return KoFilter::NotImplemented;
+     }
+ 
+-    if (!libwpg::WPGraphics::generateSVG(input, output)) {
++     ::librevenge::RVNGStringVector output;
++     librevenge::RVNGSVGDrawingGenerator generator(output, "");
++
++    if (!libwpg::WPGraphics::parse(input, &generator)) {
+         kWarning() << "ERROR: SVG Generation failed!";
+         delete input;
+         return KoFilter::ParsingError;
+     }
++    assert(1 == output.size());
+ 
+     delete input;
+ 
+@@ -104,7 +92,8 @@ KoFilter::ConversionStatus WPGImport::convert(const QByteArray& from, const QByt
+         kWarning() << "ERROR: Could not open output file" << m_chain->outputFile();
+         return KoFilter::InternalError;
+     }
+-    outputFile.write(output.cstr());
++    outputFile.write("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\" \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\";>\n");
++    outputFile.write(output[0].cstr());
+     outputFile.close();
+ 
+     return KoFilter::OK;
+diff --git a/filters/libodfhandler/DiskDocumentHandler.cxx b/filters/libodfhandler/DiskDocumentHandler.cxx
+index e035fdc..f8ca273 100644
+--- a/filters/libodfhandler/DiskDocumentHandler.cxx
++++ b/filters/libodfhandler/DiskDocumentHandler.cxx
+@@ -37,7 +37,7 @@ DiskOdfDocumentHandler::DiskOdfDocumentHandler(FemtoZip *pOutput) :
+ {
+ }
+ 
+-void DiskOdfDocumentHandler::startElement(const char *psName, const WPXPropertyList &xPropList)
++void DiskOdfDocumentHandler::startElement(const char *psName, const librevenge::RVNGPropertyList &xPropList)
+ {
+ 	if (mbIsTagOpened)
+ 	{
+@@ -46,11 +46,11 @@ void DiskOdfDocumentHandler::startElement(const char *psName, const WPXPropertyL
+ 	}
+ 	PUTSTRING("<");
+ 	PUTSTRING(psName);
+-	WPXPropertyList::Iter i(xPropList);
++	librevenge::RVNGPropertyList::Iter i(xPropList);
+ 	for (i.rewind(); i.next(); )
+ 	{
+-		// filter out libwpd elements
+-		if (strncmp(i.key(), "libwpd", 6) != 0)
++		// filter out librevenge properties
++		if (strncmp(i.key(), "librevenge", 10) != 0)
+ 		{
+ 			PUTSTRING(" ");
+ 			PUTSTRING(i.key());
+@@ -91,14 +91,15 @@ void DiskOdfDocumentHandler::endElement(const char *psName)
+ 	}
+ }
+ 
+-void DiskOdfDocumentHandler::characters(const WPXString &sCharacters)
++void DiskOdfDocumentHandler::characters(const librevenge::RVNGString &sCharacters)
+ {
+ 	if (mbIsTagOpened)
+ 	{
+ 		PUTSTRING(">");
+ 		mbIsTagOpened = false;
+ 	}
+-	WPXString sEscapedCharacters(sCharacters, true);
++	librevenge::RVNGString sEscapedCharacters;
++	sEscapedCharacters.appendEscapedXML(sCharacters);
+ 	if (sEscapedCharacters.len() > 0)
+ 		PUTSTRING(sEscapedCharacters.cstr());
+ }
+diff --git a/filters/libodfhandler/DiskDocumentHandler.hxx b/filters/libodfhandler/DiskDocumentHandler.hxx
+index 17f7eb7..d52a256 100644
+--- a/filters/libodfhandler/DiskDocumentHandler.hxx
++++ b/filters/libodfhandler/DiskDocumentHandler.hxx
+@@ -23,7 +23,7 @@
+ #ifndef _DISKDOCUMENTHANDLER_H
+ #define _DISKDOCUMENTHANDLER_H
+ 
+-#include <libodfgen/OdfDocumentHandler.hxx>
++#include <libodfgen/libodfgen.hxx>
+ 
+ #ifdef HAVE_CONFIG_H
+ #include "config.h"
+@@ -45,9 +45,9 @@ public:
+ #endif
+ 	virtual void startDocument() {}
+ 	virtual void endDocument();
+-	virtual void startElement(const char *psName, const WPXPropertyList &xPropList);
++	virtual void startElement(const char *psName, const librevenge::RVNGPropertyList &xPropList);
+ 	virtual void endElement(const char *psName);
+-	virtual void characters(const WPXString &sCharacters);
++	virtual void characters(const librevenge::RVNGString &sCharacters);
+ 
+ private:
+ 	DiskOdfDocumentHandler(DiskOdfDocumentHandler const &);
+@@ -58,7 +58,7 @@ private:
+ 	FemtoZip *mpOutput;
+ #endif
+ 	bool mbIsTagOpened;
+-	WPXString msOpenedTagName;
++	librevenge::RVNGString msOpenedTagName;
+ };
+ #endif
+ 
+diff --git a/filters/libodfhandler/OutputFileHelper.cxx b/filters/libodfhandler/OutputFileHelper.cxx
+index 8786d4c..61e48e9 100644
+--- a/filters/libodfhandler/OutputFileHelper.cxx
++++ b/filters/libodfhandler/OutputFileHelper.cxx
+@@ -37,7 +37,7 @@
+ 
+ #include "DiskDocumentHandler.hxx"
+ #include "StdOutHandler.hxx"
+-#include <libwpd-stream/WPXStreamImplementation.h>
++#include <librevenge-stream/librevenge-stream.h>
+ 
+ struct OutputFileHelperImpl
+ {
+@@ -197,12 +197,12 @@ bool OutputFileHelper::writeChildFile(const char *childFileName, const char *str
+ 
+ bool OutputFileHelper::writeConvertedContent(const char *childFileName, const char *inFileName, const OdfStreamType streamType)
+ {
+-	WPXFileStream input(inFileName);
++	librevenge::RVNGFileStream input(inFileName);
+ 
+ 	if (!_isSupportedFormat(&input, m_impl->mpPassword))
+ 		return false;
+ 
+-	input.seek(0, WPX_SEEK_SET);
++	input.seek(0, librevenge::RVNG_SEEK_SET);
+ 
+ 	OdfDocumentHandler *pHandler;
+ #ifdef USE_GSF_OUTPUT
+diff --git a/filters/libodfhandler/OutputFileHelper.hxx b/filters/libodfhandler/OutputFileHelper.hxx
+index a61b9a0..d2632a9 100644
+--- a/filters/libodfhandler/OutputFileHelper.hxx
++++ b/filters/libodfhandler/OutputFileHelper.hxx
+@@ -22,9 +22,10 @@
+ #ifndef _OUTPUTFILEHELPER_HXX
+ #define _OUTPUTFILEHELPER_HXX
+ 
+-#include <libodfgen/OdfDocumentHandler.hxx>
++#include <libodfgen/libodfgen.hxx>
++
++#include <librevenge-stream/librevenge-stream.h>
+ 
+-class WPXInputStream;
+ struct OutputFileHelperImpl;
+ 
+ class OutputFileHelper
+@@ -38,8 +39,8 @@ public:
+ 	bool writeConvertedContent(const char *childFileName, const char *inFileName, const OdfStreamType streamType);
+ 
+ private:
+-	virtual bool _isSupportedFormat(WPXInputStream *input, const char *password) = 0;
+-	virtual bool _convertDocument(WPXInputStream *input, const char *password, OdfDocumentHandler *handler, const OdfStreamType streamType) = 0;
++	virtual bool _isSupportedFormat(librevenge::RVNGInputStream *input, const char *password) = 0;
++	virtual bool _convertDocument(librevenge::RVNGInputStream *input, const char *password, OdfDocumentHandler *handler, const OdfStreamType streamType) = 0;
+ 	OutputFileHelperImpl *m_impl;
+ 
+ private:
+diff --git a/filters/libodfhandler/StdOutHandler.cxx b/filters/libodfhandler/StdOutHandler.cxx
+index 6864266..16e19f0 100644
+--- a/filters/libodfhandler/StdOutHandler.cxx
++++ b/filters/libodfhandler/StdOutHandler.cxx
+@@ -31,7 +31,7 @@ StdOutHandler::StdOutHandler() :
+ 	printf("<?xml version=\"1.0\"?>\n");
+ }
+ 
+-void StdOutHandler::startElement(const char *psName, const WPXPropertyList &xPropList)
++void StdOutHandler::startElement(const char *psName, const librevenge::RVNGPropertyList &xPropList)
+ {
+ 	if (mbIsTagOpened)
+ 	{
+@@ -39,11 +39,11 @@ void StdOutHandler::startElement(const char *psName, const WPXPropertyList &xPro
+ 		mbIsTagOpened = false;
+ 	}
+ 	printf("<%s", psName);
+-	WPXPropertyList::Iter i(xPropList);
++	librevenge::RVNGPropertyList::Iter i(xPropList);
+ 	for (i.rewind(); i.next(); )
+ 	{
+-		// filter out libwpd elements
+-		if (strncmp(i.key(), "libwpd", 6) != 0)
++		// filter out librevenge properties
++		if (strncmp(i.key(), "librevenge", 10) != 0)
+ 			printf(" %s=\"%s\"", i.key(), i()->getStr().cstr());
+ 	}
+ 	mbIsTagOpened = true;
+@@ -73,15 +73,14 @@ void StdOutHandler::endElement(const char *psName)
+ 	}
+ }
+ 
+-void StdOutHandler::characters(const WPXString &sCharacters)
++void StdOutHandler::characters(const librevenge::RVNGString &sCharacters)
+ {
+ 	if (mbIsTagOpened)
+ 	{
+ 		printf(">");
+ 		mbIsTagOpened = false;
+ 	}
+-	WPXString sEscapedCharacters(sCharacters, true);
+-	printf("%s", sEscapedCharacters.cstr());
++	printf("%s", librevenge::RVNGString::escapeXML(sCharacters).cstr());
+ }
+ 
+ void StdOutHandler::endDocument()
+diff --git a/filters/libodfhandler/StdOutHandler.hxx b/filters/libodfhandler/StdOutHandler.hxx
+index a18189a..44fa1e7 100644
+--- a/filters/libodfhandler/StdOutHandler.hxx
++++ b/filters/libodfhandler/StdOutHandler.hxx
+@@ -23,7 +23,7 @@
+ #ifndef _STDOUTHANDLER_H
+ #define _STDOUTHANDLER_H
+ 
+-#include <libodfgen/OdfDocumentHandler.hxx>
++#include <libodfgen/libodfgen.hxx>
+ 
+ class StdOutHandler : public OdfDocumentHandler
+ {
+@@ -31,12 +31,12 @@ public:
+ 	StdOutHandler();
+ 	virtual void startDocument() {}
+ 	virtual void endDocument();
+-	virtual void startElement(const char *psName, const WPXPropertyList &xPropList);
++	virtual void startElement(const char *psName, const librevenge::RVNGPropertyList &xPropList);
+ 	virtual void endElement(const char *psName);
+-	virtual void characters(const WPXString &sCharacters);
++	virtual void characters(const librevenge::RVNGString &sCharacters);
+ private:
+ 	bool mbIsTagOpened;
+-	WPXString msOpenedTagName;
++	librevenge::RVNGString msOpenedTagName;
+ };
+ #endif
+ 
+diff --git a/filters/words/wordperfect/import/CMakeLists.txt b/filters/words/wordperfect/import/CMakeLists.txt
+index 6a0e2d7..ffb3c70 100644
+--- a/filters/words/wordperfect/import/CMakeLists.txt
++++ b/filters/words/wordperfect/import/CMakeLists.txt
+@@ -1,6 +1,7 @@
+ include_directories(
+     ../../../libodfhandler/
+     ${LIBODFGEN_INCLUDE_DIRS}
++    ${LIBREVENGE_INCLUDE_DIRS}
+     ${LIBWPD_INCLUDE_DIRS}
+     ${LIBWPG_INCLUDE_DIRS}
+     ${KOMAIN_INCLUDES}
+@@ -17,7 +18,7 @@ set(wpd2odt_PART_SRCS
+ kde4_add_plugin(calligra_filter_wpd2odt ${wpd2odt_PART_SRCS})
+ 
+ target_link_libraries(calligra_filter_wpd2odt
+-    komain ${LIBODFGEN_LIBRARIES} ${LIBWPD_LIBRARIES} ${LIBWPG_LIBRARIES})
++    komain ${LIBODFGEN_LIBRARIES} ${LIBREVENGE_LIBRARIES} ${LIBWPD_LIBRARIES} ${LIBWPG_LIBRARIES})
+ 
+ install(TARGETS calligra_filter_wpd2odt DESTINATION ${PLUGIN_INSTALL_DIR})
+ 
+diff --git a/filters/words/wordperfect/import/WPDImport.cpp b/filters/words/wordperfect/import/WPDImport.cpp
+index af9d9b6..edf1c91 100644
+--- a/filters/words/wordperfect/import/WPDImport.cpp
++++ b/filters/words/wordperfect/import/WPDImport.cpp
+@@ -18,8 +18,7 @@
+ 
+ #include <libwpd/libwpd.h>
+ #include <libwpg/libwpg.h>
+-#include <libodfgen/OdtGenerator.hxx>
+-#include <libodfgen/OdgGenerator.hxx>
++#include <libodfgen/libodfgen.hxx>
+ 
+ #include <OutputFileHelper.hxx>
+ #include <KoFilterChain.h>
+@@ -31,6 +30,7 @@
+ #include <QString>
+ #include <QByteArray>
+ 
++#include <cassert>
+ #include <stdio.h>
+ 
+ class OdtOutputFileHelper : public OutputFileHelper
+@@ -41,20 +41,20 @@ public:
+     ~OdtOutputFileHelper() {};
+ 
+ private:
+-    bool _isSupportedFormat(WPXInputStream *input, const char *password)
++    bool _isSupportedFormat(librevenge::RVNGInputStream *input, const char *password)
+     {
+-        WPDConfidence confidence = WPDocument::isFileFormatSupported(input);
+-        if (WPD_CONFIDENCE_EXCELLENT != confidence && WPD_CONFIDENCE_SUPPORTED_ENCRYPTION != confidence)
++        libwpd::WPDConfidence confidence = libwpd::WPDocument::isFileFormatSupported(input);
++        if (libwpd::WPD_CONFIDENCE_EXCELLENT != confidence && libwpd::WPD_CONFIDENCE_SUPPORTED_ENCRYPTION != confidence)
+         {
+             fprintf(stderr, "ERROR: We have no confidence that you are giving us a valid WordPerfect document.\n");
+             return false;
+         }
+-        if (WPD_CONFIDENCE_SUPPORTED_ENCRYPTION == confidence && !password)
++        if (libwpd::WPD_CONFIDENCE_SUPPORTED_ENCRYPTION == confidence && !password)
+         {
+             fprintf(stderr, "ERROR: The WordPerfect document is encrypted and you did not give us a password.\n");
+             return false;
+         }
+-        if (confidence == WPD_CONFIDENCE_SUPPORTED_ENCRYPTION && password && (WPD_PASSWORD_MATCH_OK != WPDocument::verifyPassword(input, password)))
++        if (confidence == libwpd::WPD_CONFIDENCE_SUPPORTED_ENCRYPTION && password && (libwpd::WPD_PASSWORD_MATCH_OK != libwpd::WPDocument::verifyPassword(input, password)))
+         {
+             fprintf(stderr, "ERROR: The WordPerfect document is encrypted and we either\n");
+             fprintf(stderr, "ERROR: don't know how to decrypt it or the given password is wrong.\n");
+@@ -64,41 +64,47 @@ private:
+         return true;
+     }
+ 
+-    static bool handleEmbeddedWPGObject(const WPXBinaryData &data, OdfDocumentHandler *pHandler,  const OdfStreamType streamType)
++    static bool handleEmbeddedWPGObject(const librevenge::RVNGBinaryData &data, OdfDocumentHandler *pHandler,  const OdfStreamType streamType)
+     {
+-        OdgGenerator exporter(pHandler, streamType);
++        OdgGenerator exporter;
++        exporter.addDocumentHandler(pHandler, streamType);
+ 
+         libwpg::WPGFileFormat fileFormat = libwpg::WPG_AUTODETECT;
+ 
+-        if (!libwpg::WPGraphics::isSupported(const_cast<WPXInputStream *>(data.getDataStream())))
++        if (!libwpg::WPGraphics::isSupported(const_cast<librevenge::RVNGInputStream *>(data.getDataStream())))
+             fileFormat = libwpg::WPG_WPG1;
+ 
+-        return libwpg::WPGraphics::parse(const_cast<WPXInputStream *>(data.getDataStream()), &exporter, fileFormat);
++        return libwpg::WPGraphics::parse(const_cast<librevenge::RVNGInputStream *>(data.getDataStream()), &exporter, fileFormat);
+     }
+ 
+-    static bool handleEmbeddedWPGImage(const WPXBinaryData &input, WPXBinaryData &output)
++    static bool handleEmbeddedWPGImage(const librevenge::RVNGBinaryData &input, librevenge::RVNGBinaryData &output)
+     {
+-        WPXString svgOutput;
+         libwpg::WPGFileFormat fileFormat = libwpg::WPG_AUTODETECT;
+ 
+-        if (!libwpg::WPGraphics::isSupported(const_cast<WPXInputStream *>(input.getDataStream())))
++        if (!libwpg::WPGraphics::isSupported(const_cast<librevenge::RVNGInputStream *>(input.getDataStream())))
+             fileFormat = libwpg::WPG_WPG1;
+ 
+-        if (!libwpg::WPGraphics::generateSVG(const_cast<WPXInputStream *>(input.getDataStream()), svgOutput, fileFormat))
++        librevenge::RVNGStringVector svgOutput;
++        librevenge::RVNGSVGDrawingGenerator generator(svgOutput, "");
++        if (!libwpg::WPGraphics::parse(const_cast<librevenge::RVNGInputStream *>(input.getDataStream()), &generator, fileFormat))
+             return false;
++        assert(1 == svgOutput.size());
+ 
+         output.clear();
+-        output.append((unsigned char *)svgOutput.cstr(), strlen(svgOutput.cstr()));
++        const librevenge::RVNGString svgPrefix("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\" \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\";>\n");
++        output.append((unsigned char *)svgPrefix.cstr(), svgPrefix.size());
++        output.append((unsigned char *)svgOutput[0].cstr(), svgOutput[0].size());
+ 
+         return true;
+     }
+ 
+-    bool _convertDocument(WPXInputStream *input, const char *password, OdfDocumentHandler *handler, const OdfStreamType streamType)
++    bool _convertDocument(librevenge::RVNGInputStream *input, const char *password, OdfDocumentHandler *handler, const OdfStreamType streamType)
+     {
+-        OdtGenerator collector(handler, streamType);
++        OdtGenerator collector;
++        collector.addDocumentHandler(handler, streamType);
+         collector.registerEmbeddedObjectHandler("image/x-wpg", &handleEmbeddedWPGObject);
+         collector.registerEmbeddedImageHandler("image/x-wpg", &handleEmbeddedWPGImage);
+-        if (WPD_OK == WPDocument::parse(input, &collector, password))
++        if (libwpd::WPD_OK == libwpd::WPDocument::parse(input, &collector, password))
+             return true;
+         return false;
+     }
+diff --git a/filters/words/works/import/CMakeLists.txt b/filters/words/works/import/CMakeLists.txt
+index 76317ae..2c51937 100644
+--- a/filters/words/works/import/CMakeLists.txt
++++ b/filters/words/works/import/CMakeLists.txt
+@@ -1,6 +1,7 @@
+ include_directories(
+     ../../../libodfhandler/
+     ${LIBODFGEN_INCLUDE_DIRS}
++    ${LIBREVENGE_INCLUDE_DIRS}
+     ${LIBWPS_INCLUDE_DIRS}
+     ${KOMAIN_INCLUDES}
+ )
+@@ -15,7 +16,7 @@ set(wps2odt_PART_SRCS
+ 
+ kde4_add_plugin(calligra_filter_wps2odt ${wps2odt_PART_SRCS})
+ 
+-target_link_libraries(calligra_filter_wps2odt komain ${LIBODFGEN_LIBRARIES} ${LIBWPS_LIBRARIES})
++target_link_libraries(calligra_filter_wps2odt komain ${LIBODFGEN_LIBRARIES} ${LIBREVENGE_LIBRARIES} ${LIBWPS_LIBRARIES})
+ 
+ install(TARGETS calligra_filter_wps2odt DESTINATION ${PLUGIN_INSTALL_DIR})
+ install(FILES calligra_filter_wps2odt.desktop DESTINATION ${SERVICES_INSTALL_DIR})
+diff --git a/filters/words/works/import/WPSImport.cpp b/filters/words/works/import/WPSImport.cpp
+index c2058e5..545daf3 100644
+--- a/filters/words/works/import/WPSImport.cpp
++++ b/filters/words/works/import/WPSImport.cpp
+@@ -16,9 +16,9 @@
+ 
+ #include "WPSImport.h"
+ 
+-#include <libwpd/libwpd.h>
++#include <librevenge/librevenge.h>
+ #include <libwps/libwps.h>
+-#include <libodfgen/OdtGenerator.hxx>
++#include <libodfgen/libodfgen.hxx>
+ 
+ #include "OutputFileHelper.hxx"
+ #include <KoFilterChain.h>
+@@ -40,10 +40,11 @@ public:
+     ~OdtOutputFileHelper() {};
+ 
+ private:
+-    bool _isSupportedFormat(WPXInputStream *input, const char * /* password */)
++    bool _isSupportedFormat(librevenge::RVNGInputStream *input, const char * /* password */)
+     {
+-        WPSConfidence confidence = WPSDocument::isFileFormatSupported(input);
+-        if (confidence == WPS_CONFIDENCE_NONE || confidence == WPS_CONFIDENCE_POOR)
++        libwps::WPSKind kind = libwps::WPS_TEXT;
++        libwps::WPSConfidence confidence = libwps::WPSDocument::isFileFormatSupported(input, kind);
++        if ((libwps::WPS_TEXT != kind) || (confidence != libwps::WPS_CONFIDENCE_EXCELLENT))
+         {
+             fprintf(stderr, "ERROR: We have no confidence that you are giving us a valid Microsoft Works document.\n");
+             return false;
+@@ -52,10 +53,11 @@ private:
+         return true;
+     }
+ 
+-    bool _convertDocument(WPXInputStream *input, const char * /* password */, OdfDocumentHandler *handler, const OdfStreamType streamType)
++    bool _convertDocument(librevenge::RVNGInputStream *input, const char * /* password */, OdfDocumentHandler *handler, const OdfStreamType streamType)
+     {
+-        OdtGenerator collector(handler, streamType);
+-        if (WPS_OK == WPSDocument::parse(input, &collector))
++        OdtGenerator collector;
++        collector.addDocumentHandler(handler, streamType);
++        if (libwps::WPS_OK == libwps::WPSDocument::parse(input, &collector))
+             return true;
+         return false;
+     }
+-- 
+1.9.3
+
-- 
2.0.1


Reply to: