diff options
author | Michael Stahl <Michael.Stahl@cib.de> | 2018-08-06 14:07:26 +0200 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2018-09-20 17:42:38 +0200 |
commit | ad304d978b1a88d3ecadfef88d3a7a4c2475be5e (patch) | |
tree | 899e4735e75f786d11fd64152c82c0e88227c2e3 | |
parent | 9308edcf916a0dbcdc36165514ed77d3836e64f1 (diff) |
sw: fix return value of DocumentRedlineManager::AppendRedline()
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 <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r-- | sw/source/core/doc/DocumentRedlineManager.cxx | 9 |
1 files changed, 8 insertions, 1 deletions
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 ) |