sw/source/core/doc/DocumentRedlineManager.cxx | 40 +++++++++++++++----------- 1 file changed, 24 insertions(+), 16 deletions(-)
New commits: commit 307a6b4287c0096e1a10d2fdb73b073e9eef7a11 Author: Michael Stahl <michael.st...@cib.de> AuthorDate: Tue Jan 8 13:22:31 2019 +0100 Commit: Caolán McNamara <caol...@redhat.com> CommitDate: Wed Jan 9 12:38:07 2019 +0100 sw_redlinehide: try harder to prevent SetRedlineFlags from messing things up Rearrange the code added in 15f1555da8adfa81ea1d4b0d8b694164fddbb2ae to set all layouts to non-hidden before moving redlines in the model. tdf52550-1.doc contains lots of consecutive delete redlines that when exported to ODF trigger asserts about wrong start nodes in CheckParaRedlineMerge(). Change-Id: I89c3d4fefd26691a9632807b9899138eee895fff Reviewed-on: https://gerrit.libreoffice.org/65965 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.st...@cib.de> (cherry picked from commit b15f1ed2a1df45a57b587ac90efa90c1c18866fc) Reviewed-on: https://gerrit.libreoffice.org/65972 Reviewed-by: Caolán McNamara <caol...@redhat.com> Tested-by: Caolán McNamara <caol...@redhat.com> diff --git a/sw/source/core/doc/DocumentRedlineManager.cxx b/sw/source/core/doc/DocumentRedlineManager.cxx index 7d79a3f1a233..7704057b0c77 100644 --- a/sw/source/core/doc/DocumentRedlineManager.cxx +++ b/sw/source/core/doc/DocumentRedlineManager.cxx @@ -838,6 +838,25 @@ void DocumentRedlineManager::SetRedlineFlags( RedlineFlags eMode ) CheckAnchoredFlyConsistency(m_rDoc); CHECK_REDLINE( *this ) + std::set<SwRootFrame *> hiddenLayouts; + if (eShowMode == (RedlineFlags::ShowInsert | RedlineFlags::ShowDelete)) + { + // sw_redlinehide: the problem here is that MoveFromSection + // creates the frames wrongly (non-merged), because its own + // SwRangeRedline has wrong positions until after the nodes + // are all moved, so fix things up by force by re-creating + // all merged frames from scratch. + std::set<SwRootFrame *> const layouts(m_rDoc.GetAllLayouts()); + for (SwRootFrame *const pLayout : layouts) + { + if (pLayout->IsHideRedlines()) + { + pLayout->SetHideRedlines(false); + hiddenLayouts.insert(pLayout); + } + } + } + for (sal_uInt16 nLoop = 1; nLoop <= 2; ++nLoop) for (size_t i = 0; i < mpRedlineTable->size(); ++i) { @@ -856,24 +875,13 @@ void DocumentRedlineManager::SetRedlineFlags( RedlineFlags eMode ) CheckAnchoredFlyConsistency(m_rDoc); CHECK_REDLINE( *this ) - m_rDoc.SetInXMLImport( bSaveInXMLImportFlag ); - if (eShowMode == (RedlineFlags::ShowInsert | RedlineFlags::ShowDelete)) + + for (SwRootFrame *const pLayout : hiddenLayouts) { - // sw_redlinehide: the problem here is that MoveFromSection - // creates the frames wrongly (non-merged), because its own - // SwRangeRedline has wrong positions until after the nodes - // are all moved, so fix things up by force by re-creating - // all merged frames from scratch. - std::set<SwRootFrame *> const layouts(m_rDoc.GetAllLayouts()); - for (SwRootFrame *const pLayout : layouts) - { - if (pLayout->IsHideRedlines()) - { - pLayout->SetHideRedlines(false); - pLayout->SetHideRedlines(true); - } - } + pLayout->SetHideRedlines(true); } + + m_rDoc.SetInXMLImport( bSaveInXMLImportFlag ); } meRedlineFlags = eMode; m_rDoc.getIDocumentState().SetModified(); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits