diff options
-rw-r--r-- | sw/qa/extras/rtfimport/data/tdf108416.rtf | 18 | ||||
-rw-r--r-- | sw/qa/extras/rtfimport/rtfimport.cxx | 8 | ||||
-rw-r--r-- | writerfilter/source/dmapper/DomainMapper_Impl.cxx | 4 |
3 files changed, 29 insertions, 1 deletions
diff --git a/sw/qa/extras/rtfimport/data/tdf108416.rtf b/sw/qa/extras/rtfimport/data/tdf108416.rtf new file mode 100644 index 000000000000..5d38d0741068 --- /dev/null +++ b/sw/qa/extras/rtfimport/data/tdf108416.rtf @@ -0,0 +1,18 @@ +{\rtf1\adeflang1025 +{\*\listtable +{\list\listtemplateid492320832\listhybrid +{\listlevel\levelnfc0\levelnfcn0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\leveltemplateid510954734\'03(\'00);}{\levelnumbers\'02;}\rtlch\fcs1\af0} +{\listname ;}\listid1847935044} +} +{\*\listoverridetable +{\listoverride\listid1847935044\listoverridecount0\ls3} +} +\pard\plain asdf asdf asdf asdf asdf asdf asdf asdf\par +\pard \ls3 +{before field } +{\field +{\*\fldinst {\b MERGEFIELD "ZADDFIELDCON_BEGDADE" }} +{\fldrslt {\b 01.08.2017}} +} +{ after\par } +} diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx b/sw/qa/extras/rtfimport/rtfimport.cxx index f199cbedfe79..fe52bed1cf87 100644 --- a/sw/qa/extras/rtfimport/rtfimport.cxx +++ b/sw/qa/extras/rtfimport/rtfimport.cxx @@ -2430,6 +2430,14 @@ DECLARE_RTFIMPORT_TEST(testTdf86814, "tdf86814.rtf") CPPUNIT_ASSERT_EQUAL(awt::FontWeight::BOLD, getProperty<float>(getRun(getParagraph(1), 1), "CharWeight")); } +DECLARE_RTFIMPORT_TEST(testTdf108416, "tdf108416.rtf") +{ + uno::Reference<container::XNameAccess> xCharacterStyles(getStyles("CharacterStyles")); + uno::Reference<beans::XPropertySet> xListLabel(xCharacterStyles->getByName("ListLabel 1"), uno::UNO_QUERY); + // This was awt::FontWeight::BOLD, list numbering got an unexpected bold formatting. + CPPUNIT_ASSERT_EQUAL(awt::FontWeight::NORMAL, getProperty<float>(xListLabel, "CharWeight")); +} + DECLARE_RTFIMPORT_TEST(testTdf90315, "tdf90315.rtf") { uno::Reference<text::XTextSectionsSupplier> xTextSectionsSupplier(mxComponent, uno::UNO_QUERY); diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx index 9e2737322922..522511d0306f 100644 --- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx +++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx @@ -5268,11 +5268,13 @@ uno::Reference<beans::XPropertySet> DomainMapper_Impl::GetCurrentNumberingCharSt if (!xLevels.is()) { PropertyMapPtr pContext = m_pTopContext; - if (IsRTFImport()) + if (IsRTFImport() && !IsOpenField()) { // Looking up the paragraph context explicitly (and not just taking // the top context) is necessary for RTF, where formatting of a run // and of the paragraph mark is not separated. + // We know that the formatting inside a field won't affect the + // paragraph marker formatting, though. pContext = GetTopContextOfType(CONTEXT_PARAGRAPH); if (!pContext) return xRet; |