1 diff -urN abiword-2.8.2/plugin-configure.m4 abiword-2.8.2.new//plugin-configure.m4
2 --- abiword-2.8.2/plugin-configure.m4 2010-02-12 15:12:07.000000000 +0100
3 +++ abiword-2.8.2.new//plugin-configure.m4 2010-12-18 12:07:08.550263907 +0100
5 AC_SUBST([LOADBINDINGS_LIBS])
8 -wpg_pkgs="$gsf_req libwpg-0.1 >= 0.1.0 libwpd-0.8 >= 0.8.0"
9 +wpg_pkgs="$gsf_req libwpg-0.2 >= 0.2.0 libwpd-0.9 >= 0.9.0 libwpd-stream-0.9 >= 0.9.0"
12 if test "$enable_wpg" != ""; then
17 -wordperfect_pkgs="libwpd-0.8 >= 0.8.0 $gsf_req"
18 -wordperfect_wps_pkgs='libwps-0.1 >= 0.1.0'
19 +wordperfect_pkgs="libwpg-0.2 >= 0.2.0 libwpd-0.9 >= 0.9.0 libwpd-stream-0.9 >= 0.9.0 $gsf_req"
20 +wordperfect_wps_pkgs='libwps-0.2 >= 0.1.0'
24 diff -urN abiword-2.8.2/plugins/wordperfect/plugin.m4 abiword-2.8.2.new//plugins/wordperfect/plugin.m4
25 --- abiword-2.8.2/plugins/wordperfect/plugin.m4 2009-06-22 06:33:05.000000000 +0200
26 +++ abiword-2.8.2.new//plugins/wordperfect/plugin.m4 2010-12-18 12:02:29.184921950 +0100
29 -wordperfect_pkgs="libwpd-0.8 >= 0.8.0 $gsf_req"
30 -wordperfect_wps_pkgs='libwps-0.1 >= 0.1.0'
31 +wordperfect_pkgs="libwpg-0.2 >= 0.2.0 libwpd-0.9 >= 0.9.0 libwpd-stream-0.9 >= 0.9.0 $gsf_req"
32 +wordperfect_wps_pkgs='libwps-0.2 >= 0.1.0'
36 diff -urN abiword-2.8.2/plugins/wordperfect/xp/ie_imp_WordPerfect.cpp abiword-2.8.2.new//plugins/wordperfect/xp/ie_imp_WordPerfect.cpp
37 --- abiword-2.8.2/plugins/wordperfect/xp/ie_imp_WordPerfect.cpp 2010-02-06 22:06:11.000000000 +0100
38 +++ abiword-2.8.2.new//plugins/wordperfect/xp/ie_imp_WordPerfect.cpp 2010-12-18 12:02:29.181588156 +0100
43 -#include <libwpd/WPXStream.h>
44 +#include <libwpd-stream/libwpd-stream.h>
46 #include <gsf/gsf-input.h>
47 #include <gsf/gsf-infile.h>
49 #include <libwps/libwps.h>
52 -class AbiWordperfectInputStream :
54 - public WPSInputStream
56 - public WPXInputStream
58 +class AbiWordperfectInputStream : public WPXInputStream
61 AbiWordperfectInputStream(GsfInput *input);
64 virtual WPXInputStream * getDocumentOLEStream(const char * name);
66 - virtual const uint8_t *read(size_t numBytes, size_t &numBytesRead);
67 + virtual const unsigned char *read(unsigned long numBytes, unsigned long &numBytesRead);
68 virtual int seek(long offset, WPX_SEEK_TYPE seekType);
74 AbiWordperfectInputStream::AbiWordperfectInputStream(GsfInput *input) :
78 - WPXInputStream(true),
85 g_object_unref(G_OBJECT(m_input));
88 -const uint8_t * AbiWordperfectInputStream::read(size_t numBytes, size_t &numBytesRead)
89 +const unsigned char * AbiWordperfectInputStream::read(unsigned long numBytes, unsigned long &numBytesRead)
91 - const uint8_t *buf = gsf_input_read(m_input, numBytes, NULL);
92 + const unsigned char *buf = gsf_input_read(m_input, numBytes, NULL);
98 AbiWordperfectInputStream gsfInput(input);
100 - WPDConfidence confidence = WPDocument::isFileFormatSupported(&gsfInput, true);
101 + WPDConfidence confidence = WPDocument::isFileFormatSupported(&gsfInput);
105 case WPD_CONFIDENCE_NONE:
106 - // libwpd > 0.7.1 reports POOR if the text file is plain text (that _could_ be a WP4x document)
107 - // however, we'll let the text importer handle such cases
108 - case WPD_CONFIDENCE_POOR:
109 return UT_CONFIDENCE_ZILCH;
110 - case WPD_CONFIDENCE_LIKELY:
111 - return UT_CONFIDENCE_SOSO;
112 - case WPD_CONFIDENCE_GOOD:
113 - return UT_CONFIDENCE_GOOD;
114 case WPD_CONFIDENCE_EXCELLENT:
115 return UT_CONFIDENCE_PERFECT;
118 UT_Error IE_Imp_WordPerfect::_loadFile(GsfInput * input)
120 AbiWordperfectInputStream gsfInput(input);
121 - WPDResult error = WPDocument::parse(&gsfInput, static_cast<WPXHLListenerImpl *>(this));
122 + WPDResult error = WPDocument::parse(&gsfInput, static_cast<WPXDocumentInterface *>(this), NULL);
127 float marginLeft = 1.0f, marginRight = 1.0f;
129 if (propList["fo:margin-left"])
130 - marginLeft = propList["fo:margin-left"]->getFloat();
131 + marginLeft = propList["fo:margin-left"]->getDouble();
132 if (propList["fo:margin-right"])
133 - marginRight = propList["fo:margin-right"]->getFloat();
134 + marginRight = propList["fo:margin-right"]->getDouble();
136 if (marginLeft != m_leftPageMargin || marginRight != m_rightPageMargin /* || */
137 /* marginTop != m_marginBottom || marginBottom != m_marginBottom */ )
138 @@ -456,15 +440,15 @@
139 float marginTop = 0.0f, marginBottom = 0.0f;
140 float marginLeft = 0.0f, marginRight = 0.0f, textIndent = 0.0f;
141 if (propList["fo:margin-top"])
142 - marginTop = propList["fo:margin-top"]->getFloat();
143 + marginTop = propList["fo:margin-top"]->getDouble();
144 if (propList["fo:margin-bottom"])
145 - marginBottom = propList["fo:margin-bottom"]->getFloat();
146 + marginBottom = propList["fo:margin-bottom"]->getDouble();
147 if (propList["fo:margin-left"])
148 - marginLeft = propList["fo:margin-left"]->getFloat();
149 + marginLeft = propList["fo:margin-left"]->getDouble();
150 if (propList["fo:margin-right"])
151 - marginRight = propList["fo:margin-right"]->getFloat();
152 + marginRight = propList["fo:margin-right"]->getDouble();
153 if (propList["fo:text-indent"])
154 - textIndent = propList["fo:text-indent"]->getFloat();
155 + textIndent = propList["fo:text-indent"]->getDouble();
157 m_topMargin = marginTop;
158 m_bottomMargin = marginBottom;
161 float lineSpacing = 1.0f;
162 if (propList["fo:line-height"])
163 - lineSpacing = propList["fo:line-height"]->getFloat();
164 + lineSpacing = propList["fo:line-height"]->getDouble();
167 UT_String_sprintf(tmpBuffer, "; margin-top:%.4fin; margin-bottom:%.4fin; margin-left:%.4fin; margin-right:%.4fin; text-indent:%.4fin; line-height:%.4f",
169 propBuffer += tmpBuffer;
170 if (i()["style:position"])
172 - UT_String_sprintf(tmpBuffer, "%.4fin", i()["style:position"]->getFloat());
173 + UT_String_sprintf(tmpBuffer, "%.4fin", i()["style:position"]->getDouble());
174 propBuffer += tmpBuffer;
177 @@ -520,10 +504,10 @@
178 else // Left aligned is default
181 - if (i()["style:leader-char"])
182 - if (i()["style:leader-char"]->getStr() == "-")
183 + if (i()["style:leader-text"])
184 + if (i()["style:leader-text"]->getStr() == "-")
186 - else if (i()["style:leader-char"]->getStr() == "_")
187 + else if (i()["style:leader-text"]->getStr() == "_")
189 else // default to dot leader if the given leader is dot or is not supported by AbiWord
191 @@ -586,12 +570,12 @@
192 propBuffer += "subscript";
195 - if (propList["style:text-underline"] || propList["style:text-crossing-out"])
196 + if (propList["style:text-underline-type"] || propList["style:text-line-through-type"])
198 propBuffer += "; text-decoration:";
199 - if (propList["style:text-underline"])
200 + if (propList["style:text-underline-type"])
201 propBuffer += "underline ";
202 - if (propList["style:text-crossing-out"])
203 + if (propList["style:text-line-through-type"])
204 propBuffer += "line-through";
207 @@ -615,10 +599,10 @@
208 propBuffer += propList["fo:color"]->getStr().cstr();
211 - if (propList["style:text-background-color"])
212 + if (propList["fo:background-color"])
214 propBuffer += "; bgcolor:";
215 - propBuffer += propList["style:text-background-color"]->getStr().cstr();
216 + propBuffer += propList["fo:background-color"]->getStr().cstr();
219 UT_DEBUGMSG(("AbiWordPerfect: Appending span format: %s\n", propBuffer.c_str()));
220 @@ -639,10 +623,10 @@
221 int columnsCount = ((columns.count() == 0) ? 1 : columns.count());
223 // TODO: support spaceAfter
224 - if (propList["fo:margin-left"])
225 - marginLeft = propList["fo:margin-left"]->getFloat();
226 - if (propList["fo:margin-right"])
227 - marginRight = propList["fo:margin-right"]->getFloat();
228 + if (propList["fo:start-indent"])
229 + marginLeft = propList["fo:start-indent"]->getDouble();
230 + if (propList["fo:end-indent"])
231 + marginRight = propList["fo:end-indent"]->getDouble();
233 if (marginLeft != m_leftSectionMargin || marginRight != m_rightSectionMargin || m_sectionColumnsCount != columnsCount)
234 m_bSectionChanged = true;
236 if (propList["style:num-format"])
237 listType = propList["style:num-format"]->getStr().cstr()[0];
238 if (propList["text:space-before"])
239 - listLeftOffset = propList["text:space-before"]->getFloat();
240 + listLeftOffset = propList["text:space-before"]->getDouble();
241 if (propList["text:min-label-width"])
242 - listMinLabelWidth = propList["text:min-label-width"]->getFloat();
243 + listMinLabelWidth = propList["text:min-label-width"]->getDouble();
245 if (!m_pCurrentListDefinition ||
246 m_pCurrentListDefinition->getOutlineHash() != listID ||
248 if (propList["libwpd:level"])
249 level = propList["libwpd:level"]->getInt();
250 if (propList["text:space-before"])
251 - listLeftOffset = propList["text:space-before"]->getFloat();
252 + listLeftOffset = propList["text:space-before"]->getDouble();
253 if (propList["text:min-label-width"])
254 - listMinLabelWidth = propList["text:min-label-width"]->getFloat();
255 + listMinLabelWidth = propList["text:min-label-width"]->getDouble();
257 if (!m_pCurrentListDefinition || m_pCurrentListDefinition->getOutlineHash() != listID)
259 @@ -871,10 +855,10 @@
261 UT_String_sprintf(tempBuffer, "margin-left:%.4fin; ", m_pCurrentListDefinition->getListLeftOffset(m_iCurrentListLevel)
262 + m_pCurrentListDefinition->getListMinLabelWidth(m_iCurrentListLevel)
263 - - (propList["fo:text-indent"] ? propList["fo:text-indent"]->getFloat() : 0.0f));
264 + - (propList["fo:text-indent"] ? propList["fo:text-indent"]->getDouble() : 0.0f));
265 propBuffer += tempBuffer;
266 UT_String_sprintf(tempBuffer, "text-indent:%.4fin", - m_pCurrentListDefinition->getListMinLabelWidth(m_iCurrentListLevel)
267 - + (propList["fo:text-indent"] ? propList["fo:text-indent"]->getFloat() : 0.0f));
268 + + (propList["fo:text-indent"] ? propList["fo:text-indent"]->getDouble() : 0.0f));
269 propBuffer += tempBuffer;
271 listAttribs[attribsCount++] = PT_PROPS_ATTRIBUTE_NAME;
272 @@ -1263,7 +1247,7 @@
273 virtual UT_Error _loadFile(GsfInput * input)
275 AbiWordperfectInputStream gsfInput(input);
276 - WPSResult error = WPSDocument::parse(&gsfInput, static_cast<WPXHLListenerImpl *>(this));
277 + WPSResult error = WPSDocument::parse(&gsfInput, static_cast<WPXDocumentInterface *>(this));
281 @@ -1302,18 +1286,12 @@
283 AbiWordperfectInputStream gsfInput(input);
285 - WPSConfidence confidence = WPSDocument::isFileFormatSupported(&gsfInput, true);
286 + WPSConfidence confidence = WPSDocument::isFileFormatSupported(&gsfInput);
290 case WPS_CONFIDENCE_NONE:
291 return UT_CONFIDENCE_ZILCH;
292 - case WPS_CONFIDENCE_POOR:
293 - return UT_CONFIDENCE_POOR;
294 - case WPS_CONFIDENCE_LIKELY:
295 - return UT_CONFIDENCE_SOSO;
296 - case WPS_CONFIDENCE_GOOD:
297 - return UT_CONFIDENCE_GOOD;
298 case WPS_CONFIDENCE_EXCELLENT:
299 return UT_CONFIDENCE_PERFECT;
301 diff -urN abiword-2.8.2/plugins/wordperfect/xp/ie_imp_WordPerfect.h abiword-2.8.2.new//plugins/wordperfect/xp/ie_imp_WordPerfect.h
302 --- abiword-2.8.2/plugins/wordperfect/xp/ie_imp_WordPerfect.h 2009-06-19 10:55:49.000000000 +0200
303 +++ abiword-2.8.2.new//plugins/wordperfect/xp/ie_imp_WordPerfect.h 2010-12-18 12:02:29.184921950 +0100
309 -#define POINT WPX_POINT
311 #include <libwpd/libwpd.h>
316 #include "ut_string.h"
317 #include "ut_string_class.h"
322 -class IE_Imp_WordPerfect : public IE_Imp, public WPXHLListenerImpl
323 +class IE_Imp_WordPerfect : public IE_Imp, public WPXDocumentInterface
326 IE_Imp_WordPerfect(PD_Document * pDocument);
328 virtual void insertCoveredTableCell(const WPXPropertyList & /*propList*/) {}
329 virtual void closeTable();
331 + virtual void definePageStyle(const WPXPropertyList&) {}
332 + virtual void defineParagraphStyle(const WPXPropertyList&, const WPXPropertyListVector&) {}
333 + virtual void defineCharacterStyle(const WPXPropertyList&) {}
334 + virtual void defineSectionStyle(const WPXPropertyList&, const WPXPropertyListVector&) {}
335 + virtual void insertSpace() {}
336 + virtual void insertField(const WPXString&, const WPXPropertyList&) {}
337 + virtual void openComment(const WPXPropertyList&) {}
338 + virtual void closeComment() {}
339 + virtual void openTextBox(const WPXPropertyList&) {}
340 + virtual void closeTextBox() {}
341 + virtual void openFrame(const WPXPropertyList&) {}
342 + virtual void closeFrame() {}
343 + virtual void insertBinaryObject(const WPXPropertyList&, const WPXBinaryData&) {}
344 + virtual void insertEquation(const WPXPropertyList&, const WPXString&) {}
348 virtual UT_Error _loadFile(GsfInput * input);
349 diff -urN abiword-2.8.2/plugins/wpg/plugin.m4 abiword-2.8.2.new//plugins/wpg/plugin.m4
350 --- abiword-2.8.2/plugins/wpg/plugin.m4 2008-05-19 16:06:19.000000000 +0200
351 +++ abiword-2.8.2.new//plugins/wpg/plugin.m4 2010-12-18 12:02:29.188255745 +0100
354 -wpg_pkgs="$gsf_req libwpg-0.1 >= 0.1.0 libwpd-0.8 >= 0.8.0"
355 +wpg_pkgs="$gsf_req libwpg-0.2 >= 0.2.0 libwpd-0.9 >= 0.9.0 libwpd-stream-0.9 >= 0.9.0"
358 if test "$enable_wpg" != ""; then
359 diff -urN abiword-2.8.2/plugins/wpg/xp/ie_impGraphic_WPG.cpp abiword-2.8.2.new//plugins/wpg/xp/ie_impGraphic_WPG.cpp
360 --- abiword-2.8.2/plugins/wpg/xp/ie_impGraphic_WPG.cpp 2008-08-15 23:52:32.000000000 +0200
361 +++ abiword-2.8.2.new//plugins/wpg/xp/ie_impGraphic_WPG.cpp 2010-12-18 12:02:29.188255745 +0100
363 #include <gsf/gsf-input-memory.h>
364 #include <gsf/gsf-input-stdio.h>
365 #include <gsf/gsf-infile-msole.h>
366 -#include <libwpd/WPXStream.h>
367 +#include <libwpd-stream/libwpd-stream.h>
368 #include "xap_Module.h"
370 using libwpg::WPGraphics;
371 -using libwpg::WPGString;
373 ABI_PLUGIN_DECLARE("WPG")
376 virtual bool isOLEStream();
377 virtual WPXInputStream * getDocumentOLEStream();
378 virtual WPXInputStream * getDocumentOLEStream(const char * name);
379 - virtual const uint8_t *read(size_t numBytes, size_t &numBytesRead);
380 + virtual const unsigned char *read(unsigned long numBytes, unsigned long &numBytesRead);
381 virtual int seek(long offset, WPX_SEEK_TYPE seekType);
383 virtual bool atEOS();
387 AbiWordPerfectGraphicsInputStream::AbiWordPerfectGraphicsInputStream(GsfInput *input) :
388 - WPXInputStream(true),
394 g_object_unref(G_OBJECT(m_input));
397 -const uint8_t * AbiWordPerfectGraphicsInputStream::read(size_t numBytes, size_t &numBytesRead)
398 +const unsigned char * AbiWordPerfectGraphicsInputStream::read(unsigned long numBytes, unsigned long &numBytesRead)
400 - const uint8_t *buf = gsf_input_read(m_input, numBytes, NULL);
401 + const unsigned char *buf = gsf_input_read(m_input, numBytes, NULL);
405 @@ -245,10 +244,10 @@
406 UT_Error IE_Imp_WordPerfectGraphics::importGraphic(GsfInput *input, FG_Graphic **ppfg)
408 AbiWordPerfectGraphicsInputStream gsfInput(input);
409 - WPGString svgOutput;
410 + WPXString svgOutput;
411 if (WPGraphics::generateSVG(&gsfInput, svgOutput))
413 - GsfInput * svgInput = gsf_input_memory_new((const guint8*)svgOutput.cstr(), svgOutput.length(), false);
414 + GsfInput * svgInput = gsf_input_memory_new((const guint8*)svgOutput.cstr(), svgOutput.len(), false);
415 UT_Error result = IE_ImpGraphic::loadGraphic(svgInput, IE_ImpGraphic::fileTypeForSuffix(".svg"), ppfg);
416 g_object_unref(svgInput);