Package: calligra / 1:2.8.5+dfsg-1

switch-to-librevenge-based-import-libs.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
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

Index: calligra/CMakeLists.txt
===================================================================
--- calligra.orig/CMakeLists.txt	2014-07-12 22:58:04.973749026 +0200
+++ calligra/CMakeLists.txt	2014-07-12 22:58:04.965749343 +0200
@@ -661,6 +661,16 @@
 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)
Index: calligra/cmake/modules/FindLibEtonyek.cmake
===================================================================
--- calligra.orig/cmake/modules/FindLibEtonyek.cmake	2014-07-12 22:58:04.973749026 +0200
+++ calligra/cmake/modules/FindLibEtonyek.cmake	2014-07-12 22:58:04.965749343 +0200
@@ -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}
 )
 
Index: calligra/cmake/modules/FindLibOdfGen.cmake
===================================================================
--- calligra.orig/cmake/modules/FindLibOdfGen.cmake	2014-07-12 22:58:04.973749026 +0200
+++ calligra/cmake/modules/FindLibOdfGen.cmake	2014-07-12 22:58:04.965749343 +0200
@@ -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}
 )
 
Index: calligra/cmake/modules/FindLibRevenge.cmake
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ calligra/cmake/modules/FindLibRevenge.cmake	2014-07-12 22:58:04.965749343 +0200
@@ -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)
Index: calligra/cmake/modules/FindLibVisio.cmake
===================================================================
--- calligra.orig/cmake/modules/FindLibVisio.cmake	2014-07-12 22:58:04.973749026 +0200
+++ calligra/cmake/modules/FindLibVisio.cmake	2014-07-12 22:58:04.965749343 +0200
@@ -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}
 )
 
Index: calligra/cmake/modules/FindLibWpd.cmake
===================================================================
--- calligra.orig/cmake/modules/FindLibWpd.cmake	2014-07-12 22:58:04.973749026 +0200
+++ calligra/cmake/modules/FindLibWpd.cmake	2014-07-12 22:58:04.965749343 +0200
@@ -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)
Index: calligra/cmake/modules/FindLibWpg.cmake
===================================================================
--- calligra.orig/cmake/modules/FindLibWpg.cmake	2014-07-12 22:58:04.973749026 +0200
+++ calligra/cmake/modules/FindLibWpg.cmake	2014-07-12 22:58:04.965749343 +0200
@@ -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}
 )
 
Index: calligra/cmake/modules/FindLibWps.cmake
===================================================================
--- calligra.orig/cmake/modules/FindLibWps.cmake	2014-07-12 22:58:04.973749026 +0200
+++ calligra/cmake/modules/FindLibWps.cmake	2014-07-12 22:58:04.965749343 +0200
@@ -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}
 )
 
Index: calligra/filters/flow/visio/import/CMakeLists.txt
===================================================================
--- calligra.orig/filters/flow/visio/import/CMakeLists.txt	2014-07-12 22:58:04.973749026 +0200
+++ calligra/filters/flow/visio/import/CMakeLists.txt	2014-07-12 22:58:04.965749343 +0200
@@ -1,6 +1,7 @@
 include_directories(
     ../../../libodfhandler/
     ${LIBODFGEN_INCLUDE_DIRS}
+    ${LIBREVENGE_INCLUDE_DIRS}
     ${LIBVISIO_INCLUDE_DIRS}
     ${KOMAIN_INCLUDES}
 )
@@ -15,7 +16,7 @@
 
 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})
Index: calligra/filters/flow/visio/import/VSDXImport.cpp
===================================================================
--- calligra.orig/filters/flow/visio/import/VSDXImport.cpp	2014-07-12 22:58:04.973749026 +0200
+++ calligra/filters/flow/visio/import/VSDXImport.cpp	2014-07-12 22:58:04.965749343 +0200
@@ -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 @@
     ~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 @@
         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);
     }
 };
Index: calligra/filters/flow/wpg/import/CMakeLists.txt
===================================================================
--- calligra.orig/filters/flow/wpg/import/CMakeLists.txt	2014-07-12 22:58:04.973749026 +0200
+++ calligra/filters/flow/wpg/import/CMakeLists.txt	2014-07-12 22:58:04.965749343 +0200
@@ -1,6 +1,7 @@
 include_directories(
     ../../../libodfhandler/
     ${LIBODFGEN_INCLUDE_DIRS}
+    ${LIBREVENGE_INCLUDE_DIRS}
     ${LIBVISIO_INCLUDE_DIRS}
     ${KOMAIN_INCLUDES}
 )
@@ -15,7 +16,7 @@
 
 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})
Index: calligra/filters/flow/wpg/import/WPGImport.cpp
===================================================================
--- calligra.orig/filters/flow/wpg/import/WPGImport.cpp	2014-07-12 22:58:04.973749026 +0200
+++ calligra/filters/flow/wpg/import/WPGImport.cpp	2014-07-12 22:58:04.965749343 +0200
@@ -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 @@
     ~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 @@
         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);
     }
 };
