diff options
author | László Németh <nemeth@numbertext.org> | 2018-08-28 18:23:17 +0200 |
---|---|---|
committer | László Németh <nemeth@numbertext.org> | 2018-09-05 07:41:09 +0200 |
commit | 22639148ae5400bac98f32a75d7431b857c80195 (patch) | |
tree | e295842bf21dc149412a57fdb98e366a017d66f1 /sw/source | |
parent | 8bf82d47d6bd749fc0a7c5fac211be44406e9615 (diff) |
tdf#54819 change tracking: keep paragraph style after full deletion
of the previous paragraph(s), as in editing without change tracking.
This is a workaround for the regression introduced by #i100466#.
NOTE: We change the style of the first removed paragraph to restore
normal editing function during change tracking, too. Manual fix
of the spoiled paragraph does the same style changes in the
previously deleted paragraphs, so this commit doesn't introduce
any new oddity.
Change-Id: I9565e600ec86adc95246ff899d58de79f3c3a996
Reviewed-on: https://gerrit.libreoffice.org/59820
Tested-by: Jenkins
Reviewed-by: László Németh <nemeth@numbertext.org>
Diffstat (limited to 'sw/source')
-rw-r--r-- | sw/source/core/doc/DocumentRedlineManager.cxx | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/sw/source/core/doc/DocumentRedlineManager.cxx b/sw/source/core/doc/DocumentRedlineManager.cxx index a47b75629940..6838e7fc8dcd 100644 --- a/sw/source/core/doc/DocumentRedlineManager.cxx +++ b/sw/source/core/doc/DocumentRedlineManager.cxx @@ -1680,7 +1680,20 @@ DocumentRedlineManager::AppendRedline(SwRangeRedline* pNewRedl, bool const bCall pNewRedl = nullptr; } else + { + if (pStt->nContent == 0) + { + // 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 ); + } mpRedlineTable->Insert( pNewRedl ); + } } if( bCompress ) |