summaryrefslogtreecommitdiff
path: root/libwpd
diff options
context:
space:
mode:
authorTor Lillqvist <tlillqvist@novell.com>2012-08-27 17:29:04 +0200
committerAndras Timar <atimar@suse.com>2012-09-28 10:35:41 +0200
commit1a8ba3e16e437a9d4b1061a8ec98af8260717936 (patch)
tree06a8937d4443b8829f6b8b8af9d20b14f8ff242e /libwpd
parent4e014747f0057a64d19acc0963ae927f083c47b0 (diff)
bnc#777181 open XML in Writer
Change-Id: I3766ca977d1c09b562e4c74dcf3adc078a550941
Diffstat (limited to 'libwpd')
-rw-r--r--libwpd/libwpd-0.9.4.patch32
1 files changed, 32 insertions, 0 deletions
diff --git a/libwpd/libwpd-0.9.4.patch b/libwpd/libwpd-0.9.4.patch
index e7892be1aaef..af0d3cf3b1a4 100644
--- a/libwpd/libwpd-0.9.4.patch
+++ b/libwpd/libwpd-0.9.4.patch
@@ -16,3 +16,35 @@
}
+
/* vim:set shiftwidth=4 softtabstop=4 noexpandtab: */
+--- misc/libwpd-0.9.4/src/lib/WP42Heuristics.cpp
++++ misc/build/libwpd-0.9.4/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)
+ {
+