summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2015-09-23 07:49:49 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2015-09-23 07:50:10 +0200
commit3e27df1035677c7cca5200858d5d8e8283bf7aa9 (patch)
treecd68de68b0440a97bb17e98cf2a64cd56a51033b /sw
parentd77b49f070a562d2ac0df3174cf32d88680ba7a0 (diff)
tdf#92124 DOCX import: don't add a dummy Suffix for an empty LabelFollowedBy
Change-Id: I0c4366ad0a2f81a198860869f670767343a392be
Diffstat (limited to 'sw')
-rw-r--r--sw/qa/extras/ooxmlimport/data/tdf92124.docxbin0 -> 7042 bytes
-rw-r--r--sw/qa/extras/ooxmlimport/ooxmlimport.cxx12
2 files changed, 12 insertions, 0 deletions
diff --git a/sw/qa/extras/ooxmlimport/data/tdf92124.docx b/sw/qa/extras/ooxmlimport/data/tdf92124.docx
new file mode 100644
index 000000000000..2999311930eb
--- /dev/null
+++ b/sw/qa/extras/ooxmlimport/data/tdf92124.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
index 2345c5ccc7c0..4f41751722df 100644
--- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
+++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
@@ -2828,6 +2828,18 @@ DECLARE_OOXMLIMPORT_TEST(testTdf92454, "tdf92454.docx")
CPPUNIT_ASSERT_EQUAL(beans::PropertyState_DIRECT_VALUE, xParagraph->getPropertyState("ParaFirstLineIndent"));
}
+DECLARE_OOXMLIMPORT_TEST(testTdf92124, "tdf92124.docx")
+{
+ // Get the second paragraph's numbering style's 1st level's suffix.
+ uno::Reference<text::XTextRange> xParagraph = getParagraph(2);
+ auto xLevels = getProperty< uno::Reference<container::XIndexAccess> >(xParagraph, "NumberingRules");
+ uno::Sequence<beans::PropertyValue> aLevel;
+ xLevels->getByIndex(0) >>= aLevel; // 1st level
+ OUString aSuffix = std::find_if(aLevel.begin(), aLevel.end(), [](const beans::PropertyValue& rValue) { return rValue.Name == "Suffix"; })->Value.get<OUString>();
+ // Make sure it's empty as the source document contains <w:suff w:val="nothing"/>.
+ CPPUNIT_ASSERT(aSuffix.isEmpty());
+}
+
CPPUNIT_PLUGIN_IMPLEMENT();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */