From f540a8031e84e9da7fc9aa08522360dbb365b035 Mon Sep 17 00:00:00 2001 From: Eike Rathke Date: Fri, 16 Jun 2017 23:17:54 +0200 Subject: 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 (cherry picked from commit c5bc40ae6cabe240700773df5cc7f010acce6014) Reviewed-on: https://gerrit.libreoffice.org/38899 Reviewed-by: Eike Rathke Tested-by: Jenkins --- sax/source/tools/fastserializer.cxx | 6 ++---- 1 file 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) -- cgit v1.2.3