sw/qa/extras/ooxmlexport/data/tdf123054.docx |binary sw/qa/extras/ooxmlexport/ooxmlexport11.cxx | 6 ++ sw/source/core/doc/DocumentRedlineManager.cxx | 61 +++++++++++++------------- 3 files changed, 38 insertions(+), 29 deletions(-)
New commits: commit b3265d6e11200a55a068902e2d78c2de374e973b Author: László Németh <nem...@numbertext.org> AuthorDate: Fri Mar 8 22:35:46 2019 +0100 Commit: László Németh <nem...@numbertext.org> CommitDate: Mon Mar 11 10:01:52 2019 +0100 tdf#123054 track changes: fix paragraph style regression caused by the commit 173069a1f6ac060a06f04908a94a1a8420461795 "fix paragraph join with change tracking" and commit 1bbbe57dfc0b43d6b5444798d77dcdf5e4e76e49 "change tracking: show layout changes at paragraph join". Change-Id: I05203255b04094ae118fd4967398045d6e0ad9fa Reviewed-on: https://gerrit.libreoffice.org/68947 Tested-by: Jenkins Reviewed-by: László Németh <nem...@numbertext.org> diff --git a/sw/qa/extras/ooxmlexport/data/tdf123054.docx b/sw/qa/extras/ooxmlexport/data/tdf123054.docx new file mode 100644 index 000000000000..d857479d5add Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf123054.docx differ diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx index a8306385e12c..08e0480e1322 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx @@ -967,6 +967,12 @@ DECLARE_OOXMLIMPORT_TEST(testTdf121176, "tdf121176.docx") CPPUNIT_ASSERT_EQUAL( OUString( "must" ), getRun( getParagraph( 1 ), 2 )->getString()); } +DECLARE_OOXMLIMPORT_TEST(testTdf123054, "tdf123054.docx") +{ + CPPUNIT_ASSERT_EQUAL(OUString("No Spacing"), + getProperty<OUString>(getParagraph(20), "ParaStyleName")); +} + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/core/doc/DocumentRedlineManager.cxx b/sw/source/core/doc/DocumentRedlineManager.cxx index e55b04bd5279..de113562139a 100644 --- a/sw/source/core/doc/DocumentRedlineManager.cxx +++ b/sw/source/core/doc/DocumentRedlineManager.cxx @@ -1916,37 +1916,40 @@ DocumentRedlineManager::AppendRedline(SwRangeRedline* pNewRedl, bool const bCall } else { - if (pStt->nContent == 0) + if ( bCallDelete && nsRedlineType_t::REDLINE_DELETE == pNewRedl->GetType() ) { - // tdf#54819 to keep the style of the paragraph - // after the fully deleted paragraphs (normal behaviour - // of editing without change tracking), we copy its style - // to the first removed paragraph. - SwTextNode* pDelNode = pStt->nNode.GetNode().GetTextNode(); - SwTextNode* pTextNode = pEnd->nNode.GetNode().GetTextNode(); - if (pDelNode != nullptr && pTextNode != nullptr && pDelNode != pTextNode) - pTextNode->CopyCollFormat( *pDelNode ); - } - else if ( bCallDelete && nsRedlineType_t::REDLINE_DELETE == pNewRedl->GetType() ) - { - // tdf#119571 update the style of the joined paragraph - // after a partially deleted paragraph to show its correct style - // in "Show changes" mode, too. All removed paragraphs - // get the style of the first (partially deleted) paragraph - // to avoid text insertion with bad style in the deleted - // area later. - SwContentNode* pDelNd = pStt->nNode.GetNode().GetContentNode(); - SwContentNode* pTextNd = pEnd->nNode.GetNode().GetContentNode(); - SwTextNode* pDelNode = pStt->nNode.GetNode().GetTextNode(); - SwTextNode* pTextNode; - SwNodeIndex aIdx( pEnd->nNode.GetNode() ); - - while (pDelNode != nullptr && pTextNd != nullptr && pDelNd->GetIndex() < pTextNd->GetIndex()) + if ( pStt->nContent == 0 ) { - pTextNode = pTextNd->GetTextNode(); - if (pTextNode && pDelNode != pTextNode ) - pDelNode->CopyCollFormat( *pTextNode ); - pTextNd = SwNodes::GoPrevious( &aIdx ); + // tdf#54819 to keep the style of the paragraph + // after the fully deleted paragraphs (normal behaviour + // of editing without change tracking), we copy its style + // to the first removed paragraph. + SwTextNode* pDelNode = pStt->nNode.GetNode().GetTextNode(); + SwTextNode* pTextNode = pEnd->nNode.GetNode().GetTextNode(); + if (pDelNode != nullptr && pTextNode != nullptr && pDelNode != pTextNode) + pTextNode->CopyCollFormat( *pDelNode ); + } + else + { + // tdf#119571 update the style of the joined paragraph + // after a partially deleted paragraph to show its correct style + // in "Show changes" mode, too. All removed paragraphs + // get the style of the first (partially deleted) paragraph + // to avoid text insertion with bad style in the deleted + // area later. + SwContentNode* pDelNd = pStt->nNode.GetNode().GetContentNode(); + SwContentNode* pTextNd = pEnd->nNode.GetNode().GetContentNode(); + SwTextNode* pDelNode = pStt->nNode.GetNode().GetTextNode(); + SwTextNode* pTextNode; + SwNodeIndex aIdx( pEnd->nNode.GetNode() ); + + while (pDelNode != nullptr && pTextNd != nullptr && pDelNd->GetIndex() < pTextNd->GetIndex()) + { + pTextNode = pTextNd->GetTextNode(); + if (pTextNode && pDelNode != pTextNode ) + pDelNode->CopyCollFormat( *pTextNode ); + pTextNd = SwNodes::GoPrevious( &aIdx ); + } } } bool const ret = mpRedlineTable->Insert( pNewRedl ); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits