diff options
author | Michael Stahl <michael.stahl@allotropia.de> | 2021-02-05 21:19:32 +0100 |
---|---|---|
committer | Michael Stahl <michael.stahl@allotropia.de> | 2021-02-08 11:47:51 +0100 |
commit | 560f9bac4c1ee1b044efc55af8d532e9efefd313 (patch) | |
tree | 5e7e3e4abdc3049e46e6e7729833aafe729ee1b6 /sax | |
parent | 63d3bf99101e2138a21a74a3d717d4f25d3d242f (diff) |
oox: prefix VML shapetype ids with _x0000_t
Word 2013 refuses to even load a file that has a <v:shapetype
id="shapetype_75"> on some form control shape, reporting a misleading
error in a location far later when the top-level w:tbl that contains
the shape ends.
Using id="_x0000_t75" appears to work, so let's do that then.
Couldn't find any documentation on why this is so.
Change-Id: Ie22bb04244e24b00a1880544872ae8e281422405
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110493
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
Diffstat (limited to 'sax')
-rw-r--r-- | sax/source/tools/fastserializer.cxx | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/sax/source/tools/fastserializer.cxx b/sax/source/tools/fastserializer.cxx index 77ed2b29c3d5..c3da14b3453d 100644 --- a/sax/source/tools/fastserializer.cxx +++ b/sax/source/tools/fastserializer.cxx @@ -465,8 +465,12 @@ namespace sax_fastparser { const char* pAttributeValue = rAttrList.getFastAttributeValue(j); - // tdf#127274 don't escape the special VML shape type id "#_x0000_t202" - bool bEscape = !(pAttributeValue && strcmp(pAttributeValue, "#_x0000_t202") == 0); + // tdf#117274 don't escape the special VML shape type id "#_x0000_t202" + bool bEscape = !(pAttributeValue + && *pAttributeValue != '\0' + && (*pAttributeValue == '#' + ? strncmp(pAttributeValue, "#_x0000_t", 9) == 0 + : strncmp(pAttributeValue, "_x0000_t", 8) == 0)); write(pAttributeValue, rAttrList.AttributeValueLength(j), bEscape); |