diff options
author | Vinaya Mandke <vinaya.mandke@synerzip.com> | 2014-03-19 11:54:08 +0530 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2014-03-20 11:34:36 +0000 |
commit | 7057d1c9097b7c7aa4d232a9f67199bbf406d3f6 (patch) | |
tree | fc72fd4342dd69091378fc90f9e8706d363d7e7c /sw/qa | |
parent | 370c29237804bd0bd96ae34ab630681044857780 (diff) |
fdo#76101 [DOCX] Export: Limit no of styles in styles.xml
MS Office has an internal limitation of 4091 styles in styles.xml
and cannot load a .docx with more. However the documentation seems to allow
that. So if there are more styles, don't export those.
MS Office follows the same principle and repairs the corrupt document by
removing extra styles.
Change-Id: I20c8775ee9d697a6613be96eb01283844c1d78f5
Reviewed-on: https://gerrit.libreoffice.org/8653
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
Diffstat (limited to 'sw/qa')
-rw-r--r-- | sw/qa/extras/ooxmlexport/data/fdo76101.docx | bin | 0 -> 88435 bytes | |||
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlexport.cxx | 10 |
2 files changed, 10 insertions, 0 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/fdo76101.docx b/sw/qa/extras/ooxmlexport/data/fdo76101.docx Binary files differnew file mode 100644 index 000000000000..d2264f3f8883 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo76101.docx diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx index 22127556de78..11c1ab076e8a 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx @@ -2920,6 +2920,16 @@ DECLARE_OOXMLEXPORT_TEST(test76317, "test76317.docx") assertXPath(pXmlDoc, "/w:document[1]/w:body[1]/w:p[1]/w:r[1]/mc:AlternateContent[1]/mc:Choice[1]/w:drawing[1]/wp:anchor[1]/a:graphic[1]/a:graphicData[1]/wps:wsp[1]/wps:spPr[1]/a:prstGeom[1]", "prst", "hexagon"); } +DECLARE_OOXMLEXPORT_TEST(testFdo76101, "fdo76101.docx") +{ + xmlDocPtr pXmlDoc = parseExport("word/styles.xml"); + + if (!pXmlDoc) + return; + xmlNodeSetPtr pXmlNodes = getXPathNode(pXmlDoc, "/w:styles/w:style"); + CPPUNIT_ASSERT(4091 >= xmlXPathNodeSetGetLength(pXmlNodes)); +} + DECLARE_OOXMLEXPORT_TEST(test76317_2K10, "test76317_2K10.docx") { xmlDocPtr pXmlDoc = parseExport("word/document.xml"); |