diff options
author | Miklos Vajna <vmiklos@collabora.com> | 2020-03-06 09:05:07 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2020-04-03 09:19:52 +0200 |
commit | 18cd1c2683c546caa81212ea2850fb514daf0796 (patch) | |
tree | 2548465eace0933e4dfc0c62680182d3beb4f570 /sw/qa | |
parent | 6c9968885c10e5d1a6ef193ac45d349e598d6e49 (diff) |
sw chicago numbering: add DOCX footnote export
Only this was missing, paragraph numbering import/export and footnote
numbering import was already working.
(cherry picked from commit ddbad5612e4322665bc70f4a026e5b052bcaf344)
Conflicts:
sw/qa/extras/ooxmlexport/ooxmlexport14.cxx
Change-Id: Ia5966cc7f1308ba81bebc1bf628d8efb17acb713
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91588
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Diffstat (limited to 'sw/qa')
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlexport13.cxx | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx index a1f1c330d533..f40d0cf0a111 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx @@ -585,6 +585,34 @@ CPPUNIT_TEST_FIXTURE(Test, testArabicZeroNumberingFootnote) assertXPath(pXmlDoc, "/w:document/w:body/w:sectPr/w:footnotePr/w:numFmt", "val", "decimalZero"); } +CPPUNIT_TEST_FIXTURE(Test, testChicagoNumberingFootnote) +{ + // Create a document, set footnote numbering type to SYMBOL_CHICAGO. + loadURL("private:factory/swriter", nullptr); + uno::Reference<text::XFootnotesSupplier> xFootnotesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<beans::XPropertySet> xFootnoteSettings + = xFootnotesSupplier->getFootnoteSettings(); + sal_uInt16 nNumberingType = style::NumberingType::SYMBOL_CHICAGO; + xFootnoteSettings->setPropertyValue("NumberingType", uno::makeAny(nNumberingType)); + + // Insert a footnote. + uno::Reference<lang::XMultiServiceFactory> xFactory(mxComponent, uno::UNO_QUERY); + uno::Reference<text::XTextContent> xFootnote( + xFactory->createInstance("com.sun.star.text.Footnote"), uno::UNO_QUERY); + uno::Reference<text::XTextDocument> xTextDocument(mxComponent, uno::UNO_QUERY); + uno::Reference<text::XTextContentAppend> xTextContentAppend(xTextDocument->getText(), + uno::UNO_QUERY); + xTextContentAppend->appendTextContent(xFootnote, {}); + + reload("Office Open XML Text", ""); + + xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + // Without the accompanying fix in place, this test would have failed with: + // XPath '/w:document/w:body/w:sectPr/w:footnotePr/w:numFmt' number of nodes is incorrect + // because the exporter had no idea what markup to use for SYMBOL_CHICAGO. + assertXPath(pXmlDoc, "/w:document/w:body/w:sectPr/w:footnotePr/w:numFmt", "val", "chicago"); +} + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |