diff options
author | Vasily Melenchuk <vasily.melenchuk@cib.de> | 2021-11-11 10:39:32 +0300 |
---|---|---|
committer | Thorsten Behrens <thorsten.behrens@allotropia.de> | 2021-11-18 08:42:43 +0100 |
commit | 75a49947c2eeb831a8e02192f1c4856eac62a743 (patch) | |
tree | 48ffef4ba2f9e429ccfd71af8fe990c05b144a13 /sw/qa/extras | |
parent | 1d80f90afb479227044bdf0876c5576007abfdce (diff) |
tdf#81507: word content control support for w:multiLine
<w:text multiLine="1"/> is now supported for import/export
to DOCX. Like other content control items it is stored in
grabbag.
Change-Id: Id6f1aa0072dc5db980d0fa43cab4b38a0aa047fc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125024
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
Diffstat (limited to 'sw/qa/extras')
-rw-r--r-- | sw/qa/extras/ooxmlexport/data/tdf81507.docx | bin | 0 -> 20183 bytes | |||
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlexport17.cxx | 22 |
2 files changed, 22 insertions, 0 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/tdf81507.docx b/sw/qa/extras/ooxmlexport/data/tdf81507.docx Binary files differnew file mode 100644 index 000000000000..2c00ee44cb24 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf81507.docx diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx index 36555f71a671..0a7879269a75 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx @@ -115,6 +115,28 @@ DECLARE_OOXMLEXPORT_TEST(testTdf142407, "tdf142407.docx") CPPUNIT_ASSERT_EQUAL( sal_Int16(36), nGridLines); // was 23, left large space before text. } +DECLARE_OOXMLEXPORT_TEST(testTdf81507, "tdf81507.docx") +{ + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + if (!pXmlDoc) + return; // initial import, no futher checks + + // Ensure that we have <w:text w:multiLine="1"/> + CPPUNIT_ASSERT_EQUAL(OUString("1"), getXPath(pXmlDoc, "/w:document/w:body/w:sdt[1]/w:sdtPr/w:text", "multiLine")); + + // Ensure that we have <w:text w:multiLine="0"/> + CPPUNIT_ASSERT_EQUAL(OUString("0"), getXPath(pXmlDoc, "/w:document/w:body/w:sdt[2]/w:sdtPr/w:text", "multiLine")); + + // Ensure that we have <w:text/> + getXPath(pXmlDoc, "/w:document/w:body/w:sdt[3]/w:sdtPr/w:text", ""); + + // Ensure that we have no <w:text/> (not quite correct case, but to ensure import/export are okay) + xmlXPathObjectPtr pXmlObj = getXPathNode(pXmlDoc, "/w:document/w:body/w:sdt[4]/w:sdtPr/w:text"); + CPPUNIT_ASSERT_EQUAL(sal_Int32(0), + static_cast<sal_Int32>(xmlXPathNodeSetGetLength(pXmlObj->nodesetval))); + xmlXPathFreeObject(pXmlObj); +} + DECLARE_OOXMLEXPORT_TEST(testTdf144668, "tdf144668.odt") { uno::Reference<beans::XPropertySet> xPara1(getParagraph(1, u"level1"), uno::UNO_QUERY); |