]>
Commit | Line | Data |
---|---|---|
92a8eb2b JB |
1 | From 9ffb1f6ac0f11fd446fd0e84b8dc69898691b4d3 Mon Sep 17 00:00:00 2001 |
2 | From: Kohei Yoshida <kohei@libreoffice.org> | |
3 | Date: Wed, 9 Sep 2020 21:23:48 -0400 | |
4 | Subject: [PATCH] Upgrade liborcus to 0.16.0. | |
5 | ||
6 | Change-Id: Iae29fb26417dfc161698a81bee84e81545969065 | |
7 | Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102502 | |
8 | Tested-by: Jenkins | |
9 | Reviewed-by: Kohei Yoshida <kohei@libreoffice.org> | |
10 | --- | |
11 | RepositoryExternal.mk | 4 +- | |
12 | configure.ac | 2 +- | |
13 | download.lst | 4 +- | |
14 | ...k-all-untentionally-unused-variables.patch | 376 ++++++++++++++++++ | |
15 | external/liborcus/ExternalPackage_liborcus.mk | 8 +- | |
16 | external/liborcus/ExternalProject_liborcus.mk | 4 +- | |
17 | external/liborcus/Library_orcus-parser.mk | 1 + | |
18 | external/liborcus/Library_orcus.mk | 4 + | |
19 | external/liborcus/UnpackedTarball_liborcus.mk | 1 + | |
20 | .../liborcus/windows-constants-hack.patch | 2 +- | |
21 | sc/source/filter/inc/orcusinterface.hxx | 21 +- | |
22 | sc/source/filter/orcus/interface.cxx | 82 ++-- | |
23 | sc/source/filter/orcus/xmlcontext.cxx | 7 +- | |
24 | sc/source/ui/xmlsource/xmlsourcedlg.cxx | 6 +- | |
25 | 14 files changed, 475 insertions(+), 47 deletions(-) | |
26 | create mode 100644 external/liborcus/0001-Mark-all-untentionally-unused-variables.patch | |
27 | ||
28 | diff --git a/RepositoryExternal.mk b/RepositoryExternal.mk | |
29 | index 7f623ac..df765fa 100644 | |
30 | --- a/RepositoryExternal.mk | |
31 | +++ b/RepositoryExternal.mk | |
32 | @@ -3281,7 +3281,7 @@ $(call gb_LinkTarget_set_include,$(1),\ | |
33 | ) | |
34 | ||
35 | $(call gb_LinkTarget_add_libs,$(1),\ | |
36 | - -L$(call gb_UnpackedTarball_get_dir,liborcus)/src/liborcus/.libs -lorcus-0.15 \ | |
37 | + -L$(call gb_UnpackedTarball_get_dir,liborcus)/src/liborcus/.libs -lorcus-0.16 \ | |
38 | ) | |
39 | ||
40 | $(if $(SYSTEM_BOOST), \ | |
41 | @@ -3300,7 +3300,7 @@ $(call gb_LinkTarget_set_include,$(1),\ | |
42 | ) | |
43 | ||
44 | $(call gb_LinkTarget_add_libs,$(1),\ | |
45 | - -L$(call gb_UnpackedTarball_get_dir,liborcus)/src/parser/.libs -lorcus-parser-0.15 \ | |
46 | + -L$(call gb_UnpackedTarball_get_dir,liborcus)/src/parser/.libs -lorcus-parser-0.16 \ | |
47 | ) | |
48 | ||
49 | endef | |
50 | diff --git a/configure.ac b/configure.ac | |
51 | index ce14b54..36342b1 100644 | |
52 | --- a/configure.ac | |
53 | +++ b/configure.ac | |
54 | @@ -9827,7 +9827,7 @@ AC_SUBST(ENABLE_FUZZERS) | |
55 | dnl =================================================================== | |
56 | dnl Orcus | |
57 | dnl =================================================================== | |
58 | -libo_CHECK_SYSTEM_MODULE([orcus],[ORCUS],[liborcus-0.15 >= 0.15.0]) | |
59 | +libo_CHECK_SYSTEM_MODULE([orcus],[ORCUS],[liborcus-0.16 >= 0.16.0]) | |
60 | if test "$with_system_orcus" != "yes"; then | |
61 | if test "$SYSTEM_BOOST" = "TRUE"; then | |
62 | # =========================================================== | |
63 | diff --git a/download.lst b/download.lst | |
64 | index 6398a09..1f3b4b1 100644 | |
65 | --- a/download.lst | |
66 | +++ b/download.lst | |
3ad21b55 | 67 | @@ -196,8 +196,8 @@ |
92a8eb2b JB |
68 | export OPENLDAP_TARBALL := openldap-2.4.45.tgz |
69 | export OPENSSL_SHA256SUM := 14cb464efe7ac6b54799b34456bd69558a749a4931ecfd9cf9f71d7881cac7bc | |
70 | export OPENSSL_TARBALL := openssl-1.0.2t.tar.gz | |
3ad21b55 JB |
71 | -export ORCUS_SHA256SUM := 0dd26f3f2e611c51df9ee02d6dbf08887989eaa417b73f6877cd0d94df795fc2 |
72 | -export ORCUS_TARBALL := liborcus-0.15.3.tar.gz | |
92a8eb2b JB |
73 | +export ORCUS_SHA256SUM := 854c6ec167ace59baa2984e175bac7b5b2af91bfde4bb10d2088b87a51ed76ec |
74 | +export ORCUS_TARBALL := liborcus-0.16.0.tar.bz2 | |
75 | export OWNCLOUD_ANDROID_LIB_SHA256SUM := b18b3e3ef7fae6a79b62f2bb43cc47a5346b6330f6a383dc4be34439aca5e9fb | |
76 | export OWNCLOUD_ANDROID_LIB_TARBALL := owncloud-android-library-0.9.4-no-binary-deps.tar.gz | |
77 | export PAGEMAKER_SHA256SUM := 66adacd705a7d19895e08eac46d1e851332adf2e736c566bef1164e7a442519d | |
78 | diff --git a/external/liborcus/0001-Mark-all-untentionally-unused-variables.patch b/external/liborcus/0001-Mark-all-untentionally-unused-variables.patch | |
79 | new file mode 100644 | |
80 | index 0000000..b0f6a57 | |
81 | --- /dev/null | |
82 | +++ b/external/liborcus/0001-Mark-all-untentionally-unused-variables.patch | |
83 | @@ -0,0 +1,376 @@ | |
84 | +From 6d34c41b661a9e8dddf6d08bf1f3c1fd4f5581da Mon Sep 17 00:00:00 2001 | |
85 | +From: Kohei Yoshida <kohei.yoshida@gmail.com> | |
86 | +Date: Fri, 11 Sep 2020 21:39:09 -0400 | |
87 | +Subject: [PATCH] Mark all untentionally unused variables. | |
88 | + | |
89 | +--- | |
90 | + include/orcus/css_parser.hpp | 70 ++++++++++++++++++++++++------ | |
91 | + include/orcus/csv_parser.hpp | 5 ++- | |
92 | + include/orcus/json_parser.hpp | 15 +++++-- | |
93 | + include/orcus/sax_parser.hpp | 35 ++++++++++++--- | |
94 | + include/orcus/sax_token_parser.hpp | 20 +++++++-- | |
95 | + include/orcus/yaml_parser.hpp | 10 ++++- | |
96 | + 6 files changed, 124 insertions(+), 31 deletions(-) | |
97 | + | |
98 | +diff --git a/include/orcus/css_parser.hpp b/include/orcus/css_parser.hpp | |
99 | +index cdfae5e0..3e96980b 100644 | |
100 | +--- a/include/orcus/css_parser.hpp | |
101 | ++++ b/include/orcus/css_parser.hpp | |
102 | +@@ -31,23 +31,44 @@ namespace orcus { | |
103 | + class css_handler | |
104 | + { | |
105 | + public: | |
106 | +- void at_rule_name(const char* p, size_t n) {} | |
107 | ++ void at_rule_name(const char* p, size_t n) | |
108 | ++ { | |
109 | ++ (void)p; (void)n; | |
110 | ++ } | |
111 | + | |
112 | +- void simple_selector_type(const char* p, size_t n) {} | |
113 | ++ void simple_selector_type(const char* p, size_t n) | |
114 | ++ { | |
115 | ++ (void)p; (void)n; | |
116 | ++ } | |
117 | + | |
118 | +- void simple_selector_class(const char* p, size_t n) {} | |
119 | ++ void simple_selector_class(const char* p, size_t n) | |
120 | ++ { | |
121 | ++ (void)p; (void)n; | |
122 | ++ } | |
123 | + | |
124 | +- void simple_selector_pseudo_element(orcus::css::pseudo_element_t pe) {} | |
125 | ++ void simple_selector_pseudo_element(orcus::css::pseudo_element_t pe) | |
126 | ++ { | |
127 | ++ (void)pe; | |
128 | ++ } | |
129 | + | |
130 | +- void simple_selector_pseudo_class(orcus::css::pseudo_class_t pc) {} | |
131 | ++ void simple_selector_pseudo_class(orcus::css::pseudo_class_t pc) | |
132 | ++ { | |
133 | ++ (void)pc; | |
134 | ++ } | |
135 | + | |
136 | +- void simple_selector_id(const char* p, size_t n) {} | |
137 | ++ void simple_selector_id(const char* p, size_t n) | |
138 | ++ { | |
139 | ++ (void)p; (void)n; | |
140 | ++ } | |
141 | + | |
142 | + void end_simple_selector() {} | |
143 | + | |
144 | + void end_selector() {} | |
145 | + | |
146 | +- void combinator(orcus::css::combinator_t combinator) {} | |
147 | ++ void combinator(orcus::css::combinator_t combinator) | |
148 | ++ { | |
149 | ++ (void)combinator; | |
150 | ++ } | |
151 | + | |
152 | + /** | |
153 | + * Called at each property name. | |
154 | +@@ -55,7 +76,10 @@ public: | |
155 | + * @param p pointer to the char-array containing the property name string. | |
156 | + * @param n length of the property name string. | |
157 | + */ | |
158 | +- void property_name(const char* p, size_t n) {} | |
159 | ++ void property_name(const char* p, size_t n) | |
160 | ++ { | |
161 | ++ (void)p; (void)n; | |
162 | ++ } | |
163 | + | |
164 | + /** | |
165 | + * Called at each ordinary property value string. | |
166 | +@@ -63,7 +87,10 @@ public: | |
167 | + * @param p pointer to the char-array containing the value string. | |
168 | + * @param n length of the value string. | |
169 | + */ | |
170 | +- void value(const char* p, size_t n) {} | |
171 | ++ void value(const char* p, size_t n) | |
172 | ++ { | |
173 | ++ (void)p; (void)n; | |
174 | ++ } | |
175 | + | |
176 | + /** | |
177 | + * Called at each RGB color value of a property. | |
178 | +@@ -72,7 +99,10 @@ public: | |
179 | + * @param green value of green (0-255) | |
180 | + * @param blue value of blue (0-255) | |
181 | + */ | |
182 | +- void rgb(uint8_t red, uint8_t green, uint8_t blue) {} | |
183 | ++ void rgb(uint8_t red, uint8_t green, uint8_t blue) | |
184 | ++ { | |
185 | ++ (void)red; (void)green; (void)blue; | |
186 | ++ } | |
187 | + | |
188 | + /** | |
189 | + * Called at each RGB color value of a property with alpha transparency | |
190 | +@@ -83,7 +113,10 @@ public: | |
191 | + * @param blue value of blue (0-255) | |
192 | + * @param alpha alpha transparency value | |
193 | + */ | |
194 | +- void rgba(uint8_t red, uint8_t green, uint8_t blue, double alpha) {} | |
195 | ++ void rgba(uint8_t red, uint8_t green, uint8_t blue, double alpha) | |
196 | ++ { | |
197 | ++ (void)red; (void)green; (void)blue; (void)alpha; | |
198 | ++ } | |
199 | + | |
200 | + /** | |
201 | + * Called at each HSL color value of a property. | |
202 | +@@ -92,7 +125,10 @@ public: | |
203 | + * @param sat saturation | |
204 | + * @param light lightness | |
205 | + */ | |
206 | +- void hsl(uint8_t hue, uint8_t sat, uint8_t light) {} | |
207 | ++ void hsl(uint8_t hue, uint8_t sat, uint8_t light) | |
208 | ++ { | |
209 | ++ (void)hue; (void)sat; (void)light; | |
210 | ++ } | |
211 | + | |
212 | + /** | |
213 | + * Called at each HSL color value of a property with alpha transparency | |
214 | +@@ -103,7 +139,10 @@ public: | |
215 | + * @param light lightness | |
216 | + * @param alpha alpha value | |
217 | + */ | |
218 | +- void hsla(uint8_t hue, uint8_t sat, uint8_t light, double alpha) {} | |
219 | ++ void hsla(uint8_t hue, uint8_t sat, uint8_t light, double alpha) | |
220 | ++ { | |
221 | ++ (void)hue; (void)sat; (void)light; (void)alpha; | |
222 | ++ } | |
223 | + | |
224 | + /** | |
225 | + * Called at each URL value of a property. | |
226 | +@@ -111,7 +150,10 @@ public: | |
227 | + * @param p pointer to the char-array containing the URL value string. | |
228 | + * @param n length of the URL value string. | |
229 | + */ | |
230 | +- void url(const char* p, size_t n) {} | |
231 | ++ void url(const char* p, size_t n) | |
232 | ++ { | |
233 | ++ (void)p; (void)n; | |
234 | ++ } | |
235 | + | |
236 | + /** | |
237 | + * Called when the parsing begins. | |
238 | +diff --git a/include/orcus/csv_parser.hpp b/include/orcus/csv_parser.hpp | |
239 | +index a873b0f2..27b4f924 100644 | |
240 | +--- a/include/orcus/csv_parser.hpp | |
241 | ++++ b/include/orcus/csv_parser.hpp | |
242 | +@@ -47,7 +47,10 @@ public: | |
243 | + * the text content is guaranteed to be valid so long as | |
244 | + * the original CSV stream content is valid. | |
245 | + */ | |
246 | +- void cell(const char* p, size_t n, bool transient) {} | |
247 | ++ void cell(const char* p, size_t n, bool transient) | |
248 | ++ { | |
249 | ++ (void)p; (void)n; (void)transient; | |
250 | ++ } | |
251 | + }; | |
252 | + | |
253 | + template<typename _Handler> | |
254 | +diff --git a/include/orcus/json_parser.hpp b/include/orcus/json_parser.hpp | |
255 | +index 51a3d7cc..ef22b3a8 100644 | |
256 | +--- a/include/orcus/json_parser.hpp | |
257 | ++++ b/include/orcus/json_parser.hpp | |
258 | +@@ -54,7 +54,10 @@ public: | |
259 | + * pointer points to somewhere in the JSON stream being | |
260 | + * parsed. | |
261 | + */ | |
262 | +- void object_key(const char* p, size_t len, bool transient) {} | |
263 | ++ void object_key(const char* p, size_t len, bool transient) | |
264 | ++ { | |
265 | ++ (void)p; (void)len; (void)transient; | |
266 | ++ } | |
267 | + | |
268 | + /** | |
269 | + * Called when the closing curly brace of an object is encountered. | |
270 | +@@ -87,14 +90,20 @@ public: | |
271 | + * pointer points to somewhere in the JSON stream being | |
272 | + * parsed. | |
273 | + */ | |
274 | +- void string(const char* p, size_t len, bool transient) {} | |
275 | ++ void string(const char* p, size_t len, bool transient) | |
276 | ++ { | |
277 | ++ (void)p; (void)len; (void)transient; | |
278 | ++ } | |
279 | + | |
280 | + /** | |
281 | + * Called when a numeric value is encountered. | |
282 | + * | |
283 | + * @param val numeric value. | |
284 | + */ | |
285 | +- void number(double val) {} | |
286 | ++ void number(double val) | |
287 | ++ { | |
288 | ++ (void)val; | |
289 | ++ } | |
290 | + }; | |
291 | + | |
292 | + /** | |
293 | +diff --git a/include/orcus/sax_parser.hpp b/include/orcus/sax_parser.hpp | |
294 | +index 73c17d06..3b21bfdf 100644 | |
295 | +--- a/include/orcus/sax_parser.hpp | |
296 | ++++ b/include/orcus/sax_parser.hpp | |
297 | +@@ -30,7 +30,10 @@ public: | |
298 | + * | |
299 | + * @param param struct containing doctype declaration data. | |
300 | + */ | |
301 | +- void doctype(const orcus::sax::doctype_declaration& param) {} | |
302 | ++ void doctype(const orcus::sax::doctype_declaration& param) | |
303 | ++ { | |
304 | ++ (void)param; | |
305 | ++ } | |
306 | + | |
307 | + /** | |
308 | + * Called when <?... is encountered, where the '...' may be an | |
309 | +@@ -39,28 +42,40 @@ public: | |
310 | + * | |
311 | + * @param decl name of the identifier. | |
312 | + */ | |
313 | +- void start_declaration(const orcus::pstring& decl) {} | |
314 | ++ void start_declaration(const orcus::pstring& decl) | |
315 | ++ { | |
316 | ++ (void)decl; | |
317 | ++ } | |
318 | + | |
319 | + /** | |
320 | + * Called when the closing tag (>) of a <?... ?> is encountered. | |
321 | + * | |
322 | + * @param decl name of the identifier. | |
323 | + */ | |
324 | +- void end_declaration(const orcus::pstring& decl) {} | |
325 | ++ void end_declaration(const orcus::pstring& decl) | |
326 | ++ { | |
327 | ++ (void)decl; | |
328 | ++ } | |
329 | + | |
330 | + /** | |
331 | + * Called at the start of each element. | |
332 | + * | |
333 | + * @param elem information of the element being parsed. | |
334 | + */ | |
335 | +- void start_element(const orcus::sax::parser_element& elem) {} | |
336 | ++ void start_element(const orcus::sax::parser_element& elem) | |
337 | ++ { | |
338 | ++ (void)elem; | |
339 | ++ } | |
340 | + | |
341 | + /** | |
342 | + * Called at the end of each element. | |
343 | + * | |
344 | + * @param elem information of the element being parsed. | |
345 | + */ | |
346 | +- void end_element(const orcus::sax::parser_element& elem) {} | |
347 | ++ void end_element(const orcus::sax::parser_element& elem) | |
348 | ++ { | |
349 | ++ (void)elem; | |
350 | ++ } | |
351 | + | |
352 | + /** | |
353 | + * Called when a segment of a text content is parsed. Each text content | |
354 | +@@ -76,7 +91,10 @@ public: | |
355 | + * a non-text value or be interned within the scope of | |
356 | + * the callback</em>. | |
357 | + */ | |
358 | +- void characters(const orcus::pstring& val, bool transient) {} | |
359 | ++ void characters(const orcus::pstring& val, bool transient) | |
360 | ++ { | |
361 | ++ (void)val; (void)transient; | |
362 | ++ } | |
363 | + | |
364 | + /** | |
365 | + * Called upon parsing of an attribute of an element. Note that <em>when | |
366 | +@@ -86,7 +104,10 @@ public: | |
367 | + * | |
368 | + * @param attr struct containing attribute information. | |
369 | + */ | |
370 | +- void attribute(const orcus::sax::parser_attribute& attr) {} | |
371 | ++ void attribute(const orcus::sax::parser_attribute& attr) | |
372 | ++ { | |
373 | ++ (void)attr; | |
374 | ++ } | |
375 | + }; | |
376 | + | |
377 | + /** | |
378 | +diff --git a/include/orcus/sax_token_parser.hpp b/include/orcus/sax_token_parser.hpp | |
379 | +index 1452bc27..6b1b1de4 100644 | |
380 | +--- a/include/orcus/sax_token_parser.hpp | |
381 | ++++ b/include/orcus/sax_token_parser.hpp | |
382 | +@@ -71,7 +71,10 @@ public: | |
383 | + * | |
384 | + * @param decl struct containing the attributes of the XML declaration. | |
385 | + */ | |
386 | +- void declaration(const orcus::xml_declaration_t& decl) {} | |
387 | ++ void declaration(const orcus::xml_declaration_t& decl) | |
388 | ++ { | |
389 | ++ (void)decl; | |
390 | ++ } | |
391 | + | |
392 | + /** | |
393 | + * Called at the start of each element. | |
394 | +@@ -79,7 +82,10 @@ public: | |
395 | + * @param elem struct containing the element's information as well as all | |
396 | + * the attributes that belong to the element. | |
397 | + */ | |
398 | +- void start_element(const orcus::xml_token_element_t& elem) {} | |
399 | ++ void start_element(const orcus::xml_token_element_t& elem) | |
400 | ++ { | |
401 | ++ (void)elem; | |
402 | ++ } | |
403 | + | |
404 | + /** | |
405 | + * Called at the end of each element. | |
406 | +@@ -87,7 +93,10 @@ public: | |
407 | + * @param elem struct containing the element's information as well as all | |
408 | + * the attributes that belong to the element. | |
409 | + */ | |
410 | +- void end_element(const orcus::xml_token_element_t& elem) {} | |
411 | ++ void end_element(const orcus::xml_token_element_t& elem) | |
412 | ++ { | |
413 | ++ (void)elem; | |
414 | ++ } | |
415 | + | |
416 | + /** | |
417 | + * Called when a segment of a text content is parsed. Each text content | |
418 | +@@ -103,7 +112,10 @@ public: | |
419 | + * a non-text value or be interned within the scope of | |
420 | + * the callback</em>. | |
421 | + */ | |
422 | +- void characters(const orcus::pstring& val, bool transient) {} | |
423 | ++ void characters(const orcus::pstring& val, bool transient) | |
424 | ++ { | |
425 | ++ (void)val; (void)transient; | |
426 | ++ } | |
427 | + }; | |
428 | + | |
429 | + /** | |
430 | +diff --git a/include/orcus/yaml_parser.hpp b/include/orcus/yaml_parser.hpp | |
431 | +index 797ebbec..8d16fbc7 100644 | |
432 | +--- a/include/orcus/yaml_parser.hpp | |
433 | ++++ b/include/orcus/yaml_parser.hpp | |
434 | +@@ -72,14 +72,20 @@ public: | |
435 | + * @param p pointer to the first character of the string value. | |
436 | + * @param len length of the string value. | |
437 | + */ | |
438 | +- void string(const char* p, size_t n) {} | |
439 | ++ void string(const char* p, size_t n) | |
440 | ++ { | |
441 | ++ (void)p; (void)n; | |
442 | ++ } | |
443 | + | |
444 | + /** | |
445 | + * Called when a numeric value is encountered. | |
446 | + * | |
447 | + * @param val numeric value. | |
448 | + */ | |
449 | +- void number(double val) {} | |
450 | ++ void number(double val) | |
451 | ++ { | |
452 | ++ (void)val; | |
453 | ++ } | |
454 | + | |
455 | + /** | |
456 | + * Called when a boolean 'true' keyword is encountered. | |
457 | +-- | |
458 | +2.25.1 | |
459 | + | |
460 | diff --git a/external/liborcus/ExternalPackage_liborcus.mk b/external/liborcus/ExternalPackage_liborcus.mk | |
461 | index 21dd1bf..7476918 100644 | |
462 | --- a/external/liborcus/ExternalPackage_liborcus.mk | |
463 | +++ b/external/liborcus/ExternalPackage_liborcus.mk | |
464 | @@ -12,11 +12,11 @@ $(eval $(call gb_ExternalPackage_ExternalPackage,liborcus,liborcus)) | |
465 | $(eval $(call gb_ExternalPackage_use_external_project,liborcus,liborcus)) | |
466 | ||
467 | ifeq ($(OS),MACOSX) | |
468 | -$(eval $(call gb_ExternalPackage_add_file,liborcus,$(LIBO_LIB_FOLDER)/liborcus-0.15.0.dylib,src/liborcus/.libs/liborcus-0.15.0.dylib)) | |
469 | -$(eval $(call gb_ExternalPackage_add_file,liborcus,$(LIBO_LIB_FOLDER)/liborcus-parser-0.15.0.dylib,src/parser/.libs/liborcus-parser-0.15.0.dylib)) | |
470 | +$(eval $(call gb_ExternalPackage_add_file,liborcus,$(LIBO_LIB_FOLDER)/liborcus-0.16.0.dylib,src/liborcus/.libs/liborcus-0.16.0.dylib)) | |
471 | +$(eval $(call gb_ExternalPackage_add_file,liborcus,$(LIBO_LIB_FOLDER)/liborcus-parser-0.16.0.dylib,src/parser/.libs/liborcus-parser-0.16.0.dylib)) | |
472 | else ifeq ($(DISABLE_DYNLOADING),) | |
473 | -$(eval $(call gb_ExternalPackage_add_file,liborcus,$(LIBO_LIB_FOLDER)/liborcus-0.15.so.0,src/liborcus/.libs/liborcus-0.15.so.0.0.0)) | |
474 | -$(eval $(call gb_ExternalPackage_add_file,liborcus,$(LIBO_LIB_FOLDER)/liborcus-parser-0.15.so.0,src/parser/.libs/liborcus-parser-0.15.so.0.0.0)) | |
475 | +$(eval $(call gb_ExternalPackage_add_file,liborcus,$(LIBO_LIB_FOLDER)/liborcus-0.16.so.0,src/liborcus/.libs/liborcus-0.16.so.0.0.0)) | |
476 | +$(eval $(call gb_ExternalPackage_add_file,liborcus,$(LIBO_LIB_FOLDER)/liborcus-parser-0.16.so.0,src/parser/.libs/liborcus-parser-0.16.so.0.0.0)) | |
477 | endif | |
478 | ||
479 | # vim: set noet sw=4 ts=4: | |
480 | diff --git a/external/liborcus/ExternalProject_liborcus.mk b/external/liborcus/ExternalProject_liborcus.mk | |
481 | index 38658cc..3671294 100644 | |
482 | --- a/external/liborcus/ExternalProject_liborcus.mk | |
483 | +++ b/external/liborcus/ExternalProject_liborcus.mk | |
3ad21b55 | 484 | @@ -122,8 +122,8 @@ |
92a8eb2b JB |
485 | $(MAKE) \ |
486 | $(if $(filter MACOSX,$(OS)),\ | |
487 | && $(PERL) $(SRCDIR)/solenv/bin/macosx-change-install-names.pl shl OOO \ | |
488 | - $(EXTERNAL_WORKDIR)/src/liborcus/.libs/liborcus-0.15.0.dylib \ | |
489 | - $(EXTERNAL_WORKDIR)/src/parser/.libs/liborcus-parser-0.15.0.dylib \ | |
490 | + $(EXTERNAL_WORKDIR)/src/liborcus/.libs/liborcus-0.16.0.dylib \ | |
491 | + $(EXTERNAL_WORKDIR)/src/parser/.libs/liborcus-parser-0.16.0.dylib \ | |
492 | ) \ | |
493 | ) | |
3ad21b55 | 494 | |
92a8eb2b JB |
495 | diff --git a/external/liborcus/Library_orcus-parser.mk b/external/liborcus/Library_orcus-parser.mk |
496 | index d3cbddb..4e46591 100644 | |
497 | --- a/external/liborcus/Library_orcus-parser.mk | |
498 | +++ b/external/liborcus/Library_orcus-parser.mk | |
499 | @@ -63,6 +63,7 @@ $(eval $(call gb_Library_add_generated_exception_objects,orcus-parser,\ | |
500 | UnpackedTarball/liborcus/src/parser/tokens \ | |
501 | UnpackedTarball/liborcus/src/parser/types \ | |
502 | UnpackedTarball/liborcus/src/parser/xml_namespace \ | |
503 | + UnpackedTarball/liborcus/src/parser/xml_writer \ | |
504 | UnpackedTarball/liborcus/src/parser/yaml_parser_base \ | |
505 | UnpackedTarball/liborcus/src/parser/zip_archive \ | |
506 | UnpackedTarball/liborcus/src/parser/zip_archive_stream \ | |
507 | diff --git a/external/liborcus/Library_orcus.mk b/external/liborcus/Library_orcus.mk | |
508 | index ea99e75..0a0ca58 100644 | |
509 | --- a/external/liborcus/Library_orcus.mk | |
510 | +++ b/external/liborcus/Library_orcus.mk | |
511 | @@ -85,6 +85,7 @@ $(eval $(call gb_Library_add_generated_exception_objects,orcus,\ | |
512 | UnpackedTarball/liborcus/src/liborcus/odf_tokens \ | |
513 | UnpackedTarball/liborcus/src/liborcus/ods_content_xml_context \ | |
514 | UnpackedTarball/liborcus/src/liborcus/ods_content_xml_handler \ | |
515 | + UnpackedTarball/liborcus/src/liborcus/ods_dde_links_context \ | |
516 | UnpackedTarball/liborcus/src/liborcus/ods_session_data \ | |
517 | UnpackedTarball/liborcus/src/liborcus/ooxml_content_types \ | |
518 | UnpackedTarball/liborcus/src/liborcus/ooxml_global \ | |
519 | @@ -103,6 +104,7 @@ $(eval $(call gb_Library_add_generated_exception_objects,orcus,\ | |
520 | UnpackedTarball/liborcus/src/liborcus/orcus_xls_xml \ | |
521 | UnpackedTarball/liborcus/src/liborcus/orcus_xlsx \ | |
522 | UnpackedTarball/liborcus/src/liborcus/orcus_xml \ | |
523 | + UnpackedTarball/liborcus/src/liborcus/orcus_xml_impl \ | |
524 | UnpackedTarball/liborcus/src/liborcus/orcus_xml_map_def \ | |
525 | UnpackedTarball/liborcus/src/liborcus/session_context \ | |
526 | UnpackedTarball/liborcus/src/liborcus/spreadsheet_iface_util \ | |
527 | @@ -134,7 +136,9 @@ $(eval $(call gb_Library_add_generated_exception_objects,orcus,\ | |
528 | UnpackedTarball/liborcus/src/liborcus/xml_simple_stream_handler \ | |
529 | UnpackedTarball/liborcus/src/liborcus/xml_stream_handler \ | |
530 | UnpackedTarball/liborcus/src/liborcus/xml_stream_parser \ | |
531 | + UnpackedTarball/liborcus/src/liborcus/xml_structure_mapper \ | |
532 | UnpackedTarball/liborcus/src/liborcus/xml_structure_tree \ | |
533 | + UnpackedTarball/liborcus/src/liborcus/xpath_parser \ | |
534 | UnpackedTarball/liborcus/src/liborcus/yaml_document_tree \ | |
535 | )) | |
536 | ||
537 | diff --git a/external/liborcus/UnpackedTarball_liborcus.mk b/external/liborcus/UnpackedTarball_liborcus.mk | |
538 | index e5e33b0..4736dbc 100644 | |
539 | --- a/external/liborcus/UnpackedTarball_liborcus.mk | |
540 | +++ b/external/liborcus/UnpackedTarball_liborcus.mk | |
541 | @@ -20,6 +20,7 @@ $(eval $(call gb_UnpackedTarball_add_patches,liborcus,\ | |
542 | external/liborcus/gcc9.patch.0 \ | |
543 | external/liborcus/libtool.patch.0 \ | |
544 | external/liborcus/fix-pch.patch.0 \ | |
545 | + external/liborcus/0001-Mark-all-untentionally-unused-variables.patch \ | |
546 | )) | |
547 | ||
548 | ifeq ($(OS),WNT) | |
549 | diff --git a/external/liborcus/windows-constants-hack.patch b/external/liborcus/windows-constants-hack.patch | |
550 | index 876bc16..51aabfa 100644 | |
551 | --- a/external/liborcus/windows-constants-hack.patch | |
552 | +++ b/external/liborcus/windows-constants-hack.patch | |
553 | @@ -8,7 +8,7 @@ index ae571f5..539ce18 100644 | |
554 | ||
555 | -#include "constants.inl" | |
556 | +#define ORCUS_MAJOR_VERSION 0 | |
557 | -+#define ORCUS_MINOR_VERSION 11 | |
558 | ++#define ORCUS_MINOR_VERSION 16 | |
559 | +#define ORCUS_MICRO_VERSION 0 | |
560 | ||
561 | namespace orcus { | |
562 | diff --git a/sc/source/filter/inc/orcusinterface.hxx b/sc/source/filter/inc/orcusinterface.hxx | |
563 | index b298c71..00aea67 100644 | |
564 | --- a/sc/source/filter/inc/orcusinterface.hxx | |
565 | +++ b/sc/source/filter/inc/orcusinterface.hxx | |
566 | @@ -62,6 +62,11 @@ public: | |
567 | { | |
568 | return mnTextEncoding; | |
569 | } | |
570 | + | |
571 | + ScDocumentImport& getDoc() const | |
572 | + { | |
573 | + return mrDoc; | |
574 | + } | |
575 | }; | |
576 | ||
577 | class ScOrcusRefResolver : public orcus::spreadsheet::iface::import_reference_resolver | |
3ad21b55 | 578 | @@ -81,20 +81,28 @@ |
92a8eb2b JB |
579 | public: |
580 | ScOrcusRefResolver( const ScOrcusGlobalSettings& rGS ); | |
581 | ||
582 | - orcus::spreadsheet::address_t resolve_address(const char* p, size_t n) override; | |
583 | - orcus::spreadsheet::range_t resolve_range(const char* p, size_t n) override; | |
584 | + orcus::spreadsheet::src_address_t resolve_address(const char* p, size_t n) override; | |
585 | + orcus::spreadsheet::src_range_t resolve_range(const char* p, size_t n) override; | |
586 | }; | |
587 | ||
588 | class ScOrcusNamedExpression : public orcus::spreadsheet::iface::import_named_expression | |
589 | { | |
590 | ScDocumentImport& mrDoc; | |
591 | const ScOrcusGlobalSettings& mrGlobalSettings; | |
3ad21b55 | 592 | - SCTAB const mnTab; //< negative if global, else >= 0 for sheet-local named expressions. |
92a8eb2b JB |
593 | + ScAddress maBasePos; |
594 | + OUString maName; | |
595 | + OUString maExpr; | |
596 | + const SCTAB mnTab; //< negative if global, else >= 0 for sheet-local named expressions. | |
597 | ||
598 | public: | |
599 | ScOrcusNamedExpression( ScDocumentImport& rDoc, const ScOrcusGlobalSettings& rGS, SCTAB nTab = -1 ); | |
600 | ||
601 | - virtual void define_name(const char* p_name, size_t n_name, const char* p_exp, size_t n_exp) override; | |
602 | + void reset(); | |
603 | + | |
604 | + virtual void set_base_position(const orcus::spreadsheet::src_address_t& pos) override; | |
605 | + virtual void set_named_expression(const char* p_name, size_t n_name, const char* p_exp, size_t n_exp) override; | |
606 | + virtual void set_named_range(const char* p_name, size_t n_name, const char* p_range, size_t n_range) override; | |
607 | + virtual void commit() override; | |
608 | }; | |
609 | ||
610 | class ScOrcusSharedStrings : public orcus::spreadsheet::iface::import_shared_strings | |
611 | diff --git a/sc/source/filter/orcus/interface.cxx b/sc/source/filter/orcus/interface.cxx | |
612 | index 220f7ce..aa96eb2 100644 | |
613 | --- a/sc/source/filter/orcus/interface.cxx | |
614 | +++ b/sc/source/filter/orcus/interface.cxx | |
615 | @@ -46,6 +46,7 @@ | |
616 | #include <sal/log.hxx> | |
617 | ||
618 | #include <stylesbuffer.hxx> | |
619 | +#include <orcus/exception.hpp> | |
620 | ||
621 | using namespace com::sun::star; | |
622 | ||
623 | @@ -158,51 +159,54 @@ orcus::spreadsheet::formula_grammar_t ScOrcusGlobalSettings::get_default_formula | |
624 | ScOrcusRefResolver::ScOrcusRefResolver( const ScOrcusGlobalSettings& rGS ) : | |
625 | mrGlobalSettings(rGS) {} | |
626 | ||
627 | -os::address_t ScOrcusRefResolver::resolve_address(const char* p, size_t n) | |
628 | +os::src_address_t ScOrcusRefResolver::resolve_address(const char* p, size_t n) | |
629 | { | |
630 | OUString aStr(p, n, mrGlobalSettings.getTextEncoding()); | |
631 | ||
632 | ScAddress aAddr; | |
633 | - aAddr.Parse(aStr, nullptr, | |
634 | + aAddr.Parse(aStr, &mrGlobalSettings.getDoc().getDoc(), | |
635 | formula::FormulaGrammar::extractRefConvention( | |
636 | mrGlobalSettings.getCalcGrammar())); | |
637 | ||
638 | - os::address_t ret; | |
639 | - ret.column = 0; | |
640 | - ret.row = 0; | |
641 | - | |
642 | - if (aAddr.IsValid()) | |
643 | + if (!aAddr.IsValid()) | |
644 | { | |
645 | - ret.column = aAddr.Col(); | |
646 | - ret.row = aAddr.Row(); | |
647 | + std::ostringstream os; | |
648 | + os << "'" << std::string(p, n) << "' is not a valid address expression."; | |
649 | + throw orcus::invalid_arg_error(os.str()); | |
650 | } | |
651 | ||
652 | + os::src_address_t ret; | |
653 | + ret.sheet = aAddr.Tab(); | |
654 | + ret.column = aAddr.Col(); | |
655 | + ret.row = aAddr.Row(); | |
656 | + | |
657 | return ret; | |
658 | } | |
659 | ||
660 | -os::range_t ScOrcusRefResolver::resolve_range(const char* p, size_t n) | |
661 | +os::src_range_t ScOrcusRefResolver::resolve_range(const char* p, size_t n) | |
662 | { | |
663 | OUString aStr(p, n, mrGlobalSettings.getTextEncoding()); | |
664 | ||
665 | ScRange aRange; | |
666 | - aRange.Parse(aStr, nullptr, | |
667 | + aRange.Parse(aStr, &mrGlobalSettings.getDoc().getDoc(), | |
668 | formula::FormulaGrammar::extractRefConvention( | |
669 | mrGlobalSettings.getCalcGrammar())); | |
670 | ||
671 | - os::range_t ret; | |
672 | - ret.first.column = 0; | |
673 | - ret.first.row = 0; | |
674 | - ret.last.column = 0; | |
675 | - ret.last.row = 0; | |
676 | - | |
677 | - if (aRange.IsValid()) | |
678 | + if (!aRange.IsValid()) | |
679 | { | |
680 | - ret.first.column = aRange.aStart.Col(); | |
681 | - ret.first.row = aRange.aStart.Row(); | |
682 | - ret.last.column = aRange.aEnd.Col(); | |
683 | - ret.last.row = aRange.aEnd.Row(); | |
684 | + std::ostringstream os; | |
685 | + os << "'" << std::string(p, n) << "' is not a valid range expression."; | |
686 | + throw orcus::invalid_arg_error(os.str()); | |
687 | } | |
688 | ||
689 | + os::src_range_t ret; | |
690 | + ret.first.sheet = aRange.aStart.Tab(); | |
691 | + ret.first.column = aRange.aStart.Col(); | |
692 | + ret.first.row = aRange.aStart.Row(); | |
693 | + ret.last.sheet = aRange.aEnd.Tab(); | |
694 | + ret.last.column = aRange.aEnd.Col(); | |
695 | + ret.last.row = aRange.aEnd.Row(); | |
696 | + | |
697 | return ret; | |
698 | } | |
699 | ||
700 | @@ -210,20 +214,46 @@ ScOrcusNamedExpression::ScOrcusNamedExpression( | |
701 | ScDocumentImport& rDoc, const ScOrcusGlobalSettings& rGS, SCTAB nTab ) : | |
702 | mrDoc(rDoc), mrGlobalSettings(rGS), mnTab(nTab) {} | |
703 | ||
704 | -void ScOrcusNamedExpression::define_name(const char* p_name, size_t n_name, const char* p_exp, size_t n_exp) | |
705 | +void ScOrcusNamedExpression::reset() | |
706 | +{ | |
707 | + maBasePos.SetTab(0); | |
708 | + maBasePos.SetCol(0); | |
709 | + maBasePos.SetRow(0); | |
710 | + maName.clear(); | |
711 | + maExpr.clear(); | |
712 | +} | |
713 | + | |
714 | +void ScOrcusNamedExpression::set_base_position(const orcus::spreadsheet::src_address_t& pos) | |
715 | +{ | |
716 | + maBasePos.SetTab(pos.sheet); | |
717 | + maBasePos.SetCol(pos.column); | |
718 | + maBasePos.SetRow(pos.row); | |
719 | +} | |
720 | + | |
721 | +void ScOrcusNamedExpression::set_named_expression(const char* p_name, size_t n_name, const char* p_exp, size_t n_exp) | |
722 | +{ | |
723 | + maName = OUString(p_name, n_name, mrGlobalSettings.getTextEncoding()); | |
724 | + maExpr = OUString(p_exp, n_exp, mrGlobalSettings.getTextEncoding()); | |
725 | +} | |
726 | + | |
727 | +void ScOrcusNamedExpression::set_named_range(const char* /*p_name*/, size_t /*n_name*/, const char* /*p_range*/, size_t /*n_range*/) | |
728 | { | |
729 | - OUString aName(p_name, n_name, mrGlobalSettings.getTextEncoding()); | |
730 | - OUString aExpr(p_exp, n_exp, mrGlobalSettings.getTextEncoding()); | |
731 | + throw std::runtime_error("ScOrcusNamedExpression::set_named_range not implemented yet."); | |
732 | +} | |
733 | ||
734 | +void ScOrcusNamedExpression::commit() | |
735 | +{ | |
736 | ScRangeName* pNames = mnTab >= 0 ? mrDoc.getDoc().GetRangeName(mnTab) : mrDoc.getDoc().GetRangeName(); | |
737 | if (!pNames) | |
738 | return; | |
739 | ||
740 | ScRangeData* pRange = new ScRangeData( | |
741 | - &mrDoc.getDoc(), aName, aExpr, ScAddress(), ScRangeData::Type::Name, | |
742 | + &mrDoc.getDoc(), maName, maExpr, maBasePos, ScRangeData::Type::Name, | |
743 | mrGlobalSettings.getCalcGrammar()); | |
744 | ||
745 | pNames->insert(pRange, false); | |
746 | + | |
747 | + reset(); // make sure to reset the state for the next run. | |
748 | } | |
749 | ||
750 | ScOrcusFactory::CellStoreToken::CellStoreToken(const ScAddress& rPos, Type eType) | |
751 | diff --git a/sc/source/filter/orcus/xmlcontext.cxx b/sc/source/filter/orcus/xmlcontext.cxx | |
752 | index ab16ae6..09f3ba9 100644 | |
753 | --- a/sc/source/filter/orcus/xmlcontext.cxx | |
754 | +++ b/sc/source/filter/orcus/xmlcontext.cxx | |
755 | @@ -89,10 +89,9 @@ void populateTree( | |
756 | rTreeCtrl.set_image(*xEntry, rParam.maImgElementRepeat, -1); | |
757 | } | |
758 | ||
759 | - orcus::xml_structure_tree::entity_names_type aNames; | |
760 | + orcus::xml_structure_tree::entity_names_type aNames = rWalker.get_attributes(); | |
761 | ||
762 | // Insert attributes. | |
763 | - rWalker.get_attributes(aNames); | |
764 | for (const orcus::xml_structure_tree::entity_name& rAttrName : aNames) | |
765 | { | |
766 | OUString sAttr(toString(rAttrName, rWalker)); | |
767 | @@ -106,7 +105,7 @@ void populateTree( | |
768 | rTreeCtrl.set_image(*xAttr, rParam.maImgAttribute, -1); | |
769 | } | |
770 | ||
771 | - rWalker.get_children(aNames); | |
772 | + aNames = rWalker.get_children(); | |
773 | ||
774 | // Non-leaf if it has child elements, leaf otherwise. | |
775 | rEntryData.mbLeafNode = aNames.empty(); | |
776 | @@ -266,7 +265,7 @@ void ScOrcusXMLContextImpl::importXML(const ScOrcusImportXMLParam& rParam) | |
777 | std::for_each(rLink.maFieldPaths.begin(), rLink.maFieldPaths.end(), | |
778 | [&filter](const OString& rFieldPath) | |
779 | { | |
780 | - filter.append_field_link(rFieldPath.getStr()); | |
781 | + filter.append_field_link(rFieldPath.getStr(), orcus::pstring()); | |
782 | } | |
783 | ); | |
784 | ||
785 | diff --git a/sc/source/ui/xmlsource/xmlsourcedlg.cxx b/sc/source/ui/xmlsource/xmlsourcedlg.cxx | |
786 | index 1eb2e4b..167ecae 100644 | |
787 | --- a/sc/source/ui/xmlsource/xmlsourcedlg.cxx | |
788 | +++ b/sc/source/ui/xmlsource/xmlsourcedlg.cxx | |
789 | @@ -49,8 +49,12 @@ OUString getXPath( | |
790 | if (pData) | |
791 | rNamespaces.push_back(pData->mnNamespaceID); | |
792 | ||
793 | + // element separator is '/' whereas attribute separator is '/@' in xpath. | |
794 | aBuf.insert(0, rTree.get_text(*xEntry, 0)); | |
795 | - aBuf.insert(0, isAttribute(rTree, *xEntry) ? '@' : '/'); | |
796 | + if (isAttribute(rTree, *xEntry)) | |
797 | + aBuf.insert(0, "/@"); | |
798 | + else | |
799 | + aBuf.insert(0, '/'); | |
800 | } | |
801 | while (rTree.iter_parent(*xEntry)); | |
802 | ||
803 | -- | |
804 | 2.26.2 | |
805 |