File inkscape-0.48.5-librevenge.patch of Package inkscape

--- inkscape-0.48.5/configure.ac	2014-06-20 22:29:03.717600589 +0200
+++ inkscape-0.48.5/configure.ac	2014-07-22 10:38:06.623930753 +0200
@@ -659,27 +659,13 @@
 
 with_libwpg=no
 
-PKG_CHECK_MODULES(LIBWPG01, libwpg-0.1 libwpg-stream-0.1, with_libwpg01=yes, with_libwpg01=no)
-if test "x$with_libwpg01" = "xyes"; then
-	AC_DEFINE(WITH_LIBWPG01,1,[Build in libwpg 0.1.x])
-	with_libwpg=yes
-	AC_SUBST(LIBWPG_LIBS, $LIBWPG01_LIBS)
-	AC_SUBST(LIBWPG_CFLAGS, $LIBWPG01_CFLAGS)
-fi
-AM_CONDITIONAL(WITH_LIBWPG01, test "x$with_libwpg01" = "xyes")
-
-PKG_CHECK_MODULES(LIBWPG02, libwpg-0.2 libwpd-0.9 libwpd-stream-0.9, with_libwpg02=yes, with_libwpg02=no)
-if test "x$with_libwpg02" = "xyes"; then
-	AC_DEFINE(WITH_LIBWPG02,1,[Build in libwpg 0.2.x])
-	with_libwpg=yes
-	AC_SUBST(LIBWPG_LIBS, $LIBWPG02_LIBS)
-	AC_SUBST(LIBWPG_CFLAGS, $LIBWPG02_CFLAGS)
-fi
-AM_CONDITIONAL(WITH_LIBWPG02, test "x$with_libwpg02" = "xyes")
+PKG_CHECK_MODULES(LIBWPG, libwpg-0.3 librevenge-0.0 librevenge-stream-0.0, with_libwpg=yes, with_libwpg=no)
 
 if test "x$with_libwpg" = "xyes"; then
 	AC_DEFINE(WITH_LIBWPG,1,[Build in libwpg])
 fi
+AC_SUBST(LIBWPG_LIBS)
+AC_SUBST(LIBWPG_CFLAGS)
 AM_CONDITIONAL(WITH_LIBWPG, test "x$with_libwpg" = "xyes")
 
 dnl ******************************
--- inkscape-0.48.5/src/extension/internal/wpg-input.cpp	2011-07-14 23:43:01.000000000 +0200
+++ inkscape-0.48.5/src/extension/internal/wpg-input.cpp	2014-07-22 10:38:06.623930753 +0200
@@ -48,17 +48,8 @@
 #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
+#include "librevenge-stream/librevenge-stream.h"
 
 using namespace libwpg;
 
@@ -69,17 +60,9 @@
 
 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
+    librevenge::RVNGInputStream* input = new librevenge::RVNGFileStream(uri);
+    if (input->isStructured()) {
+        librevenge::RVNGInputStream* olestream = input->getSubStreamByName("PerfectOffice_MAIN");
         if (olestream) {
             delete input;
             input = olestream;
@@ -94,16 +77,18 @@
         return NULL;
     }
 
-#if WITH_LIBWPG01
-    libwpg::WPGString output;
-#elif WITH_LIBWPG02
-    WPXString output;
-#endif
-    if (!libwpg::WPGraphics::generateSVG(input, output)) {
+	librevenge::RVNGStringVector vec;
+	librevenge::RVNGSVGDrawingGenerator generator(vec, "");
+
+	if (!libwpg::WPGraphics::parse(input, &generator) || vec.empty() || vec[0].empty())
+ 	{
         delete input;
         return NULL;
     }
 
+    librevenge::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");
+	output.append(vec[0]);
+
     //printf("I've got a doc: \n%s", painter.document.c_str());
 
     SPDocument * doc = sp_document_new_from_mem(output.cstr(), strlen(output.cstr()), TRUE);
openSUSE Build Service is sponsored by