Merge lp:~inkscape.dev/inkscape/inkscape-librevenge into lp:~inkscape.dev/inkscape/trunk
- inkscape-librevenge
- Merge into trunk
Status: | Merged |
---|---|
Approved by: | Bryce Harrington |
Approved revision: | 13408 |
Merged at revision: | 13621 |
Proposed branch: | lp:~inkscape.dev/inkscape/inkscape-librevenge |
Merge into: | lp:~inkscape.dev/inkscape/trunk |
Diff against target: |
438 lines (+179/-62) 5 files modified
configure.ac (+64/-21) src/extension/internal/cdr-input.cpp (+28/-8) src/extension/internal/vsd-input.cpp (+29/-8) src/extension/internal/wpg-input.cpp (+36/-21) src/ui/dialog/symbols.cpp (+22/-4) |
To merge this branch: | bzr merge lp:~inkscape.dev/inkscape/inkscape-librevenge |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Bryce Harrington (community) | code | Approve | |
su_v | Pending | ||
Review via email: mp+232193@code.launchpad.net |
This proposal supersedes a proposal from 2014-05-28.
Commit message
Description of the change
Port inkscape to librevenge framework for WPG, CDR and VSD imports
See also:
http://
http://
Thanks to Alex Valavanis the branch now supports conditional building with old or newer versions of libwpg, libcdr and libvisio, and does not introduce new requirements for dependencies which aren't available on current stable distros yet.
Branch compiled and tested successfully on OS X 10.7.5 with current stable releases (libwpg-2.0, libcdr 0.0, libvisio 0.0) and with git master of librevenge, libwpg, libcdr, libvisio.
su_v (suv-lp) wrote : Posted in a previous version of this proposal | # |
su_v (suv-lp) wrote : Posted in a previous version of this proposal | # |
Branch updated in r13405 to latest patch from bug #1323592 for conditional build.
Bryce Harrington (bryce) wrote : | # |
I did a quick code review of the patch and it all looks fine, if the testing of the three components is working.
This is Freeze Approved for landing in the 0.91 stable tree.
Preview Diff
1 | === modified file 'configure.ac' | |||
2 | --- configure.ac 2014-09-02 04:05:35 +0000 | |||
3 | +++ configure.ac 2014-09-19 00:35:56 +0000 | |||
4 | @@ -532,27 +532,32 @@ | |||
5 | 532 | with_libwpg=no | 532 | with_libwpg=no |
6 | 533 | 533 | ||
7 | 534 | if test "x$enable_wpg" = "xyes"; then | 534 | if test "x$enable_wpg" = "xyes"; then |
22 | 535 | PKG_CHECK_MODULES(LIBWPG01, libwpg-0.1 libwpg-stream-0.1, with_libwpg01=yes, with_libwpg01=no) | 535 | dnl ************************************************************** |
23 | 536 | if test "x$with_libwpg01" = "xyes"; then | 536 | dnl Try using librevenge framework first. Fall back to old libs |
24 | 537 | AC_DEFINE(WITH_LIBWPG01,1,[Build in libwpg 0.1.x]) | 537 | dnl if unavailable. |
25 | 538 | with_libwpg=yes | 538 | dnl TODO: Drop subsequent tests once this is widespread in distros |
26 | 539 | AC_SUBST(LIBWPG_LIBS, $LIBWPG01_LIBS) | 539 | dnl ************************************************************** |
27 | 540 | AC_SUBST(LIBWPG_CFLAGS, $LIBWPG01_CFLAGS) | 540 | PKG_CHECK_MODULES(LIBWPG03, libwpg-0.3 librevenge-0.0 librevenge-stream-0.0, with_libwpg03=yes, with_libwpg03=no) |
28 | 541 | fi | 541 | if test "x$with_libwpg03" = "xyes"; then |
29 | 542 | 542 | AC_DEFINE(WITH_LIBWPG03,1,[Build using libwpg 0.3.x]) | |
30 | 543 | PKG_CHECK_MODULES(LIBWPG02, libwpg-0.2 libwpd-0.9 libwpd-stream-0.9, with_libwpg02=yes, with_libwpg02=no) | 543 | with_libwpg=yes |
31 | 544 | if test "x$with_libwpg02" = "xyes"; then | 544 | AC_SUBST(LIBWPG_LIBS, $LIBWPG03_LIBS) |
32 | 545 | AC_DEFINE(WITH_LIBWPG02,1,[Build in libwpg 0.2.x]) | 545 | AC_SUBST(LIBWPG_CFLAGS, $LIBWPG03_CFLAGS) |
33 | 546 | with_libwpg=yes | 546 | else |
34 | 547 | AC_SUBST(LIBWPG_LIBS, $LIBWPG02_LIBS) | 547 | PKG_CHECK_MODULES(LIBWPG02, libwpg-0.2 libwpd-0.9 libwpd-stream-0.9, with_libwpg02=yes, with_libwpg02=no) |
35 | 548 | AC_SUBST(LIBWPG_CFLAGS, $LIBWPG02_CFLAGS) | 548 | if test "x$with_libwpg02" = "xyes"; then |
36 | 549 | AC_DEFINE(WITH_LIBWPG02,1,[Build using libwpg 0.2.x]) | ||
37 | 550 | with_libwpg=yes | ||
38 | 551 | AC_SUBST(LIBWPG_LIBS, $LIBWPG02_LIBS) | ||
39 | 552 | AC_SUBST(LIBWPG_CFLAGS, $LIBWPG02_CFLAGS) | ||
40 | 553 | fi | ||
41 | 549 | fi | 554 | fi |
42 | 550 | 555 | ||
43 | 551 | if test "x$with_libwpg" = "xyes"; then | 556 | if test "x$with_libwpg" = "xyes"; then |
44 | 552 | AC_DEFINE(WITH_LIBWPG,1,[Build in libwpg]) | 557 | AC_DEFINE(WITH_LIBWPG,1,[Build in libwpg]) |
45 | 553 | fi | 558 | fi |
46 | 554 | fi | 559 | fi |
48 | 555 | AM_CONDITIONAL(WITH_LIBWPG01, test "x$with_libwpg01" = "xyes") | 560 | AM_CONDITIONAL(WITH_LIBWPG03, test "x$with_libwpg03" = "xyes") |
49 | 556 | AM_CONDITIONAL(WITH_LIBWPG02, test "x$with_libwpg02" = "xyes") | 561 | AM_CONDITIONAL(WITH_LIBWPG02, test "x$with_libwpg02" = "xyes") |
50 | 557 | AM_CONDITIONAL(WITH_LIBWPG, test "x$with_libwpg" = "xyes") | 562 | AM_CONDITIONAL(WITH_LIBWPG, test "x$with_libwpg" = "xyes") |
51 | 558 | 563 | ||
52 | @@ -567,14 +572,33 @@ | |||
53 | 567 | with_libvisio=no | 572 | with_libvisio=no |
54 | 568 | 573 | ||
55 | 569 | if test "x$enable_visio" = "xyes"; then | 574 | if test "x$enable_visio" = "xyes"; then |
57 | 570 | PKG_CHECK_MODULES(LIBVISIO, libvisio-0.0 >= 0.0.20 libwpd-0.9 libwpd-stream-0.9 libwpg-0.2, with_libvisio=yes, with_libvisio=no) | 575 | dnl ************************************************************** |
58 | 576 | dnl Try using librevenge framework first. Fall back to old libs | ||
59 | 577 | dnl if unavailable. | ||
60 | 578 | dnl TODO: Drop subsequent tests once this is widespread in distros | ||
61 | 579 | dnl ************************************************************** | ||
62 | 580 | PKG_CHECK_MODULES(LIBVISIO01, libvisio-0.1 librevenge-0.0 librevenge-stream-0.0, with_libvisio01=yes, with_libvisio01=no) | ||
63 | 581 | if test "x$with_libvisio01" = "xyes"; then | ||
64 | 582 | AC_DEFINE(WITH_LIBVISIO01,1,[Build using libvisio 0.1.x]) | ||
65 | 583 | with_libvisio=yes | ||
66 | 584 | AC_SUBST(LIBVISIO_LIBS, $LIBVISIO01_LIBS) | ||
67 | 585 | AC_SUBST(LIBVISIO_CFLAGS, $LIBVISIO01_CFLAGS) | ||
68 | 586 | else | ||
69 | 587 | PKG_CHECK_MODULES(LIBVISIO00, libvisio-0.0 >= 0.0.20 libwpd-0.9 libwpd-stream-0.9 libwpg-0.2, with_libvisio00=yes, with_libvisio00=no) | ||
70 | 588 | if test "x$with_libvisio00" = "xyes"; then | ||
71 | 589 | AC_DEFINE(WITH_LIBVISIO00,1,[Build using libvisio 0.0.x]) | ||
72 | 590 | with_libvisio=yes | ||
73 | 591 | AC_SUBST(LIBVISIO_LIBS, $LIBVISIO00_LIBS) | ||
74 | 592 | AC_SUBST(LIBVISIO_CFLAGS, $LIBVISIO00_CFLAGS) | ||
75 | 593 | fi | ||
76 | 594 | fi | ||
77 | 571 | 595 | ||
78 | 572 | if test "x$with_libvisio" = "xyes"; then | 596 | if test "x$with_libvisio" = "xyes"; then |
79 | 573 | AC_DEFINE(WITH_LIBVISIO,1,[Build in libvisio]) | 597 | AC_DEFINE(WITH_LIBVISIO,1,[Build in libvisio]) |
80 | 574 | fi | 598 | fi |
81 | 575 | fi | 599 | fi |
84 | 576 | AC_SUBST(LIBVISIO_LIBS) | 600 | AM_CONDITIONAL(WITH_LIBVISIO01, test "x$with_libvisio01" = "xyes") |
85 | 577 | AC_SUBST(LIBVISIO_CFLAGS) | 601 | AM_CONDITIONAL(WITH_LIBVISIO00, test "x$with_libvisio00" = "xyes") |
86 | 578 | AM_CONDITIONAL(WITH_LIBVISIO, test "x$with_libvisio" = "xyes") | 602 | AM_CONDITIONAL(WITH_LIBVISIO, test "x$with_libvisio" = "xyes") |
87 | 579 | 603 | ||
88 | 580 | dnl ******************************** | 604 | dnl ******************************** |
89 | @@ -588,14 +612,33 @@ | |||
90 | 588 | with_libcdr=no | 612 | with_libcdr=no |
91 | 589 | 613 | ||
92 | 590 | if test "x$enable_cdr" = "xyes"; then | 614 | if test "x$enable_cdr" = "xyes"; then |
94 | 591 | PKG_CHECK_MODULES(LIBCDR, libcdr-0.0 >= 0.0.3 libwpd-0.9 libwpd-stream-0.9 libwpg-0.2, with_libcdr=yes, with_libcdr=no) | 615 | dnl ************************************************************** |
95 | 616 | dnl Try using librevenge framework first. Fall back to old libs | ||
96 | 617 | dnl if unavailable. | ||
97 | 618 | dnl TODO: Drop subsequent tests once this is widespread in distros | ||
98 | 619 | dnl ************************************************************** | ||
99 | 620 | PKG_CHECK_MODULES(LIBCDR01, libcdr-0.1 librevenge-0.0 librevenge-stream-0.0, with_libcdr01=yes, with_libcdr01=no) | ||
100 | 621 | if test "x$with_libcdr01" = "xyes"; then | ||
101 | 622 | AC_DEFINE(WITH_LIBCDR01,1,[Build using libcdr 0.1.x]) | ||
102 | 623 | with_libcdr=yes | ||
103 | 624 | AC_SUBST(LIBCDR_LIBS, $LIBCDR01_LIBS) | ||
104 | 625 | AC_SUBST(LIBCDR_CFLAGS, $LIBCDR01_CFLAGS) | ||
105 | 626 | else | ||
106 | 627 | PKG_CHECK_MODULES(LIBCDR00, libcdr-0.0 >= 0.0.3 libwpd-0.9 libwpd-stream-0.9 libwpg-0.2, with_libcdr00=yes, with_libcdr00=no) | ||
107 | 628 | if test "x$with_libcdr00" = "xyes"; then | ||
108 | 629 | AC_DEFINE(WITH_LIBCDR00,1,[Build using libcdr 0.0.x]) | ||
109 | 630 | with_libcdr=yes | ||
110 | 631 | AC_SUBST(LIBCDR_LIBS, $LIBCDR00_LIBS) | ||
111 | 632 | AC_SUBST(LIBCDR_CFLAGS, $LIBCDR00_CFLAGS) | ||
112 | 633 | fi | ||
113 | 634 | fi | ||
114 | 592 | 635 | ||
115 | 593 | if test "x$with_libcdr" = "xyes"; then | 636 | if test "x$with_libcdr" = "xyes"; then |
116 | 594 | AC_DEFINE(WITH_LIBCDR,1,[Build in libcdr]) | 637 | AC_DEFINE(WITH_LIBCDR,1,[Build in libcdr]) |
117 | 595 | fi | 638 | fi |
118 | 596 | fi | 639 | fi |
121 | 597 | AC_SUBST(LIBCDR_LIBS) | 640 | AM_CONDITIONAL(WITH_LIBCDR01, test "x$with_libcdr01" = "xyes") |
122 | 598 | AC_SUBST(LIBCDR_CFLAGS) | 641 | AM_CONDITIONAL(WITH_LIBCDR00, test "x$with_libcdr00" = "xyes") |
123 | 599 | AM_CONDITIONAL(WITH_LIBCDR, test "x$with_libcdr" = "xyes") | 642 | AM_CONDITIONAL(WITH_LIBCDR, test "x$with_libcdr" = "xyes") |
124 | 600 | 643 | ||
125 | 601 | dnl ****************************** | 644 | dnl ****************************** |
126 | 602 | 645 | ||
127 | === modified file 'src/extension/internal/cdr-input.cpp' | |||
128 | --- src/extension/internal/cdr-input.cpp 2013-10-27 16:33:32 +0000 | |||
129 | +++ src/extension/internal/cdr-input.cpp 2014-09-19 00:35:56 +0000 | |||
130 | @@ -24,7 +24,21 @@ | |||
131 | 24 | #include <cstring> | 24 | #include <cstring> |
132 | 25 | 25 | ||
133 | 26 | #include <libcdr/libcdr.h> | 26 | #include <libcdr/libcdr.h> |
135 | 27 | #include <libwpd-stream/libwpd-stream.h> | 27 | |
136 | 28 | // TODO: Drop this check when librevenge is widespread. | ||
137 | 29 | #if WITH_LIBCDR01 | ||
138 | 30 | #include <librevenge-stream/librevenge-stream.h> | ||
139 | 31 | |||
140 | 32 | using librevenge::RVNGString; | ||
141 | 33 | using librevenge::RVNGFileStream; | ||
142 | 34 | using librevenge::RVNGStringVector; | ||
143 | 35 | #else | ||
144 | 36 | #include <libwpd-stream/libwpd-stream.h> | ||
145 | 37 | |||
146 | 38 | typedef WPXString RVNGString; | ||
147 | 39 | typedef WPXFileStream RVNGFileStream; | ||
148 | 40 | typedef libcdr::CDRStringVector RVNGStringVector; | ||
149 | 41 | #endif | ||
150 | 28 | 42 | ||
151 | 29 | #include <gtkmm/alignment.h> | 43 | #include <gtkmm/alignment.h> |
152 | 30 | #include <gtkmm/comboboxtext.h> | 44 | #include <gtkmm/comboboxtext.h> |
153 | @@ -60,7 +74,7 @@ | |||
154 | 60 | 74 | ||
155 | 61 | class CdrImportDialog : public Gtk::Dialog { | 75 | class CdrImportDialog : public Gtk::Dialog { |
156 | 62 | public: | 76 | public: |
158 | 63 | CdrImportDialog(const std::vector<WPXString> &vec); | 77 | CdrImportDialog(const std::vector<RVNGString> &vec); |
159 | 64 | virtual ~CdrImportDialog(); | 78 | virtual ~CdrImportDialog(); |
160 | 65 | 79 | ||
161 | 66 | bool showDialog(); | 80 | bool showDialog(); |
162 | @@ -86,12 +100,12 @@ | |||
163 | 86 | class Gtk::VBox * vbox2; | 100 | class Gtk::VBox * vbox2; |
164 | 87 | class Gtk::Widget * _previewArea; | 101 | class Gtk::Widget * _previewArea; |
165 | 88 | 102 | ||
167 | 89 | const std::vector<WPXString> &_vec; // Document to be imported | 103 | const std::vector<RVNGString> &_vec; // Document to be imported |
168 | 90 | unsigned _current_page; // Current selected page | 104 | unsigned _current_page; // Current selected page |
169 | 91 | int _preview_width, _preview_height; // Size of the preview area | 105 | int _preview_width, _preview_height; // Size of the preview area |
170 | 92 | }; | 106 | }; |
171 | 93 | 107 | ||
173 | 94 | CdrImportDialog::CdrImportDialog(const std::vector<WPXString> &vec) | 108 | CdrImportDialog::CdrImportDialog(const std::vector<RVNGString> &vec) |
174 | 95 | : _vec(vec), _current_page(1) | 109 | : _vec(vec), _current_page(1) |
175 | 96 | { | 110 | { |
176 | 97 | int num_pages = _vec.size(); | 111 | int num_pages = _vec.size(); |
177 | @@ -210,14 +224,20 @@ | |||
178 | 210 | 224 | ||
179 | 211 | SPDocument *CdrInput::open(Inkscape::Extension::Input * /*mod*/, const gchar * uri) | 225 | SPDocument *CdrInput::open(Inkscape::Extension::Input * /*mod*/, const gchar * uri) |
180 | 212 | { | 226 | { |
182 | 213 | WPXFileStream input(uri); | 227 | RVNGFileStream input(uri); |
183 | 214 | 228 | ||
184 | 215 | if (!libcdr::CDRDocument::isSupported(&input)) { | 229 | if (!libcdr::CDRDocument::isSupported(&input)) { |
185 | 216 | return NULL; | 230 | return NULL; |
186 | 217 | } | 231 | } |
187 | 218 | 232 | ||
189 | 219 | libcdr::CDRStringVector output; | 233 | RVNGStringVector output; |
190 | 234 | #if WITH_LIBCDR01 | ||
191 | 235 | librevenge::RVNGSVGDrawingGenerator generator(output, "svg"); | ||
192 | 236 | |||
193 | 237 | if (!libcdr::CDRDocument::parse(&input, &generator)) { | ||
194 | 238 | #else | ||
195 | 220 | if (!libcdr::CDRDocument::generateSVG(&input, output)) { | 239 | if (!libcdr::CDRDocument::generateSVG(&input, output)) { |
196 | 240 | #endif | ||
197 | 221 | return NULL; | 241 | return NULL; |
198 | 222 | } | 242 | } |
199 | 223 | 243 | ||
200 | @@ -225,9 +245,9 @@ | |||
201 | 225 | return NULL; | 245 | return NULL; |
202 | 226 | } | 246 | } |
203 | 227 | 247 | ||
205 | 228 | std::vector<WPXString> tmpSVGOutput; | 248 | std::vector<RVNGString> tmpSVGOutput; |
206 | 229 | for (unsigned i=0; i<output.size(); ++i) { | 249 | for (unsigned i=0; i<output.size(); ++i) { |
208 | 230 | WPXString tmpString("<?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"); | 250 | RVNGString tmpString("<?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"); |
209 | 231 | tmpString.append(output[i]); | 251 | tmpString.append(output[i]); |
210 | 232 | tmpSVGOutput.push_back(tmpString); | 252 | tmpSVGOutput.push_back(tmpString); |
211 | 233 | } | 253 | } |
212 | 234 | 254 | ||
213 | === modified file 'src/extension/internal/vsd-input.cpp' | |||
214 | --- src/extension/internal/vsd-input.cpp 2013-10-24 15:03:01 +0000 | |||
215 | +++ src/extension/internal/vsd-input.cpp 2014-09-19 00:35:56 +0000 | |||
216 | @@ -24,7 +24,22 @@ | |||
217 | 24 | #include <cstring> | 24 | #include <cstring> |
218 | 25 | 25 | ||
219 | 26 | #include <libvisio/libvisio.h> | 26 | #include <libvisio/libvisio.h> |
221 | 27 | #include <libwpd-stream/libwpd-stream.h> | 27 | |
222 | 28 | // TODO: Drop this check when librevenge is widespread. | ||
223 | 29 | #if WITH_LIBVISIO01 | ||
224 | 30 | #include <librevenge-stream/librevenge-stream.h> | ||
225 | 31 | |||
226 | 32 | using librevenge::RVNGString; | ||
227 | 33 | using librevenge::RVNGFileStream; | ||
228 | 34 | using librevenge::RVNGStringVector; | ||
229 | 35 | #else | ||
230 | 36 | #include <libwpd-stream/libwpd-stream.h> | ||
231 | 37 | |||
232 | 38 | typedef WPXString RVNGString; | ||
233 | 39 | typedef WPXFileStream RVNGFileStream; | ||
234 | 40 | typedef libvisio::VSDStringVector RVNGStringVector; | ||
235 | 41 | #endif | ||
236 | 42 | |||
237 | 28 | 43 | ||
238 | 29 | #include <gtkmm/alignment.h> | 44 | #include <gtkmm/alignment.h> |
239 | 30 | #include <gtkmm/comboboxtext.h> | 45 | #include <gtkmm/comboboxtext.h> |
240 | @@ -59,7 +74,7 @@ | |||
241 | 59 | 74 | ||
242 | 60 | class VsdImportDialog : public Gtk::Dialog { | 75 | class VsdImportDialog : public Gtk::Dialog { |
243 | 61 | public: | 76 | public: |
245 | 62 | VsdImportDialog(const std::vector<WPXString> &vec); | 77 | VsdImportDialog(const std::vector<RVNGString> &vec); |
246 | 63 | virtual ~VsdImportDialog(); | 78 | virtual ~VsdImportDialog(); |
247 | 64 | 79 | ||
248 | 65 | bool showDialog(); | 80 | bool showDialog(); |
249 | @@ -85,12 +100,12 @@ | |||
250 | 85 | class Gtk::VBox * vbox2; | 100 | class Gtk::VBox * vbox2; |
251 | 86 | class Gtk::Widget * _previewArea; | 101 | class Gtk::Widget * _previewArea; |
252 | 87 | 102 | ||
254 | 88 | const std::vector<WPXString> &_vec; // Document to be imported | 103 | const std::vector<RVNGString> &_vec; // Document to be imported |
255 | 89 | unsigned _current_page; // Current selected page | 104 | unsigned _current_page; // Current selected page |
256 | 90 | int _preview_width, _preview_height; // Size of the preview area | 105 | int _preview_width, _preview_height; // Size of the preview area |
257 | 91 | }; | 106 | }; |
258 | 92 | 107 | ||
260 | 93 | VsdImportDialog::VsdImportDialog(const std::vector<WPXString> &vec) | 108 | VsdImportDialog::VsdImportDialog(const std::vector<RVNGString> &vec) |
261 | 94 | : _vec(vec), _current_page(1) | 109 | : _vec(vec), _current_page(1) |
262 | 95 | { | 110 | { |
263 | 96 | int num_pages = _vec.size(); | 111 | int num_pages = _vec.size(); |
264 | @@ -209,14 +224,20 @@ | |||
265 | 209 | 224 | ||
266 | 210 | SPDocument *VsdInput::open(Inkscape::Extension::Input * /*mod*/, const gchar * uri) | 225 | SPDocument *VsdInput::open(Inkscape::Extension::Input * /*mod*/, const gchar * uri) |
267 | 211 | { | 226 | { |
269 | 212 | WPXFileStream input(uri); | 227 | RVNGFileStream input(uri); |
270 | 213 | 228 | ||
271 | 214 | if (!libvisio::VisioDocument::isSupported(&input)) { | 229 | if (!libvisio::VisioDocument::isSupported(&input)) { |
272 | 215 | return NULL; | 230 | return NULL; |
273 | 216 | } | 231 | } |
274 | 217 | 232 | ||
276 | 218 | libvisio::VSDStringVector output; | 233 | RVNGStringVector output; |
277 | 234 | #if WITH_LIBVISIO01 | ||
278 | 235 | librevenge::RVNGSVGDrawingGenerator generator(output, "svg"); | ||
279 | 236 | |||
280 | 237 | if (!libvisio::VisioDocument::parse(&input, &generator)) { | ||
281 | 238 | #else | ||
282 | 219 | if (!libvisio::VisioDocument::generateSVG(&input, output)) { | 239 | if (!libvisio::VisioDocument::generateSVG(&input, output)) { |
283 | 240 | #endif | ||
284 | 220 | return NULL; | 241 | return NULL; |
285 | 221 | } | 242 | } |
286 | 222 | 243 | ||
287 | @@ -224,9 +245,9 @@ | |||
288 | 224 | return NULL; | 245 | return NULL; |
289 | 225 | } | 246 | } |
290 | 226 | 247 | ||
292 | 227 | std::vector<WPXString> tmpSVGOutput; | 248 | std::vector<RVNGString> tmpSVGOutput; |
293 | 228 | for (unsigned i=0; i<output.size(); ++i) { | 249 | for (unsigned i=0; i<output.size(); ++i) { |
295 | 229 | WPXString tmpString("<?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"); | 250 | RVNGString tmpString("<?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"); |
296 | 230 | tmpString.append(output[i]); | 251 | tmpString.append(output[i]); |
297 | 231 | tmpSVGOutput.push_back(tmpString); | 252 | tmpSVGOutput.push_back(tmpString); |
298 | 232 | } | 253 | } |
299 | 233 | 254 | ||
300 | === modified file 'src/extension/internal/wpg-input.cpp' | |||
301 | --- src/extension/internal/wpg-input.cpp 2014-03-27 01:33:44 +0000 | |||
302 | +++ src/extension/internal/wpg-input.cpp 2014-09-19 00:35:56 +0000 | |||
303 | @@ -52,16 +52,24 @@ | |||
304 | 52 | #include "util/units.h" | 52 | #include "util/units.h" |
305 | 53 | #include <cstring> | 53 | #include <cstring> |
306 | 54 | 54 | ||
310 | 55 | // Take a guess and fallback to 0.1.x if no configure has run | 55 | // Take a guess and fallback to 0.2.x if no configure has run |
311 | 56 | #if !defined(WITH_LIBWPG01) && !defined(WITH_LIBWPG02) | 56 | #if !defined(WITH_LIBWPG03) && !defined(WITH_LIBWPG02) |
312 | 57 | #define WITH_LIBWPG01 1 | 57 | #define WITH_LIBWPG02 1 |
313 | 58 | #endif | 58 | #endif |
314 | 59 | 59 | ||
315 | 60 | #include "libwpg/libwpg.h" | 60 | #include "libwpg/libwpg.h" |
320 | 61 | #if WITH_LIBWPG01 | 61 | #if WITH_LIBWPG03 |
321 | 62 | #include "libwpg/WPGStreamImplementation.h" | 62 | #include <librevenge-stream/librevenge-stream.h> |
322 | 63 | #elif WITH_LIBWPG02 | 63 | |
323 | 64 | #include "libwpd-stream/libwpd-stream.h" | 64 | using librevenge::RVNGString; |
324 | 65 | using librevenge::RVNGFileStream; | ||
325 | 66 | using librevenge::RVNGInputStream; | ||
326 | 67 | #else | ||
327 | 68 | #include "libwpd-stream/libwpd-stream.h" | ||
328 | 69 | |||
329 | 70 | typedef WPXString RVNGString; | ||
330 | 71 | typedef WPXFileStream RVNGFileStream; | ||
331 | 72 | typedef WPXInputStream RVNGInputStream; | ||
332 | 65 | #endif | 73 | #endif |
333 | 66 | 74 | ||
334 | 67 | using namespace libwpg; | 75 | using namespace libwpg; |
335 | @@ -73,17 +81,15 @@ | |||
336 | 73 | 81 | ||
337 | 74 | SPDocument *WpgInput::open(Inkscape::Extension::Input * /*mod*/, const gchar * uri) | 82 | SPDocument *WpgInput::open(Inkscape::Extension::Input * /*mod*/, const gchar * uri) |
338 | 75 | { | 83 | { |
344 | 76 | #if WITH_LIBWPG01 | 84 | RVNGInputStream* input = new RVNGFileStream(uri); |
345 | 77 | WPXInputStream* input = new libwpg::WPGFileStream(uri); | 85 | #if WITH_LIBWPG03 |
346 | 78 | #elif WITH_LIBWPG02 | 86 | if (input->isStructured()) { |
347 | 79 | WPXInputStream* input = new WPXFileStream(uri); | 87 | RVNGInputStream* olestream = input->getSubStreamByName("PerfectOffice_MAIN"); |
348 | 80 | #endif | 88 | #else |
349 | 81 | if (input->isOLEStream()) { | 89 | if (input->isOLEStream()) { |
354 | 82 | #if WITH_LIBWPG01 | 90 | RVNGInputStream* olestream = input->getDocumentOLEStream("PerfectOffice_MAIN"); |
351 | 83 | WPXInputStream* olestream = input->getDocumentOLEStream(); | ||
352 | 84 | #elif WITH_LIBWPG02 | ||
353 | 85 | WPXInputStream* olestream = input->getDocumentOLEStream("PerfectOffice_MAIN"); | ||
355 | 86 | #endif | 91 | #endif |
356 | 92 | |||
357 | 87 | if (olestream) { | 93 | if (olestream) { |
358 | 88 | delete input; | 94 | delete input; |
359 | 89 | input = olestream; | 95 | input = olestream; |
360 | @@ -98,15 +104,24 @@ | |||
361 | 98 | return NULL; | 104 | return NULL; |
362 | 99 | } | 105 | } |
363 | 100 | 106 | ||
369 | 101 | #if WITH_LIBWPG01 | 107 | #if WITH_LIBWPG03 |
370 | 102 | libwpg::WPGString output; | 108 | librevenge::RVNGStringVector vec; |
371 | 103 | #elif WITH_LIBWPG02 | 109 | librevenge::RVNGSVGDrawingGenerator generator(vec, ""); |
372 | 104 | WPXString output; | 110 | |
373 | 105 | #endif | 111 | if (!libwpg::WPGraphics::parse(input, &generator) || vec.empty() || vec[0].empty()) { |
374 | 112 | delete input; | ||
375 | 113 | return NULL; | ||
376 | 114 | } | ||
377 | 115 | |||
378 | 116 | RVNGString output("<?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"); | ||
379 | 117 | output.append(vec[0]); | ||
380 | 118 | #else | ||
381 | 119 | RVNGString output; | ||
382 | 106 | if (!libwpg::WPGraphics::generateSVG(input, output)) { | 120 | if (!libwpg::WPGraphics::generateSVG(input, output)) { |
383 | 107 | delete input; | 121 | delete input; |
384 | 108 | return NULL; | 122 | return NULL; |
385 | 109 | } | 123 | } |
386 | 124 | #endif | ||
387 | 110 | 125 | ||
388 | 111 | //printf("I've got a doc: \n%s", painter.document.c_str()); | 126 | //printf("I've got a doc: \n%s", painter.document.c_str()); |
389 | 112 | 127 | ||
390 | 113 | 128 | ||
391 | === modified file 'src/ui/dialog/symbols.cpp' | |||
392 | --- src/ui/dialog/symbols.cpp 2014-06-13 16:06:01 +0000 | |||
393 | +++ src/ui/dialog/symbols.cpp 2014-09-19 00:35:56 +0000 | |||
394 | @@ -62,8 +62,20 @@ | |||
395 | 62 | #include "widgets/icon.h" | 62 | #include "widgets/icon.h" |
396 | 63 | 63 | ||
397 | 64 | #ifdef WITH_LIBVISIO | 64 | #ifdef WITH_LIBVISIO |
400 | 65 | #include <libvisio/libvisio.h> | 65 | #include <libvisio/libvisio.h> |
401 | 66 | #include <libwpd-stream/libwpd-stream.h> | 66 | |
402 | 67 | // TODO: Drop this check when librevenge is widespread. | ||
403 | 68 | #if WITH_LIBVISIO01 | ||
404 | 69 | #include <librevenge-stream/librevenge-stream.h> | ||
405 | 70 | |||
406 | 71 | using librevenge::RVNGFileStream; | ||
407 | 72 | using librevenge::RVNGStringVector; | ||
408 | 73 | #else | ||
409 | 74 | #include <libwpd-stream/libwpd-stream.h> | ||
410 | 75 | |||
411 | 76 | typedef WPXFileStream RVNGFileStream; | ||
412 | 77 | typedef libvisio::VSDStringVector RVNGStringVector; | ||
413 | 78 | #endif | ||
414 | 67 | #endif | 79 | #endif |
415 | 68 | 80 | ||
416 | 69 | #include "verbs.h" | 81 | #include "verbs.h" |
417 | @@ -495,14 +507,20 @@ | |||
418 | 495 | // Read Visio stencil files | 507 | // Read Visio stencil files |
419 | 496 | SPDocument* read_vss( gchar* fullname, gchar* filename ) { | 508 | SPDocument* read_vss( gchar* fullname, gchar* filename ) { |
420 | 497 | 509 | ||
422 | 498 | WPXFileStream input(fullname); | 510 | RVNGFileStream input(fullname); |
423 | 499 | 511 | ||
424 | 500 | if (!libvisio::VisioDocument::isSupported(&input)) { | 512 | if (!libvisio::VisioDocument::isSupported(&input)) { |
425 | 501 | return NULL; | 513 | return NULL; |
426 | 502 | } | 514 | } |
427 | 503 | 515 | ||
429 | 504 | libvisio::VSDStringVector output; | 516 | RVNGStringVector output; |
430 | 517 | #if WITH_LIBVISIO01 | ||
431 | 518 | librevenge::RVNGSVGDrawingGenerator generator(output, "svg"); | ||
432 | 519 | |||
433 | 520 | if (!libvisio::VisioDocument::parseStencils(&input, &generator)) { | ||
434 | 521 | #else | ||
435 | 505 | if (!libvisio::VisioDocument::generateSVGStencils(&input, output)) { | 522 | if (!libvisio::VisioDocument::generateSVGStencils(&input, output)) { |
436 | 523 | #endif | ||
437 | 506 | return NULL; | 524 | return NULL; |
438 | 507 | } | 525 | } |
439 | 508 | 526 |
On 2014-05-28 06:24 +0100, ~suv wrote: stream- 0.0 requires the Filesystem library from
> Currently introduces an indirect dependency on one of the boost
> libraries: librevenge-
> the Boost C++ libraries.
The dependency on the Filesystem library has been removed from upstream librevenge today: sourceforge. net/p/libwpd/ librevenge/ ci/fd8b4f3d933b 631584e3338eae5 64f9336a20533/ tree/>
<http://