sw/source/core/doc/DocumentRedlineManager.cxx |   34 ++++++++++++++------------
 1 file changed, 19 insertions(+), 15 deletions(-)

New commits:
commit 12080e7a219777b650d396ea4f5e8a489c8b4b8d
Author:     László Németh <nem...@numbertext.org>
AuthorDate: Mon Apr 20 12:46:58 2020 +0200
Commit:     Michael Stahl <michael.st...@cib.de>
CommitDate: Wed Apr 22 12:51:21 2020 +0200

    tdf#131147 don't store redline ExtraData during Undo
    
    to avoid of unwanted redline changes and assertion.
    
    Breaking redlines and storing extra data (formatting
    changes) need only for change tracking during editing,
    not in an ongoing Undo process.
    
    Regression from commit dc9a0b124272a6dc0a8d875d51b6f882e60a8a04
    (tdf#127101 Change tracking: reject format at paragraph join).
    
    Change-Id: Id78251bc14821cc82d8f3d34eec63ba7bac68df0
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92559
    Tested-by: Jenkins
    Tested-by: László Németh <nem...@numbertext.org>
    Reviewed-by: László Németh <nem...@numbertext.org>
    (cherry picked from commit 66b39ca79b36da8d5e151deab17a0fb7690eebe6)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92530
    Reviewed-by: Michael Stahl <michael.st...@cib.de>

diff --git a/sw/source/core/doc/DocumentRedlineManager.cxx 
b/sw/source/core/doc/DocumentRedlineManager.cxx
index 57621a2f6cd9..fb6a54d5cec2 100644
--- a/sw/source/core/doc/DocumentRedlineManager.cxx
+++ b/sw/source/core/doc/DocumentRedlineManager.cxx
@@ -2028,25 +2028,29 @@ DocumentRedlineManager::AppendRedline(SwRangeRedline* 
pNewRedl, bool const bCall
                             pTextNode = pTextNd->GetTextNode();
                             if (pTextNode && pDelNode != pTextNode )
                             {
-                                bCompress = true;
-
-                                // split redline to store ExtraData per 
paragraphs
                                 SwPosition aPos(aIdx);
-                                SwRangeRedline* pPar = new SwRangeRedline( 
*pNewRedl );
-                                pPar->SetStart( aPos );
-                                pNewRedl->SetEnd( aPos );
 
-                                // get extradata for reset formatting of the 
modified paragraph
-                                SwRedlineExtraData_FormatColl* pExtraData = 
lcl_CopyStyle(aPos, *pStt, false);
-                                if (pExtraData)
+                                if (m_rDoc.GetIDocumentUndoRedo().DoesUndo())
                                 {
-                                    
std::unique_ptr<SwRedlineExtraData_FormatColl> xRedlineExtraData;
-                                    if (!bFirst)
-                                        pExtraData->SetFormatAll(false);
-                                    xRedlineExtraData.reset(pExtraData);
-                                    pPar->SetExtraData( 
xRedlineExtraData.get() );
+                                    bCompress = true;
+
+                                    // split redline to store ExtraData per 
paragraphs
+                                    SwRangeRedline* pPar = new SwRangeRedline( 
*pNewRedl );
+                                    pPar->SetStart( aPos );
+                                    pNewRedl->SetEnd( aPos );
+
+                                    // get extradata for reset formatting of 
the modified paragraph
+                                    SwRedlineExtraData_FormatColl* pExtraData 
= lcl_CopyStyle(aPos, *pStt, false);
+                                    if (pExtraData)
+                                    {
+                                        
std::unique_ptr<SwRedlineExtraData_FormatColl> xRedlineExtraData;
+                                        if (!bFirst)
+                                            pExtraData->SetFormatAll(false);
+                                        xRedlineExtraData.reset(pExtraData);
+                                        pPar->SetExtraData( 
xRedlineExtraData.get() );
+                                    }
+                                    mpRedlineTable->Insert( pPar );
                                 }
-                                mpRedlineTable->Insert( pPar );
 
                                 // modify paragraph formatting
                                 lcl_CopyStyle(*pStt, aPos);
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to