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

New commits:
commit 66b39ca79b36da8d5e151deab17a0fb7690eebe6
Author:     László Németh <nem...@numbertext.org>
AuthorDate: Mon Apr 20 12:46:58 2020 +0200
Commit:     László Németh <nem...@numbertext.org>
CommitDate: Mon Apr 20 16:42:08 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>

diff --git a/sw/source/core/doc/DocumentRedlineManager.cxx 
b/sw/source/core/doc/DocumentRedlineManager.cxx
index 3d8435efd262..b8b85c984546 100644
--- a/sw/source/core/doc/DocumentRedlineManager.cxx
+++ b/sw/source/core/doc/DocumentRedlineManager.cxx
@@ -2030,25 +2030,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