diff options
-rw-r--r-- | sw/qa/extras/rtfexport/data/tdf116841.rtf | 16 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/rtfexport2.cxx | 3 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/rtfexport3.cxx | 8 | ||||
-rw-r--r-- | writerfilter/source/dmapper/NumberingManager.cxx | 5 |
4 files changed, 31 insertions, 1 deletions
diff --git a/sw/qa/extras/rtfexport/data/tdf116841.rtf b/sw/qa/extras/rtfexport/data/tdf116841.rtf new file mode 100644 index 000000000000..75ff4878d7ab --- /dev/null +++ b/sw/qa/extras/rtfexport/data/tdf116841.rtf @@ -0,0 +1,16 @@ +{\rtf1\ansi\ansicpg1252\deff0\deflang1034 +{\fonttbl +{\f0\fnil\fcharset0\fprq0\fttruetype Times New Roman;} +{\f1\fnil\fcharset0\fprq0\fttruetype Arial;} +{\f2\fnil\fcharset0\fprq0\fttruetype Courier New;} +} +\kerning0\cf0\viewkind1\paperw11905\paperh16837\margl1440\margr1440\widowctl +\sectd\sbknone\colsx360\headery0\footery0 +\pard +{\*\pn\pnql\pnstart0\pnlvlblt +{\pntxtb\bullet} +} +\fi-431\li720 +{\f0\fs24\lang1033 +This is item one} +\par\pard} diff --git a/sw/qa/extras/rtfexport/rtfexport2.cxx b/sw/qa/extras/rtfexport/rtfexport2.cxx index 4e3299c6243d..64de79280e25 100644 --- a/sw/qa/extras/rtfexport/rtfexport2.cxx +++ b/sw/qa/extras/rtfexport/rtfexport2.cxx @@ -1068,10 +1068,11 @@ DECLARE_RTFEXPORT_TEST(testN825305, "n825305.rtf") DECLARE_RTFEXPORT_TEST(testTdf106953, "tdf106953.rtf") { + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(1270), + getProperty<sal_Int32>(getParagraph(1), "ParaLeftMargin")); auto xRules = getProperty<uno::Reference<container::XIndexAccess>>( getStyles("NumberingStyles")->getByName("WWNum1"), "NumberingRules"); comphelper::SequenceAsHashMap aRule(xRules->getByIndex(0)); - CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(1270), aRule["IndentAt"].get<sal_Int32>()); CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0), aRule["FirstLineIndent"].get<sal_Int32>()); } diff --git a/sw/qa/extras/rtfexport/rtfexport3.cxx b/sw/qa/extras/rtfexport/rtfexport3.cxx index be67a57dec2d..d07740cc2879 100644 --- a/sw/qa/extras/rtfexport/rtfexport3.cxx +++ b/sw/qa/extras/rtfexport/rtfexport3.cxx @@ -101,6 +101,14 @@ DECLARE_RTFEXPORT_TEST(testTdf115180, "tdf115180.docx") CPPUNIT_ASSERT_EQUAL_MESSAGE("First cell width", sal_Int32(218), cell2Width); } +DECLARE_RTFEXPORT_TEST(testTdf116841, "tdf116841.rtf") +{ + // This was 0, left margin was ignored as we assumed the default is already + // fine for us. + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(1270), + getProperty<sal_Int32>(getParagraph(1), "ParaLeftMargin")); +} + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/writerfilter/source/dmapper/NumberingManager.cxx b/writerfilter/source/dmapper/NumberingManager.cxx index 71e839ec32e7..02f49c62c67e 100644 --- a/writerfilter/source/dmapper/NumberingManager.cxx +++ b/writerfilter/source/dmapper/NumberingManager.cxx @@ -305,6 +305,11 @@ uno::Sequence<beans::PropertyValue> ListLevel::GetLevelProperties(bool bDefaults else if (rReadId == PROP_FIRST_LINE_INDENT && bDefaults) // Writer default is -360 twips, Word default seems to be 0. aNumberingProperties.emplace_back("FirstLineIndent", 0, uno::makeAny(static_cast<sal_Int32>(0)), beans::PropertyState_DIRECT_VALUE); + else if (rReadId == PROP_INDENT_AT && bDefaults) + // Writer default is 720 twips, Word default seems to be 0. + aNumberingProperties.emplace_back("IndentAt", 0, + uno::makeAny(static_cast<sal_Int32>(0)), + beans::PropertyState_DIRECT_VALUE); } boost::optional<PropertyMap::Property> aPropFont = getProperty(PROP_CHAR_FONT_NAME); |