summaryrefslogtreecommitdiff
path: root/libwpd
diff options
context:
space:
mode:
authorTor Lillqvist <tlillqvist@novell.com>2013-04-03 09:09:17 +0200
committerAndras Timar <atimar@suse.com>2013-04-03 09:09:17 +0200
commit0877d79d0533a0a1a6c6175de7d054d19d9d0066 (patch)
treed05151a359e28faf7750173d60a024cee12a3fdc /libwpd
parent22d2ec9cd84292e06496470906694f693f9ebe1a (diff)
bnc#777181 open XML in Writer
Change-Id: I6f24d59035088b274475d35e9f0d783514226977
Diffstat (limited to 'libwpd')
-rw-r--r--libwpd/UnpackedTarball_wpd.mk8
-rw-r--r--libwpd/libwpd-0.9.6.patch31
2 files changed, 35 insertions, 4 deletions
diff --git a/libwpd/UnpackedTarball_wpd.mk b/libwpd/UnpackedTarball_wpd.mk
index 24e589c288c1..bb6c35d32c86 100644
--- a/libwpd/UnpackedTarball_wpd.mk
+++ b/libwpd/UnpackedTarball_wpd.mk
@@ -13,10 +13,10 @@ $(eval $(call gb_UnpackedTarball_set_tarball,wpd,$(WPD_TARBALL)))
# $(eval $(call gb_UnpackedTarball_set_patchlevel,wpd,0))
-# wpd_patches :=
+wpd_patches := libwpd-0.9.6.patch
-# $(eval $(call gb_UnpackedTarball_add_patches,wpd,\
-# $(foreach patch,$(wpd_patches),libwpd/$(patch)) \
-# ))
+$(eval $(call gb_UnpackedTarball_add_patches,wpd,\
+ $(foreach patch,$(wpd_patches),libwpd/$(patch)) \
+))
# vim: set noet sw=4 ts=4:
diff --git a/libwpd/libwpd-0.9.6.patch b/libwpd/libwpd-0.9.6.patch
new file mode 100644
index 000000000000..c185150f873c
--- /dev/null
+++ b/libwpd/libwpd-0.9.6.patch
@@ -0,0 +1,31 @@
+--- misc/libwpd-0.9.6/src/lib/WP42Heuristics.cpp
++++ misc/build/libwpd-0.9.6/src/lib/WP42Heuristics.cpp
+@@ -70,6 +70,28 @@
+ WPXEncryption *encryption = 0;
+ try
+ {
++ // Disregard XML at least right away
++ if (readU8(input, 0) == '<' &&
++ readU8(input, 0) == '?' &&
++ readU8(input, 0) == 'x' &&
++ readU8(input, 0) == 'm' &&
++ readU8(input, 0) == 'l' &&
++ readU8(input, 0) == ' ')
++ return WPD_CONFIDENCE_NONE;
++ input->seek(0, WPX_SEEK_SET);
++
++ if (readU8(input, 0) == 0xEF &&
++ readU8(input, 0) == 0xBB &&
++ readU8(input, 0) == 0xBF &&
++ readU8(input, 0) == '<' &&
++ readU8(input, 0) == '?' &&
++ readU8(input, 0) == 'x' &&
++ readU8(input, 0) == 'm' &&
++ readU8(input, 0) == 'l' &&
++ readU8(input, 0) == ' ')
++ return WPD_CONFIDENCE_NONE;
++ input->seek(0, WPX_SEEK_SET);
++
+ if (readU8(input, 0) == 0xFE && readU8(input, 0) == 0xFF &&
+ readU8(input, 0) == 0x61 && readU8(input, 0) == 0x61)
+ {