svl/source/undo/undo.cxx |    8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

New commits:
commit 148fa9e9405b143f9fc228d9b5f967cad3139967
Author:     Noel Grandin <noel.gran...@collabora.co.uk>
AuthorDate: Mon Oct 14 17:07:31 2024 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Thu Oct 24 10:54:08 2024 +0200

    tdf#157130 undo and track changes not restoring characters (macOS)
    
    Not sure about the real underlying issue here.
    
    In debug mode, we hit this assert. Changing it from an assert to a "do 
decrement mnEmptyMark if it would become negative" seems to help.
    
    Change-Id: Ie23a685552d2f8153b67e18f9c0203ecbaad0ede
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174905
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/svl/source/undo/undo.cxx b/svl/source/undo/undo.cxx
index ab33374507fc..cb278cf153c3 100644
--- a/svl/source/undo/undo.cxx
+++ b/svl/source/undo/undo.cxx
@@ -583,13 +583,9 @@ bool SfxUndoManager::ImplAddUndoAction_NoNotify( 
std::unique_ptr<SfxUndoAction>
             if (m_xData->pActUndoArray->nCurUndoAction > 0)
             {
                 --m_xData->pActUndoArray->nCurUndoAction;
+                // fdo#66071 invalidate the current empty mark when removing
+                --m_xData->mnEmptyMark;
             }
-            else
-            {
-                assert(!"CurrentUndoAction going negative (!)");
-            }
-            // fdo#66071 invalidate the current empty mark when removing
-            --m_xData->mnEmptyMark;
         }
     }
 

Reply via email to