diff options
author | László Németh <nemeth@numbertext.org> | 2018-11-21 17:18:39 +0100 |
---|---|---|
committer | László Németh <nemeth@numbertext.org> | 2018-11-22 18:04:32 +0100 |
commit | d1ee27cf9b83ad9b69d1ee00e2e8969fb35446c9 (patch) | |
tree | cba5975bd66b16e706fe9236bf34a56ba6435d2a /sw | |
parent | 10a58ec15438d34a594437815882862c4576e2c0 (diff) |
tdf#121597 DOCX: don't export empty paragraphs at tracked deletion
of non-empty multiple paragraphs. Complete the fix for
"tdf#115521 DOCX export: keep empty paragraphs in tracked deletion"
in commit 2cdc870a7ee82d0faf35cdb5b2bf4e687cfd2b8d
Change-Id: Ic3446e2a2118e604a7a4d269c8fed1f9f157846f
Reviewed-on: https://gerrit.libreoffice.org/63731
Tested-by: Jenkins
Reviewed-by: László Németh <nemeth@numbertext.org>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/qa/extras/ooxmlexport/data/tdf121597.odt | bin | 0 -> 10592 bytes | |||
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlexport11.cxx | 15 | ||||
-rw-r--r-- | sw/source/filter/ww8/ww8atr.cxx | 31 |
3 files changed, 18 insertions, 28 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/tdf121597.odt b/sw/qa/extras/ooxmlexport/data/tdf121597.odt Binary files differnew file mode 100644 index 000000000000..760b46e76379 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf121597.odt diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx index 2728c75b51be..c7e6bac3a8ea 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx @@ -826,6 +826,21 @@ DECLARE_OOXMLEXPORT_TEST(testTdf58944RepeatingTableHeader, "tdf58944-repeating-t parseDump("/root/page[2]/body/tab/row[2]/cell[1]/txt/text()")); } +DECLARE_OOXMLEXPORT_TEST(testTdf121597TrackedDeletionOfMultipleParagraphs, "tdf121597.odt") +{ + xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + if (!pXmlDoc) + return; + + // check paragraphs with removed paragraph mark + assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:pPr/w:rPr/w:del"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:pPr/w:rPr/w:del"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[4]/w:pPr/w:rPr/w:del"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[5]/w:pPr/w:rPr/w:del"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[7]/w:pPr/w:rPr/w:del"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[10]/w:pPr/w:rPr/w:del"); +} + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx index d8411eed8796..b911ef83b6a7 100644 --- a/sw/source/filter/ww8/ww8atr.cxx +++ b/sw/source/filter/ww8/ww8atr.cxx @@ -5505,37 +5505,12 @@ const SwRedlineData* AttributeOutputBase::GetParagraphMarkerRedline( const SwTex if ( pRedl->GetRedlineData().GetType() != aRedlineType ) continue; - const SwPosition* pCheckedEnd = pRedl->End(); - const SwPosition* pCheckedStt = pRedl->Start(); - sal_uLong uStartNodeIndex = pCheckedStt->nNode.GetIndex(); - sal_uLong uStartCharIndex = pCheckedStt->nContent.GetIndex(); - sal_uLong uEndNodeIndex = pCheckedEnd->nNode.GetIndex(); - sal_uLong uEndCharIndex = pCheckedEnd->nContent.GetIndex(); + sal_uLong uStartNodeIndex = pRedl->Start()->nNode.GetIndex(); + sal_uLong uEndNodeIndex = pRedl->End()->nNode.GetIndex(); sal_uLong uNodeIndex = rNode.GetIndex(); if( uStartNodeIndex <= uNodeIndex && uNodeIndex < uEndNodeIndex ) - { - // Maybe add here a check that also the start & end of the redline is the entire paragraph - if ( ( uStartNodeIndex < uEndNodeIndex ) && - // check start: - // 1. start in the same node - (( uStartNodeIndex == uNodeIndex && - uStartCharIndex == static_cast<sal_uLong>(rNode.Len()) ) || - // 2. or in a previous node - uStartNodeIndex < uNodeIndex - ) && - // check end: - // 1. end in the same node - (( uEndNodeIndex == (uNodeIndex + 1) && - uEndCharIndex == 0) || - // 2. or end in after that - uEndNodeIndex > (uNodeIndex + 1) - ) - ) - { - return &( pRedl->GetRedlineData() ); - } - } + return &( pRedl->GetRedlineData() ); } return nullptr; } |