From ad304d978b1a88d3ecadfef88d3a7a4c2475be5e Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Mon, 6 Aug 2018 14:07:26 +0200 Subject: sw: fix return value of DocumentRedlineManager::AppendRedline() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If a footnote is inserted, a redline that includes the start/end node of the footnote is created, but that is not a valid redline (as far as HasValidRange() is concerned), so instead a different redline without start/end nodes is inserted, but pNewRedl is reset and so AppendRedline() returns IGNORED, and then we get an assert in Undo from SwRedlineSaveData::RedlineToDoc(). Change-Id: I92253e1a40ba98e34e0bca601b4e3b6ef3751b08 (cherry picked from commit deacee23d9530350988eef68b0e9bb5cfcf2fde3) Reviewed-on: https://gerrit.libreoffice.org/60750 Tested-by: Jenkins Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara --- sw/source/core/doc/DocumentRedlineManager.cxx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'sw/source') diff --git a/sw/source/core/doc/DocumentRedlineManager.cxx b/sw/source/core/doc/DocumentRedlineManager.cxx index 4f12cd39d827..ca6fd3ac539e 100644 --- a/sw/source/core/doc/DocumentRedlineManager.cxx +++ b/sw/source/core/doc/DocumentRedlineManager.cxx @@ -1680,7 +1680,14 @@ DocumentRedlineManager::AppendRedline(SwRangeRedline* pNewRedl, bool const bCall pNewRedl = nullptr; } else - mpRedlineTable->Insert( pNewRedl ); + { + bool const ret = mpRedlineTable->Insert( pNewRedl ); + assert(ret || !pNewRedl); + if (ret && !pNewRedl) + { + bMerged = true; // treat InsertWithValidRanges as "merge" + } + } } if( bCompress ) -- cgit v1.2.3