Kaydet (Commit) 39969def authored tarafından Miklos Vajna's avatar Miklos Vajna

tdf#85523 DOCX import: fix unexpected extra char at comment end

Change-Id: Ic3eb073d11a395a81b90fd1a9292d6ecf2940c09
üst c2b302bb
......@@ -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.
......
......@@ -1135,9 +1135,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())
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment