diff options
author | Eike Rathke <erack@redhat.com> | 2017-06-16 23:17:54 +0200 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2017-06-16 23:18:42 +0200 |
commit | c5bc40ae6cabe240700773df5cc7f010acce6014 (patch) | |
tree | 628392a09b61954372553f649d1291784d03dad5 /sax | |
parent | ce6b877ba89ae4193f7a719a7dfa4bb45ecd04e4 (diff) |
Literal tab character is bad XML, write '	' 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
Diffstat (limited to 'sax')
-rw-r--r-- | sax/source/tools/fastserializer.cxx | 6 |
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( "&", 5 ); break; case '\'': writeBytes( "'", 6 ); break; case '"': writeBytes( """, 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( "	", 4 ); } break; -#endif case '\n': #if 0 if (mbXescape) |