summaryrefslogtreecommitdiff
path: root/oox/source/vml/vmlshapecontext.cxx
diff options
context:
space:
mode:
authorMichael Stahl <michael.stahl@allotropia.de>2021-02-05 21:19:32 +0100
committerMichael Stahl <michael.stahl@allotropia.de>2021-02-08 11:47:51 +0100
commit560f9bac4c1ee1b044efc55af8d532e9efefd313 (patch)
tree5e7e3e4abdc3049e46e6e7729833aafe729ee1b6 /oox/source/vml/vmlshapecontext.cxx
parent63d3bf99101e2138a21a74a3d717d4f25d3d242f (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 'oox/source/vml/vmlshapecontext.cxx')
-rw-r--r--oox/source/vml/vmlshapecontext.cxx6
1 files changed, 6 insertions, 0 deletions
diff --git a/oox/source/vml/vmlshapecontext.cxx b/oox/source/vml/vmlshapecontext.cxx
index e1b87a603173..0d0c00b61d8c 100644
--- a/oox/source/vml/vmlshapecontext.cxx
+++ b/oox/source/vml/vmlshapecontext.cxx
@@ -295,11 +295,17 @@ ShapeTypeContext::ShapeTypeContext(ContextHandler2Helper const & rParent,
mrTypeModel.maShapeName = rAttribs.getXString( XML_id, OUString() );
// get ShapeType and ShapeId from name for compatibility
static constexpr OUStringLiteral sShapeTypePrefix = u"shapetype_";
+ OUString tmp;
if( mrTypeModel.maShapeName.startsWith( sShapeTypePrefix ) )
{
mrTypeModel.maShapeId = mrTypeModel.maShapeName;
mrTypeModel.moShapeType = mrTypeModel.maShapeName.copy(sShapeTypePrefix.getLength()).toInt32();
}
+ else if (mrTypeModel.maShapeName.startsWith("_x0000_t", &tmp))
+ {
+ mrTypeModel.maShapeId = mrTypeModel.maShapeName;
+ mrTypeModel.moShapeType = tmp.toInt32();
+ }
}
// coordinate system position/size, CSS style