diff options
-rw-r--r-- | sw/qa/extras/ooxmlimport/data/tdf85523.docx | bin | 0 -> 21015 bytes | |||
-rw-r--r-- | sw/qa/extras/ooxmlimport/ooxmlimport.cxx | 8 | ||||
-rw-r--r-- | writerfilter/source/dmapper/DomainMapper_Impl.cxx | 3 |
3 files changed, 10 insertions, 1 deletions
diff --git a/sw/qa/extras/ooxmlimport/data/tdf85523.docx b/sw/qa/extras/ooxmlimport/data/tdf85523.docx Binary files differnew file mode 100644 index 000000000000..cd31ae43e442 --- /dev/null +++ b/sw/qa/extras/ooxmlimport/data/tdf85523.docx diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx index 0a4e5930ec21..2151d55636cd 100644 --- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx +++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx @@ -2116,6 +2116,14 @@ DECLARE_OOXMLIMPORT_TEST(testAnnotationFormatting, "annotation-formatting.docx") CPPUNIT_ASSERT_EQUAL(awt::FontUnderline::SINGLE, getProperty<sal_Int16>(getRun(xParagraph, 1), "CharUnderline")); } +DECLARE_OOXMLIMPORT_TEST(testTdf85523, "tdf85523.docx") +{ + auto xTextField = getProperty< uno::Reference<beans::XPropertySet> >(getRun(getParagraph(1), 6), "TextField"); + auto xText = getProperty< uno::Reference<text::XText> >(xTextField, "TextRange"); + // This was "commentX": an unexpected extra char was added at the comment end. + getParagraphOfText(1, xText, "comment"); +} + DECLARE_OOXMLIMPORT_TEST(testDMLGroupShapeRunFonts, "dml-groupshape-runfonts.docx") { // Fonts defined by w:rFonts was not imported and so the font specified by a:fontRef was used. diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx index bf3fa2cdc69a..2b8adbecc23a 100644 --- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx +++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx @@ -1134,9 +1134,10 @@ void DomainMapper_Impl::finishParagraph( PropertyMapPtr pPropertyMap ) else { uno::Reference<text::XTextCursor> xCursor; - if (m_bParaHadField) + if (m_bParaHadField && !m_bIsInComments) { // Workaround to make sure char props of the field are not lost. + // Not relevant for editeng-based comments. OUString sMarker("X"); xCursor = xTextAppend->getText()->createTextCursor(); if (xCursor.is()) |