summaryrefslogtreecommitdiff
path: root/sw/qa
diff options
context:
space:
mode:
authorJustin Luth <justin.luth@collabora.com>2020-04-11 12:05:03 +0300
committerMiklos Vajna <vmiklos@collabora.com>2020-04-14 09:46:52 +0200
commit35fc5ef0a759884b24ed8b83cd05702a0fab64cc (patch)
tree97a633beffc9a276720cc69d9d3ab364971efbf4 /sw/qa
parent952cc68929f863784c6b01c9dc071494892877d1 (diff)
tdf#131321 writerfilter: ApplyNumberingStyleNameToParaStyles()
Prior to this commit, numbering on paragraph styles was lost on import. This didn't affect layout at all, but it did affect user editing. DOCX: export already was fine, just import was missing. RTF: export is explicitly ignored for non-paragraphs, (ParaNumRule_Impl), so I am ignoring RTF, since this fix is meaningless unless both import and export are working. This is a bit tricky because styles.xml is loaded before numbering.xml, so the names are not known until after numbering.xml has finished. So this helper function runs at the end of the numbering.xml import process. Several existing unit tests nicely confirmed a few things. -tdf95377.docx: numId 0 overrides an inherited numbering -chtoutline.docx proves that outlineLevel styles are exempt. -fdo61343.docx actually has nothing in numbering.xml, so it is possible to have a numbering with no name. Of course, it is a really messed up document, too... Change-Id: I270a581f08704c2595d861ce5c5b546f9d6ba6b6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92058 Tested-by: Jenkins Reviewed-by: Justin Luth <justin_luth@sil.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Diffstat (limited to 'sw/qa')
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport10.cxx4
1 files changed, 4 insertions, 0 deletions
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport10.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport10.cxx
index 09a232ae5773..3e0d3752187f 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport10.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport10.cxx
@@ -1022,6 +1022,10 @@ DECLARE_OOXMLEXPORT_TEST(testTdf95376, "tdf95376.docx")
// did not have priority over indentation-from-paragraph-style, due to a
// filter workaround that's not correct here.
CPPUNIT_ASSERT_EQUAL(beans::PropertyState_DEFAULT_VALUE, xParagraph->getPropertyState("ParaFirstLineIndent"));
+
+ //tdf#131321 - paragraph styles lost their numbering. Bullet+space inherits WWNum1 from Bullet
+ uno::Reference<beans::XPropertySet> xStyle(getStyles("ParagraphStyles")->getByName("Bullet+space"), uno::UNO_QUERY);
+ CPPUNIT_ASSERT(!(getProperty<OUString>(xStyle, "NumberingStyleName")).isEmpty());
}
DECLARE_OOXMLEXPORT_TEST(testTdf92124, "tdf92124.docx")