diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2014-01-15 13:02:52 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2014-01-15 15:04:36 +0100 |
commit | 6e216adedd1a131808b874784c36141607264eac (patch) | |
tree | d504b91b16fbfa59c03708a5e7b3ead8f3c4bd3f /sw | |
parent | 0402f6eaa146589951cd4ad30b6d38938fc04dfe (diff) |
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
Diffstat (limited to 'sw')
-rw-r--r-- | sw/qa/extras/ooxmlexport/data/mso-spt180.docx | bin | 0 -> 10496 bytes | |||
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlexport.cxx | 15 |
2 files changed, 15 insertions, 0 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/mso-spt180.docx b/sw/qa/extras/ooxmlexport/data/mso-spt180.docx Binary files differnew file mode 100644 index 000000000000..bf3a801a96a3 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/mso-spt180.docx 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<container::XIndexAccess> xGroup(getShape(1), uno::UNO_QUERY); + uno::Sequence<beans::PropertyValue> aProps = getProperty< uno::Sequence<beans::PropertyValue> >(xGroup->getByIndex(0), "CustomShapeGeometry"); + OUString aType; + for (int i = 0; i < aProps.getLength(); ++i) + if (aProps[i].Name == "Type") + aType = aProps[i].Value.get<OUString>(); + // This was exported as borderCallout90, which is an invalid drawingML preset shape string. + CPPUNIT_ASSERT_EQUAL(OUString("ooxml-borderCallout1"), aType); +} + #endif CPPUNIT_PLUGIN_IMPLEMENT(); |