summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVasily Melenchuk <vasily.melenchuk@cib.de>2022-12-27 15:31:37 +0300
committerMiklos Vajna <vmiklos@collabora.com>2023-01-06 14:47:23 +0000
commite8d18b471ea5063bc0b2c94afc1b94017e8e66bc (patch)
treea674ec1cb231f5ae11f19937f99c9f49786caf5a
parent5a2ee5ba893b6b8f4e7fd6623b7f10faf0bda509 (diff)
tdf#152784: RTF import: more default paragraph params
If numbering is not explicitly mentioned in para properties it should not be used from referred paragraph style. So default value of 0 (no numbering) is used by default. Change-Id: If8e8f2aaf19190f64a557444188f67b24a699b54 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144839 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
-rw-r--r--sw/qa/extras/rtfexport/data/tdf152784_1.rtf20
-rw-r--r--sw/qa/extras/rtfexport/rtfexport3.cxx9
-rw-r--r--writerfilter/source/rtftok/rtfsprm.cxx4
3 files changed, 31 insertions, 2 deletions
diff --git a/sw/qa/extras/rtfexport/data/tdf152784_1.rtf b/sw/qa/extras/rtfexport/data/tdf152784_1.rtf
new file mode 100644
index 000000000000..19dcaa36e4df
--- /dev/null
+++ b/sw/qa/extras/rtfexport/data/tdf152784_1.rtf
@@ -0,0 +1,20 @@
+{\rtf1
+
+{\stylesheet
+{\s3 \ls1\outlinelevel2 heading 3;}}
+{\*\listtable
+{\list\listtemplateid-374154644
+{\listlevel{\leveltext\'02\'00.;}{\levelnumbers\'01;}}
+{\listlevel{\leveltext\'02\'01.;}{\levelnumbers\'01;}}
+{\listlevel{\leveltext\'02\'02.;}{\levelnumbers\'01;}}
+{\listname ;}\listid773479173}
+}
+{\*\listoverridetable
+{\listoverride\listid773479173\listoverridecount0\ls1}
+}
+
+\pard\s3 Here should be no numbering!
+\par
+
+}
+
diff --git a/sw/qa/extras/rtfexport/rtfexport3.cxx b/sw/qa/extras/rtfexport/rtfexport3.cxx
index 6c1a4d524b7f..f12ab74bef59 100644
--- a/sw/qa/extras/rtfexport/rtfexport3.cxx
+++ b/sw/qa/extras/rtfexport/rtfexport3.cxx
@@ -523,6 +523,15 @@ DECLARE_RTFEXPORT_TEST(testInvalidParagraphStyle, "invalidParagraphStyle.rtf")
CPPUNIT_ASSERT_EQUAL(style::NumberingType::ARABIC, numFormat);
}
+DECLARE_RTFEXPORT_TEST(testTdf152784_1, "tdf152784_1.rtf")
+{
+ // Ensure that paragraph having style with numbering does not have numbering
+ // since it is not explitly defined in paragraph properties
+ uno::Reference<beans::XPropertySet> xPara(getParagraph(1, "Here should be no numbering!"),
+ uno::UNO_QUERY);
+ CPPUNIT_ASSERT(getProperty<OUString>(xPara, "NumberingStyleName").isEmpty());
+}
+
CPPUNIT_PLUGIN_IMPLEMENT();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/writerfilter/source/rtftok/rtfsprm.cxx b/writerfilter/source/rtftok/rtfsprm.cxx
index 90bc97001d27..7a3e4d454687 100644
--- a/writerfilter/source/rtftok/rtfsprm.cxx
+++ b/writerfilter/source/rtftok/rtfsprm.cxx
@@ -192,13 +192,13 @@ static RTFValue::Pointer_t getDefaultSPRM(Id const id, Id nStyleType)
case NS_ooxml::LN_CT_Ind_right:
case NS_ooxml::LN_CT_Ind_firstLine:
return new RTFValue(0);
-
case NS_ooxml::LN_CT_Spacing_lineRule:
return new RTFValue(NS_ooxml::LN_Value_doc_ST_LineSpacingRule_auto);
case NS_ooxml::LN_CT_Spacing_line:
// presumably this means 100%, cf. static const int nSingleLineSpacing = 240;
return new RTFValue(240);
-
+ case NS_ooxml::LN_CT_NumPr_numId:
+ return new RTFValue(0);
case NS_ooxml::LN_CT_PrBase_pBdr:
{ // tdf#150382 default all paragraph borders to none
RTFSprms attributes;