[Libreoffice-commits] core.git: Branch 'libreoffice-6-1' - sw/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Thu Sep 20 15:43:04 UTC 2018


 sw/source/core/doc/DocumentRedlineManager.cxx |    9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

New commits:
commit ad304d978b1a88d3ecadfef88d3a7a4c2475be5e
Author:     Michael Stahl <Michael.Stahl at cib.de>
AuthorDate: Mon Aug 6 14:07:26 2018 +0200
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Thu Sep 20 17:42:38 2018 +0200

    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 at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

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 )


More information about the Libreoffice-commits mailing list