diff options
author | Michael Stahl <Michael.Stahl@cib.de> | 2019-01-08 13:22:31 +0100 |
---|---|---|
committer | Michael Stahl <Michael.Stahl@cib.de> | 2019-01-08 15:16:44 +0100 |
commit | b15f1ed2a1df45a57b587ac90efa90c1c18866fc (patch) | |
tree | f73ecb059531cf7c57705beb72069089f1fdc776 /sw | |
parent | 65a6c9ae4791188ffcecf489073cf38873ce5e17 (diff) |
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.Stahl@cib.de>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/core/doc/DocumentRedlineManager.cxx | 40 |
1 files changed, 24 insertions, 16 deletions
diff --git a/sw/source/core/doc/DocumentRedlineManager.cxx b/sw/source/core/doc/DocumentRedlineManager.cxx index 326b151da2a7..5eddd00f0ebf 100644 --- a/sw/source/core/doc/DocumentRedlineManager.cxx +++ b/sw/source/core/doc/DocumentRedlineManager.cxx @@ -839,6 +839,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) { @@ -857,24 +876,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(); |