Index: calligra/filters/karbon/wpg/CMakeLists.txt
===================================================================
--- calligra.orig/filters/karbon/wpg/CMakeLists.txt	2014-07-12 22:58:04.973749026 +0200
+++ calligra/filters/karbon/wpg/CMakeLists.txt	2014-07-12 22:58:04.965749343 +0200
@@ -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})
Index: calligra/filters/karbon/wpg/WPGImport.cpp
===================================================================
--- calligra.orig/filters/karbon/wpg/WPGImport.cpp	2014-07-12 22:58:04.973749026 +0200
+++ calligra/filters/karbon/wpg/WPGImport.cpp	2014-07-12 22:58:04.965749343 +0200
@@ -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 @@
     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 @@
         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;
Index: calligra/filters/libodfhandler/DiskDocumentHandler.cxx
===================================================================
--- calligra.orig/filters/libodfhandler/DiskDocumentHandler.cxx	2014-07-12 22:58:04.973749026 +0200
+++ calligra/filters/libodfhandler/DiskDocumentHandler.cxx	2014-07-12 22:58:04.965749343 +0200
@@ -37,7 +37,7 @@
 {
 }
 
-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 @@
 	}
 	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::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());
 }
Index: calligra/filters/libodfhandler/DiskDocumentHandler.hxx
===================================================================
--- calligra.orig/filters/libodfhandler/DiskDocumentHandler.hxx	2014-07-12 22:58:04.973749026 +0200
+++ calligra/filters/libodfhandler/DiskDocumentHandler.hxx	2014-07-12 22:58:04.969749185 +0200
@@ -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 @@
 #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 @@
 	FemtoZip *mpOutput;
 #endif
 	bool mbIsTagOpened;
-	WPXString msOpenedTagName;
+	librevenge::RVNGString msOpenedTagName;
 };
 #endif
 
Index: calligra/filters/libodfhandler/OutputFileHelper.cxx
===================================================================
--- calligra.orig/filters/libodfhandler/OutputFileHelper.cxx	2014-07-12 22:58:04.973749026 +0200
+++ calligra/filters/libodfhandler/OutputFileHelper.cxx	2014-07-12 22:58:04.969749185 +0200
@@ -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::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
Index: calligra/filters/libodfhandler/OutputFileHelper.hxx
===================================================================
--- calligra.orig/filters/libodfhandler/OutputFileHelper.hxx	2014-07-12 22:58:04.973749026 +0200
+++ calligra/filters/libodfhandler/OutputFileHelper.hxx	2014-07-12 22:58:04.969749185 +0200
@@ -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 @@
 	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:
Index: calligra/filters/libodfhandler/StdOutHandler.cxx
===================================================================
--- calligra.orig/filters/libodfhandler/StdOutHandler.cxx	2014-07-12 22:58:04.973749026 +0200
+++ calligra/filters/libodfhandler/StdOutHandler.cxx	2014-07-12 22:58:04.969749185 +0200
@@ -31,7 +31,7 @@
 	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 @@
 		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::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()
Index: calligra/filters/libodfhandler/StdOutHandler.hxx
===================================================================
--- calligra.orig/filters/libodfhandler/StdOutHandler.hxx	2014-07-12 22:58:04.973749026 +0200
+++ calligra/filters/libodfhandler/StdOutHandler.hxx	2014-07-12 22:58:04.969749185 +0200
@@ -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 @@
 	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
 
Index: calligra/filters/words/wordperfect/import/CMakeLists.txt
===================================================================
--- calligra.orig/filters/words/wordperfect/import/CMakeLists.txt	2014-07-12 22:58:04.973749026 +0200
+++ calligra/filters/words/wordperfect/import/CMakeLists.txt	2014-07-12 22:58:04.969749185 +0200
@@ -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 @@
 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})
 
Index: calligra/filters/words/wordperfect/import/WPDImport.cpp
===================================================================
--- calligra.orig/filters/words/wordperfect/import/WPDImport.cpp	2014-07-12 22:58:04.973749026 +0200
+++ calligra/filters/words/wordperfect/import/WPDImport.cpp	2014-07-12 22:58:04.969749185 +0200
@@ -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 @@
     ~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 @@
         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;
     }
Index: calligra/filters/words/works/import/CMakeLists.txt
===================================================================
--- calligra.orig/filters/words/works/import/CMakeLists.txt	2014-07-12 22:58:04.973749026 +0200
+++ calligra/filters/words/works/import/CMakeLists.txt	2014-07-12 22:58:04.969749185 +0200
@@ -1,6 +1,7 @@
 include_directories(
     ../../../libodfhandler/
     ${LIBODFGEN_INCLUDE_DIRS}
+    ${LIBREVENGE_INCLUDE_DIRS}
     ${LIBWPS_INCLUDE_DIRS}
     ${KOMAIN_INCLUDES}
 )
@@ -15,7 +16,7 @@
 
 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})
Index: calligra/filters/words/works/import/WPSImport.cpp
===================================================================
--- calligra.orig/filters/words/works/import/WPSImport.cpp	2014-07-12 22:58:04.973749026 +0200
+++ calligra/filters/words/works/import/WPSImport.cpp	2014-07-12 22:58:04.969749185 +0200
@@ -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 @@
     ~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 @@
         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;
     }