summaryrefslogtreecommitdiff
path: root/sw/qa
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2020-03-06 10:44:19 +0100
committerMiklos Vajna <vmiklos@collabora.com>2020-03-06 11:30:04 +0100
commit9a1dd2e242794b4f26d207efc80a2f5bc088ab7c (patch)
tree06159de353657b97bb740224b3ee58999963421e /sw/qa
parentf0d0436e9f360575bda2c1e4f1ed4d3f6fa0b40f (diff)
sw chicago numbering: add DOC footnote export
Note that chicago numbering can't be used for paragraph numbering. It would be possible technically, but the spec && bffvalidator && Word agrees on forbidding that. Change-Id: Ic3de51f9724d399542f4fe6ac48e70e94c6ea4ba Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90080 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
Diffstat (limited to 'sw/qa')
-rw-r--r--sw/qa/extras/ww8export/ww8export3.cxx30
1 files changed, 30 insertions, 0 deletions
diff --git a/sw/qa/extras/ww8export/ww8export3.cxx b/sw/qa/extras/ww8export/ww8export3.cxx
index 5f9b8e2eefc6..c077dfcb040d 100644
--- a/sw/qa/extras/ww8export/ww8export3.cxx
+++ b/sw/qa/extras/ww8export/ww8export3.cxx
@@ -96,6 +96,36 @@ CPPUNIT_TEST_FIXTURE(SwModelTestBase, testArabicZeroNumberingFootnote)
CPPUNIT_ASSERT_EQUAL(nExpected, nActual);
}
+CPPUNIT_TEST_FIXTURE(SwModelTestBase, 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("MS Word 97", "");
+ xFootnotesSupplier.set(mxComponent, uno::UNO_QUERY);
+ sal_uInt16 nExpected = style::NumberingType::SYMBOL_CHICAGO;
+ auto nActual = getProperty<sal_uInt16>(xFootnotesSupplier->getFootnoteSettings(), "NumberingType");
+ // Without the accompanying fix in place, this test would have failed with:
+ // - Expected: 63
+ // - Actual : 4
+ // i.e. the numbering type was ARABIC, not SYMBOL_CHICAGO.
+ CPPUNIT_ASSERT_EQUAL(nExpected, nActual);
+}
+
DECLARE_WW8EXPORT_TEST(testTdf122429_header, "tdf122429_header.doc")
{
uno::Reference<container::XNameAccess> pageStyles = getStyles("PageStyles");