summaryrefslogtreecommitdiff
path: root/sax
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2017-06-16 23:17:54 +0200
committerEike Rathke <erack@redhat.com>2017-06-17 00:46:13 +0200
commitf540a8031e84e9da7fc9aa08522360dbb365b035 (patch)
treec8469dcc385e198fdadfc254127e62d396dd7331 /sax
parent86dab3a33c0d3547d6c48f0b791cf80c4bbf4f26 (diff)
Literal tab character is bad XML, write '&#9;' instead
Additionally, it *may* have caused document corruption when loading such an .xlsx file, though a small test case with an embedded literal tab character could not reproduce the behaviour. See https://ask.libreoffice.org/en/question/100615/sudden-corruption-of-xlsx-file-bug/ and note that the literal tab character is a mere assumption, but it would be possible. Change-Id: Ia9d33955f1196222d335a1a4807fba78df4e4d85 (cherry picked from commit c5bc40ae6cabe240700773df5cc7f010acce6014) Reviewed-on: https://gerrit.libreoffice.org/38899 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins <ci@libreoffice.org>
Diffstat (limited to 'sax')
-rw-r--r--sax/source/tools/fastserializer.cxx6
1 files changed, 2 insertions, 4 deletions
diff --git a/sax/source/tools/fastserializer.cxx b/sax/source/tools/fastserializer.cxx
index 1424d1e73538..ff74fe3b7079 100644
--- a/sax/source/tools/fastserializer.cxx
+++ b/sax/source/tools/fastserializer.cxx
@@ -150,8 +150,8 @@ namespace sax_fastparser {
case '&': writeBytes( "&amp;", 5 ); break;
case '\'': writeBytes( "&apos;", 6 ); break;
case '"': writeBytes( "&quot;", 6 ); break;
-#if 0
case '\t':
+#if 0
// Seems OOXML prefers the _xHHHH_ escape over the
// entity in *some* cases, apparently in attribute
// values but not in element data.
@@ -163,13 +163,11 @@ namespace sax_fastparser {
writeBytes( bufXescape, kXescapeLen);
}
else
+#endif
{
- // We did never write this, but literal tab
- // instead. Should we?
writeBytes( "&#9;", 4 );
}
break;
-#endif
case '\n':
#if 0
if (mbXescape)