From 560f9bac4c1ee1b044efc55af8d532e9efefd313 Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Fri, 5 Feb 2021 21:19:32 +0100 Subject: oox: prefix VML shapetype ids with _x0000_t Word 2013 refuses to even load a file that has a 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 --- sax/source/tools/fastserializer.cxx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'sax') 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); -- cgit