[Libreoffice-commits] core.git: sw/qa sw/source
Miklos Vajna (via logerrit)
logerrit at kemper.freedesktop.org
Fri Mar 6 08:42:09 UTC 2020
sw/qa/extras/ooxmlexport/ooxmlexport14.cxx | 28 +++++++++++++++++++++++++++
sw/source/filter/ww8/docxattributeoutput.cxx | 3 ++
2 files changed, 31 insertions(+)
New commits:
commit ddbad5612e4322665bc70f4a026e5b052bcaf344
Author: Miklos Vajna <vmiklos at collabora.com>
AuthorDate: Fri Mar 6 09:05:07 2020 +0100
Commit: Miklos Vajna <vmiklos at collabora.com>
CommitDate: Fri Mar 6 09:41:34 2020 +0100
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 at collabora.com>
Tested-by: Jenkins
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;
More information about the Libreoffice-commits
mailing list