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>
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 0000000..19dcaa3
--- /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 6c1a4d5..f12ab74 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 90bc970..7a3e4d45 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;