From 6e216adedd1a131808b874784c36141607264eac Mon Sep 17 00:00:00 2001 From: Miklos Vajna Date: Wed, 15 Jan 2014 13:02:52 +0100 Subject: filter: audit customshape type -> drawingML preset shape table It turns out that this table contained entries which are not valid drawingML preset shape names. Invalid entries are now either have a valid name instead (based on the oox/source/export/preset-definitions-to-shape-types.pl mapping, which already tries to map VML shape ID's to drawingML preset strings), or in case I found no mapping there, the entry is now simply commented out. It's still better to fall back to export a shape as a rectangle than corrupting the whole document. Change-Id: Ic2d8926e5819f3312aaca55d50a1492332e52a9d --- sw/qa/extras/ooxmlexport/data/mso-spt180.docx | Bin 0 -> 10496 bytes sw/qa/extras/ooxmlexport/ooxmlexport.cxx | 15 +++++++++++++++ 2 files changed, 15 insertions(+) create mode 100644 sw/qa/extras/ooxmlexport/data/mso-spt180.docx (limited to 'sw') diff --git a/sw/qa/extras/ooxmlexport/data/mso-spt180.docx b/sw/qa/extras/ooxmlexport/data/mso-spt180.docx new file mode 100644 index 000000000000..bf3a801a96a3 Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/mso-spt180.docx differ diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx index f9ef75e5fa97..f093b5dc2663 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx @@ -2454,6 +2454,21 @@ DECLARE_OOXMLEXPORT_TEST(testTrackChangesParagraphProperties, "testTrackChangesP assertXPathChildren(pXmlDoc, "/w:document/w:body/w:p[1]/w:pPr/w:pPrChange", 0); } +DECLARE_OOXMLEXPORT_TEST(testMsoSpt180, "mso-spt180.docx") +{ + if (!m_bExported) + return; + + uno::Reference xGroup(getShape(1), uno::UNO_QUERY); + uno::Sequence aProps = getProperty< uno::Sequence >(xGroup->getByIndex(0), "CustomShapeGeometry"); + OUString aType; + for (int i = 0; i < aProps.getLength(); ++i) + if (aProps[i].Name == "Type") + aType = aProps[i].Value.get(); + // This was exported as borderCallout90, which is an invalid drawingML preset shape string. + CPPUNIT_ASSERT_EQUAL(OUString("ooxml-borderCallout1"), aType); +} + #endif CPPUNIT_PLUGIN_IMPLEMENT(); -- cgit