Kaydet (Commit) bdade7e3 authored tarafından László Németh's avatar László Németh

tdf#105444 DOCX import: don't put extra paragraphs in comments

on Win32, waiting only for \r\n instead of \n in RemoveLastParagraph().

Change-Id: I8921a6a72e8397ed04edb9f339ba3f0bf5bbb98b
Reviewed-on: https://gerrit.libreoffice.org/60865
Tested-by: Jenkins
Reviewed-by: 's avatarLászló Németh <nemeth@numbertext.org>
üst b56ad4cb
......@@ -797,6 +797,15 @@ DECLARE_OOXMLEXPORT_TEST(testTdf119143, "tdf119143.docx")
sParaText);
}
DECLARE_OOXMLEXPORT_TEST(testTdf105444, "tdf105444.docx")
{
xmlDocPtr pXmlComm = parseExport("word/comments.xml");
if (!pXmlComm)
return;
// there is no extra paragraph on Win32, only a single one.
assertXPath(pXmlComm, "/w:comments/w:comment/w:p", 1);
}
CPPUNIT_PLUGIN_IMPLEMENT();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -5405,15 +5405,7 @@ void SwUiWriterTest::testCreateDocxAnnotation()
uno::Reference<beans::XPropertySet> xField(xFields->nextElement(), uno::UNO_QUERY);
// this was empty instead of "some text"
OUString aResultText = aSomeText
#ifdef WNT
// FIXME From some unclear reason, on windows we get an additional
// paragraph in the comment - please adapt this test when that gets
// fixed.
+ "\n"
#endif
;
CPPUNIT_ASSERT_EQUAL(aResultText, xField->getPropertyValue("Content").get<OUString>());
CPPUNIT_ASSERT_EQUAL(aSomeText, xField->getPropertyValue("Content").get<OUString>());
}
void SwUiWriterTest::testTdf107976()
......
......@@ -436,7 +436,9 @@ void DomainMapper_Impl::RemoveLastParagraph( )
xCursor->goLeft( 1, true );
// If this is a text on a shape, possibly the text has the trailing
// newline removed already.
if (xCursor->getString() == SAL_NEWLINE_STRING)
if (xCursor->getString() == SAL_NEWLINE_STRING ||
// tdf#105444 comments need an exception, if SAL_NEWLINE_STRING defined as "\r\n"
(sizeof(SAL_NEWLINE_STRING)-1 == 2 && xCursor->getString() == "\n"))
{
uno::Reference<beans::XPropertySet> xDocProps(GetTextDocument(), uno::UNO_QUERY);
const OUString aRecordChanges("RecordChanges");
......
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