diff options
author | Miklos Vajna <vmiklos@collabora.com> | 2020-03-06 09:05:07 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2020-03-06 09:41:34 +0100 |
commit | ddbad5612e4322665bc70f4a026e5b052bcaf344 (patch) | |
tree | 9cf8e01e9083dfbcd4dd1349f0ee8875dbf8195e /sw | |
parent | 4f2cf88979e8c5dc97f5fde233ea4d6d128c1787 (diff) |
sw chicago numbering: add DOCX footnote export
Only this was missing, paragraph numbering import/export and footnote
numbering import was already working.
Change-Id: Ia5966cc7f1308ba81bebc1bf628d8efb17acb713
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90075
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
Diffstat (limited to 'sw')
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlexport14.cxx | 28 | ||||
-rw-r--r-- | sw/source/filter/ww8/docxattributeoutput.cxx | 3 |
2 files changed, 31 insertions, 0 deletions
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx index 16aa8fdc4bab..9d2ab9444f00 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx @@ -178,6 +178,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"); +} + DECLARE_OOXMLEXPORT_TEST(testTdf87569d, "tdf87569_drawingml.docx") { //if the original tdf87569 sample is upgraded it will have drawingml shapes... diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx index 6f512b85352c..3686dba83df7 100644 --- a/sw/source/filter/ww8/docxattributeoutput.cxx +++ b/sw/source/filter/ww8/docxattributeoutput.cxx @@ -7734,6 +7734,9 @@ void DocxAttributeOutput::WriteFootnoteEndnotePr( ::sax_fastparser::FSHelperPtr case SVX_NUM_CHAR_SPECIAL: fmt = "bullet"; break; + case SVX_NUM_SYMBOL_CHICAGO: + fmt = "chicago"; + break; case SVX_NUM_ARABIC_ZERO: fmt = "decimalZero"; break; |