diff options
| author | Andrew Higginson <at.higginson@gmail.com> | 2011-12-27 21:04:47 +0000 |
|---|---|---|
| committer | Andrew <at.higginson@gmail.com> | 2011-12-27 21:04:47 +0000 |
| commit | 80960b623a99aae1402ab651b2974ef544ed3b03 (patch) | |
| tree | ba49d42c2789e9e11f805e2d5263e10f9fedeef8 /src/extension/internal/wpg-input.cpp | |
| parent | try to fix bug (diff) | |
| parent | GDL: Cherry-pick upstream patch 73852 (2011-03-23) - Add missing return value. (diff) | |
| download | inkscape-80960b623a99aae1402ab651b2974ef544ed3b03.tar.gz inkscape-80960b623a99aae1402ab651b2974ef544ed3b03.zip | |
merged with trunk so I can build again...
(bzr r10092.1.36)
Diffstat (limited to 'src/extension/internal/wpg-input.cpp')
| -rw-r--r-- | src/extension/internal/wpg-input.cpp | 26 |
1 files changed, 23 insertions, 3 deletions
diff --git a/src/extension/internal/wpg-input.cpp b/src/extension/internal/wpg-input.cpp index 70fa28967..0f2857570 100644 --- a/src/extension/internal/wpg-input.cpp +++ b/src/extension/internal/wpg-input.cpp @@ -49,9 +49,17 @@ #include "extension/input.h" #include "document.h" +// Take a guess and fallback to 0.1.x if no configure has run +#if !defined(WITH_LIBWPG01) && !defined(WITH_LIBWPG02) +#define WITH_LIBWPG01 1 +#endif + #include "libwpg/libwpg.h" +#if WITH_LIBWPG01 #include "libwpg/WPGStreamImplementation.h" - +#elif WITH_LIBWPG02 +#include "libwpd-stream/libwpd-stream.h" +#endif using namespace libwpg; @@ -60,11 +68,19 @@ namespace Extension { namespace Internal { -SPDocument * -WpgInput::open(Inkscape::Extension::Input * mod, const gchar * uri) { +SPDocument *WpgInput::open(Inkscape::Extension::Input * /*mod*/, const gchar * uri) +{ +#if WITH_LIBWPG01 WPXInputStream* input = new libwpg::WPGFileStream(uri); +#elif WITH_LIBWPG02 + WPXInputStream* input = new WPXFileStream(uri); +#endif if (input->isOLEStream()) { +#if WITH_LIBWPG01 WPXInputStream* olestream = input->getDocumentOLEStream(); +#elif WITH_LIBWPG02 + WPXInputStream* olestream = input->getDocumentOLEStream("PerfectOffice_MAIN"); +#endif if (olestream) { delete input; input = olestream; @@ -79,7 +95,11 @@ WpgInput::open(Inkscape::Extension::Input * mod, const gchar * uri) { return NULL; } +#if WITH_LIBWPG01 libwpg::WPGString output; +#elif WITH_LIBWPG02 + WPXString output; +#endif if (!libwpg::WPGraphics::generateSVG(input, output)) { delete input; return NULL; |
