Gentoo Archives: gentoo-commits

From: "Pacho Ramos (pacho)" <pacho@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in app-office/abiword/files: abiword-2.8.6-libwpd.patch
Date: Sun, 04 Dec 2011 20:03:13
Message-Id: 20111204200304.505412004C@flycatcher.gentoo.org
1 pacho 11/12/04 20:03:04
2
3 Added: abiword-2.8.6-libwpd.patch
4 Log:
5 Include Fedora patch to make abiword-2.8 compatible with libwpd:0.9 as upstream doesn't want to fix it for 2.8.x (is already solved in 2.9).
6
7 (Portage version: 2.1.10.39/cvs/Linux x86_64)
8
9 Revision Changes Path
10 1.1 app-office/abiword/files/abiword-2.8.6-libwpd.patch
11
12 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-office/abiword/files/abiword-2.8.6-libwpd.patch?rev=1.1&view=markup
13 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-office/abiword/files/abiword-2.8.6-libwpd.patch?rev=1.1&content-type=text/plain
14
15 Index: abiword-2.8.6-libwpd.patch
16 ===================================================================
17 --- plugins/wordperfect/xp/ie_imp_WordPerfect.cpp (revision 29401)
18 +++ plugins/wordperfect/xp/ie_imp_WordPerfect.cpp (revision 29403)
19 @@ -60,7 +60,7 @@
20
21 // Stream class
22
23 -#include <libwpd/WPXStream.h>
24 +#include <libwpd-stream/libwpd-stream.h>
25
26 #include <gsf/gsf-input.h>
27 #include <gsf/gsf-infile.h>
28 @@ -70,12 +70,7 @@
29 #include <libwps/libwps.h>
30 #endif
31
32 -class AbiWordperfectInputStream :
33 -#ifdef HAVE_LIBWPS
34 - public WPSInputStream
35 -#else
36 - public WPXInputStream
37 -#endif
38 +class AbiWordperfectInputStream : public WPXInputStream
39 {
40 public:
41 AbiWordperfectInputStream(GsfInput *input);
42 @@ -86,7 +81,7 @@
43
44 virtual WPXInputStream * getDocumentOLEStream(const char * name);
45
46 - virtual const uint8_t *read(size_t numBytes, size_t &numBytesRead);
47 + virtual const unsigned char *read(unsigned long numBytes, unsigned long &numBytesRead);
48 virtual int seek(long offset, WPX_SEEK_TYPE seekType);
49 virtual long tell();
50 virtual bool atEOS();
51 @@ -98,11 +93,7 @@
52 };
53
54 AbiWordperfectInputStream::AbiWordperfectInputStream(GsfInput *input) :
55 -#ifdef HAVE_LIBWPS
56 - WPSInputStream(),
57 -#else
58 - WPXInputStream(true),
59 -#endif
60 + WPXInputStream(),
61 m_input(input),
62 m_ole(NULL)
63 {
64 @@ -117,9 +108,9 @@
65 g_object_unref(G_OBJECT(m_input));
66 }
67
68 -const uint8_t * AbiWordperfectInputStream::read(size_t numBytes, size_t &numBytesRead)
69 +const unsigned char * AbiWordperfectInputStream::read(unsigned long numBytes, unsigned long &numBytesRead)
70 {
71 - const uint8_t *buf = gsf_input_read(m_input, numBytes, NULL);
72 + const unsigned char *buf = gsf_input_read(m_input, numBytes, NULL);
73
74 if (buf == NULL)
75 numBytesRead = 0;
76 @@ -256,19 +247,12 @@
77 {
78 AbiWordperfectInputStream gsfInput(input);
79
80 - WPDConfidence confidence = WPDocument::isFileFormatSupported(&gsfInput, true);
81 + WPDConfidence confidence = WPDocument::isFileFormatSupported(&gsfInput);
82
83 switch (confidence)
84 {
85 case WPD_CONFIDENCE_NONE:
86 - // libwpd > 0.7.1 reports POOR if the text file is plain text (that _could_ be a WP4x document)
87 - // however, we'll let the text importer handle such cases
88 - case WPD_CONFIDENCE_POOR:
89 return UT_CONFIDENCE_ZILCH;
90 - case WPD_CONFIDENCE_LIKELY:
91 - return UT_CONFIDENCE_SOSO;
92 - case WPD_CONFIDENCE_GOOD:
93 - return UT_CONFIDENCE_GOOD;
94 case WPD_CONFIDENCE_EXCELLENT:
95 return UT_CONFIDENCE_PERFECT;
96 default:
97 @@ -328,7 +312,7 @@
98 UT_Error IE_Imp_WordPerfect::_loadFile(GsfInput * input)
99 {
100 AbiWordperfectInputStream gsfInput(input);
101 - WPDResult error = WPDocument::parse(&gsfInput, static_cast<WPXHLListenerImpl *>(this));
102 + WPDResult error = WPDocument::parse(&gsfInput, static_cast<WPXDocumentInterface *>(this), NULL);
103
104 if (error != WPD_OK)
105 {
106 @@ -381,9 +365,9 @@
107 float marginLeft = 1.0f, marginRight = 1.0f;
108
109 if (propList["fo:margin-left"])
110 - marginLeft = propList["fo:margin-left"]->getFloat();
111 + marginLeft = propList["fo:margin-left"]->getDouble();
112 if (propList["fo:margin-right"])
113 - marginRight = propList["fo:margin-right"]->getFloat();
114 + marginRight = propList["fo:margin-right"]->getDouble();
115
116 if (marginLeft != m_leftPageMargin || marginRight != m_rightPageMargin /* || */
117 /* marginTop != m_marginBottom || marginBottom != m_marginBottom */ )
118 @@ -456,15 +440,15 @@
119 float marginTop = 0.0f, marginBottom = 0.0f;
120 float marginLeft = 0.0f, marginRight = 0.0f, textIndent = 0.0f;
121 if (propList["fo:margin-top"])
122 - marginTop = propList["fo:margin-top"]->getFloat();
123 + marginTop = propList["fo:margin-top"]->getDouble();
124 if (propList["fo:margin-bottom"])
125 - marginBottom = propList["fo:margin-bottom"]->getFloat();
126 + marginBottom = propList["fo:margin-bottom"]->getDouble();
127 if (propList["fo:margin-left"])
128 - marginLeft = propList["fo:margin-left"]->getFloat();
129 + marginLeft = propList["fo:margin-left"]->getDouble();
130 if (propList["fo:margin-right"])
131 - marginRight = propList["fo:margin-right"]->getFloat();
132 + marginRight = propList["fo:margin-right"]->getDouble();
133 if (propList["fo:text-indent"])
134 - textIndent = propList["fo:text-indent"]->getFloat();
135 + textIndent = propList["fo:text-indent"]->getDouble();
136
137 m_topMargin = marginTop;
138 m_bottomMargin = marginBottom;
139 @@ -487,7 +471,7 @@
140
141 float lineSpacing = 1.0f;
142 if (propList["fo:line-height"])
143 - lineSpacing = propList["fo:line-height"]->getFloat();
144 + lineSpacing = propList["fo:line-height"]->getDouble();
145
146 UT_String tmpBuffer;
147 UT_String_sprintf(tmpBuffer, "; margin-top:%.4fin; margin-bottom:%.4fin; margin-left:%.4fin; margin-right:%.4fin; text-indent:%.4fin; line-height:%.4f",
148 @@ -504,7 +488,7 @@
149 propBuffer += tmpBuffer;
150 if (i()["style:position"])
151 {
152 - UT_String_sprintf(tmpBuffer, "%.4fin", i()["style:position"]->getFloat());
153 + UT_String_sprintf(tmpBuffer, "%.4fin", i()["style:position"]->getDouble());
154 propBuffer += tmpBuffer;
155 }
156
157 @@ -520,10 +504,10 @@
158 else // Left aligned is default
159 propBuffer += "/L";
160
161 - if (i()["style:leader-char"])
162 - if (i()["style:leader-char"]->getStr() == "-")
163 + if (i()["style:leader-text"])
164 + if (i()["style:leader-text"]->getStr() == "-")
165 propBuffer += "2";
166 - else if (i()["style:leader-char"]->getStr() == "_")
167 + else if (i()["style:leader-text"]->getStr() == "_")
168 propBuffer += "3";
169 else // default to dot leader if the given leader is dot or is not supported by AbiWord
170 propBuffer += "1";
171 @@ -586,12 +570,12 @@
172 propBuffer += "subscript";
173 }
174
175 - if (propList["style:text-underline"] || propList["style:text-crossing-out"])
176 + if (propList["style:text-underline-type"] || propList["style:text-line-through-type"])
177 {
178 propBuffer += "; text-decoration:";
179 - if (propList["style:text-underline"])
180 + if (propList["style:text-underline-type"])
181 propBuffer += "underline ";
182 - if (propList["style:text-crossing-out"])
183 + if (propList["style:text-line-through-type"])
184 propBuffer += "line-through";
185
186 }
187 @@ -615,10 +599,10 @@
188 propBuffer += propList["fo:color"]->getStr().cstr();
189 }
190
191 - if (propList["style:text-background-color"])
192 + if (propList["fo:background-color"])
193 {
194 propBuffer += "; bgcolor:";
195 - propBuffer += propList["style:text-background-color"]->getStr().cstr();
196 + propBuffer += propList["fo:background-color"]->getStr().cstr();
197 }
198
199 UT_DEBUGMSG(("AbiWordPerfect: Appending span format: %s\n", propBuffer.c_str()));
200 @@ -639,10 +623,10 @@
201 int columnsCount = ((columns.count() == 0) ? 1 : columns.count());
202
203 // TODO: support spaceAfter
204 - if (propList["fo:margin-left"])
205 - marginLeft = propList["fo:margin-left"]->getFloat();
206 - if (propList["fo:margin-right"])
207 - marginRight = propList["fo:margin-right"]->getFloat();
208 + if (propList["fo:start-indent"])
209 + marginLeft = propList["fo:start-indent"]->getDouble();
210 + if (propList["fo:end-indent"])
211 + marginRight = propList["fo:end-indent"]->getDouble();
212
213 if (marginLeft != m_leftSectionMargin || marginRight != m_rightSectionMargin || m_sectionColumnsCount != columnsCount)
214 m_bSectionChanged = true;
215 @@ -709,9 +693,9 @@
216 if (propList["style:num-format"])
217 listType = propList["style:num-format"]->getStr().cstr()[0];
218 if (propList["text:space-before"])
219 - listLeftOffset = propList["text:space-before"]->getFloat();
220 + listLeftOffset = propList["text:space-before"]->getDouble();
221 if (propList["text:min-label-width"])
222 - listMinLabelWidth = propList["text:min-label-width"]->getFloat();
223 + listMinLabelWidth = propList["text:min-label-width"]->getDouble();
224
225 if (!m_pCurrentListDefinition ||
226 m_pCurrentListDefinition->getOutlineHash() != listID ||
227 @@ -749,9 +733,9 @@
228 if (propList["libwpd:level"])
229 level = propList["libwpd:level"]->getInt();
230 if (propList["text:space-before"])
231 - listLeftOffset = propList["text:space-before"]->getFloat();
232 + listLeftOffset = propList["text:space-before"]->getDouble();
233 if (propList["text:min-label-width"])
234 - listMinLabelWidth = propList["text:min-label-width"]->getFloat();
235 + listMinLabelWidth = propList["text:min-label-width"]->getDouble();
236
237 if (!m_pCurrentListDefinition || m_pCurrentListDefinition->getOutlineHash() != listID)
238 {
239 @@ -871,10 +855,10 @@
240
241 UT_String_sprintf(tempBuffer, "margin-left:%.4fin; ", m_pCurrentListDefinition->getListLeftOffset(m_iCurrentListLevel)
242 + m_pCurrentListDefinition->getListMinLabelWidth(m_iCurrentListLevel)
243 - - (propList["fo:text-indent"] ? propList["fo:text-indent"]->getFloat() : 0.0f));
244 + - (propList["fo:text-indent"] ? propList["fo:text-indent"]->getDouble() : 0.0f));
245 propBuffer += tempBuffer;
246 UT_String_sprintf(tempBuffer, "text-indent:%.4fin", - m_pCurrentListDefinition->getListMinLabelWidth(m_iCurrentListLevel)
247 - + (propList["fo:text-indent"] ? propList["fo:text-indent"]->getFloat() : 0.0f));
248 + + (propList["fo:text-indent"] ? propList["fo:text-indent"]->getDouble() : 0.0f));
249 propBuffer += tempBuffer;
250
251 listAttribs[attribsCount++] = PT_PROPS_ATTRIBUTE_NAME;
252 @@ -1263,7 +1247,7 @@
253 virtual UT_Error _loadFile(GsfInput * input)
254 {
255 AbiWordperfectInputStream gsfInput(input);
256 - WPSResult error = WPSDocument::parse(&gsfInput, static_cast<WPXHLListenerImpl *>(this));
257 + WPSResult error = WPSDocument::parse(&gsfInput, static_cast<WPXDocumentInterface *>(this));
258
259 if (error != WPS_OK)
260 {
261 @@ -1302,18 +1286,12 @@
262 {
263 AbiWordperfectInputStream gsfInput(input);
264
265 - WPSConfidence confidence = WPSDocument::isFileFormatSupported(&gsfInput, true);
266 + WPSConfidence confidence = WPSDocument::isFileFormatSupported(&gsfInput);
267
268 switch (confidence)
269 {
270 case WPS_CONFIDENCE_NONE:
271 return UT_CONFIDENCE_ZILCH;
272 - case WPS_CONFIDENCE_POOR:
273 - return UT_CONFIDENCE_POOR;
274 - case WPS_CONFIDENCE_LIKELY:
275 - return UT_CONFIDENCE_SOSO;
276 - case WPS_CONFIDENCE_GOOD:
277 - return UT_CONFIDENCE_GOOD;
278 case WPS_CONFIDENCE_EXCELLENT:
279 return UT_CONFIDENCE_PERFECT;
280 default:
281 --- plugins/wordperfect/xp/ie_imp_WordPerfect.h (revision 29401)
282 +++ plugins/wordperfect/xp/ie_imp_WordPerfect.h (revision 29403)
283 @@ -30,13 +30,7 @@
284 #define IE_IMP_WP_H
285
286 #include <stdio.h>
287 -#ifdef _WIN32
288 -#define POINT WPX_POINT
289 -#endif
290 #include <libwpd/libwpd.h>
291 -#ifdef _WIN32
292 -#undef POINT
293 -#endif
294 #include "ie_imp.h"
295 #include "ut_string.h"
296 #include "ut_string_class.h"
297 @@ -98,7 +92,7 @@
298 IE_Imp ** ppie);
299 };
300
301 -class IE_Imp_WordPerfect : public IE_Imp, public WPXHLListenerImpl
302 +class IE_Imp_WordPerfect : public IE_Imp, public WPXDocumentInterface
303 {
304 public:
305 IE_Imp_WordPerfect(PD_Document * pDocument);
306 @@ -154,6 +148,21 @@
307 virtual void insertCoveredTableCell(const WPXPropertyList & /*propList*/) {}
308 virtual void closeTable();
309
310 + virtual void definePageStyle(const WPXPropertyList&) {}
311 + virtual void defineParagraphStyle(const WPXPropertyList&, const WPXPropertyListVector&) {}
312 + virtual void defineCharacterStyle(const WPXPropertyList&) {}
313 + virtual void defineSectionStyle(const WPXPropertyList&, const WPXPropertyListVector&) {}
314 + virtual void insertSpace() {}
315 + virtual void insertField(const WPXString&, const WPXPropertyList&) {}
316 + virtual void openComment(const WPXPropertyList&) {}
317 + virtual void closeComment() {}
318 + virtual void openTextBox(const WPXPropertyList&) {}
319 + virtual void closeTextBox() {}
320 + virtual void openFrame(const WPXPropertyList&) {}
321 + virtual void closeFrame() {}
322 + virtual void insertBinaryObject(const WPXPropertyList&, const WPXBinaryData&) {}
323 + virtual void insertEquation(const WPXPropertyList&, const WPXString&) {}
324 +
325
326 protected:
327 virtual UT_Error _loadFile(GsfInput * input);
328 --- plugins/wordperfect/plugin.m4 (revision 29401)
329 +++ plugins/wordperfect/plugin.m4 (revision 29403)
330 @@ -1,6 +1,6 @@
331
332 -wordperfect_pkgs="libwpd-0.8 >= 0.8.0 $gsf_req"
333 -wordperfect_wps_pkgs='libwps-0.1 >= 0.1.0'
334 +wordperfect_pkgs="libwpg-0.2 >= 0.2.0 libwpd-0.9 >= 0.9.0 libwpd-stream-0.9 >= 0.9.0 $gsf_req"
335 +wordperfect_wps_pkgs='libwps-0.2 >= 0.1.0'
336 wordperfect_deps="no"
337
338 WORDPERFECT_CFLAGS=
339 --- plugins/wpg/xp/ie_impGraphic_WPG.cpp (revision 29401)
340 +++ plugins/wpg/xp/ie_impGraphic_WPG.cpp (revision 29403)
341 @@ -31,11 +31,10 @@
342 #include <gsf/gsf-input-memory.h>
343 #include <gsf/gsf-input-stdio.h>
344 #include <gsf/gsf-infile-msole.h>
345 -#include <libwpd/WPXStream.h>
346 +#include <libwpd-stream/libwpd-stream.h>
347 #include "xap_Module.h"
348
349 using libwpg::WPGraphics;
350 -using libwpg::WPGString;
351
352 ABI_PLUGIN_DECLARE("WPG")
353
354 @@ -48,7 +47,7 @@
355 virtual bool isOLEStream();
356 virtual WPXInputStream * getDocumentOLEStream();
357 virtual WPXInputStream * getDocumentOLEStream(const char * name);
358 - virtual const uint8_t *read(size_t numBytes, size_t &numBytesRead);
359 + virtual const unsigned char *read(unsigned long numBytes, unsigned long &numBytesRead);
360 virtual int seek(long offset, WPX_SEEK_TYPE seekType);
361 virtual long tell();
362 virtual bool atEOS();
363 @@ -60,7 +59,7 @@
364 };
365
366 AbiWordPerfectGraphicsInputStream::AbiWordPerfectGraphicsInputStream(GsfInput *input) :
367 - WPXInputStream(true),
368 + WPXInputStream(),
369 m_input(input),
370 m_ole(NULL)
371 {
372 @@ -75,9 +74,9 @@
373 g_object_unref(G_OBJECT(m_input));
374 }
375
376 -const uint8_t * AbiWordPerfectGraphicsInputStream::read(size_t numBytes, size_t &numBytesRead)
377 +const unsigned char * AbiWordPerfectGraphicsInputStream::read(unsigned long numBytes, unsigned long &numBytesRead)
378 {
379 - const uint8_t *buf = gsf_input_read(m_input, numBytes, NULL);
380 + const unsigned char *buf = gsf_input_read(m_input, numBytes, NULL);
381
382 if (buf == NULL)
383 numBytesRead = 0;
384 @@ -245,10 +244,10 @@
385 UT_Error IE_Imp_WordPerfectGraphics::importGraphic(GsfInput *input, FG_Graphic **ppfg)
386 {
387 AbiWordPerfectGraphicsInputStream gsfInput(input);
388 - WPGString svgOutput;
389 + WPXString svgOutput;
390 if (WPGraphics::generateSVG(&gsfInput, svgOutput))
391 {
392 - GsfInput * svgInput = gsf_input_memory_new((const guint8*)svgOutput.cstr(), svgOutput.length(), false);
393 + GsfInput * svgInput = gsf_input_memory_new((const guint8*)svgOutput.cstr(), svgOutput.len(), false);
394 UT_Error result = IE_ImpGraphic::loadGraphic(svgInput, IE_ImpGraphic::fileTypeForSuffix(".svg"), ppfg);
395 g_object_unref(svgInput);
396 return result;
397 --- plugins/wpg/plugin.m4 (revision 29401)
398 +++ plugins/wpg/plugin.m4 (revision 29403)
399 @@ -1,5 +1,5 @@
400
401 -wpg_pkgs="$gsf_req libwpg-0.1 >= 0.1.0 libwpd-0.8 >= 0.8.0"
402 +wpg_pkgs="$gsf_req libwpg-0.2 >= 0.2.0 libwpd-0.9 >= 0.9.0 libwpd-stream-0.9 >= 0.9.0"
403 wpg_deps="no"
404
405 if test "$enable_wpg" != ""; then