sw/qa/extras/tiledrendering/tiledrendering.cxx |   10 +++++-----
 sw/source/core/doc/DocumentRedlineManager.cxx  |    4 ++--
 2 files changed, 7 insertions(+), 7 deletions(-)

New commits:
commit 6f35a6f225cc9fb9bacd703417825fcfd439f709
Author:     Mike Kaganski <[email protected]>
AuthorDate: Fri Oct 20 14:35:51 2023 +0300
Commit:     Mike Kaganski <[email protected]>
CommitDate: Fri Oct 20 22:42:57 2023 +0200

    Avoid double notifications for deletion case
    
    Follow-up to commit 34ac12dca3f5af50fddfb7c77e2943897980b815
    When old redline is own Insert, and the new one is Delete, it means
    that it was already handled in DocumentRedlineManager::DeleteRedline.
    
    This also reverts the unit test change done in the mentioned commit.
    
    Change-Id: I77e59dceb1c880fc6ec10ad98867be3bf5282f70
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158253
    Tested-by: Jenkins
    Reviewed-by: Mike Kaganski <[email protected]>
    (cherry picked from commit b24dbf7f58227e2c0d36f114edca11ef69011ee9)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158270
    Tested-by: Jenkins CollaboraOffice <[email protected]>

diff --git a/sw/qa/extras/tiledrendering/tiledrendering.cxx 
b/sw/qa/extras/tiledrendering/tiledrendering.cxx
index 4f70ac36a87f..91344a563505 100644
--- a/sw/qa/extras/tiledrendering/tiledrendering.cxx
+++ b/sw/qa/extras/tiledrendering/tiledrendering.cxx
@@ -1690,9 +1690,9 @@ CPPUNIT_TEST_FIXTURE(SwTiledRenderingTest, 
testRedlineUpdateCallback)
     m_nRedlineTableEntryModified = 0;
     pWrtShell->DelLeft();
 
-    // Assert that we get exactly two notification about the redline update.
+    // Assert that we get exactly one notification about the redline update.
     // This was 0, as LOK_CALLBACK_REDLINE_TABLE_ENTRY_MODIFIED wasn't sent.
-    CPPUNIT_ASSERT_EQUAL(2, m_nRedlineTableEntryModified);
+    CPPUNIT_ASSERT_EQUAL(1, m_nRedlineTableEntryModified);
 
     // Turn off the change tracking mode, make some modification to left of the
     // redline so that its position changes
@@ -1701,18 +1701,18 @@ CPPUNIT_TEST_FIXTURE(SwTiledRenderingTest, 
testRedlineUpdateCallback)
     pWrtShell->Insert("This text is left of the redline");
 
     // Position of the redline has changed => Modify callback
-    CPPUNIT_ASSERT_EQUAL(3, m_nRedlineTableEntryModified);
+    CPPUNIT_ASSERT_EQUAL(2, m_nRedlineTableEntryModified);
 
     pWrtShell->DelLeft();
     // Deletion also emits Modify callback
-    CPPUNIT_ASSERT_EQUAL(4, m_nRedlineTableEntryModified);
+    CPPUNIT_ASSERT_EQUAL(3, m_nRedlineTableEntryModified);
 
     // Make changes to the right of the redline => no position change in 
redline
     pWrtShell->Right(SwCursorSkipMode::Chars, /*bSelect=*/false, 100/*Go 
enough right */, /*bBasicCall=*/false);
     pWrtShell->Insert("This text is right of the redline");
 
     // No Modify callbacks
-    CPPUNIT_ASSERT_EQUAL(4, m_nRedlineTableEntryModified);
+    CPPUNIT_ASSERT_EQUAL(3, m_nRedlineTableEntryModified);
 }
 
 CPPUNIT_TEST_FIXTURE(SwTiledRenderingTest, testGetViewRenderState)
diff --git a/sw/source/core/doc/DocumentRedlineManager.cxx 
b/sw/source/core/doc/DocumentRedlineManager.cxx
index f538e5d88a81..102e3ec1c780 100644
--- a/sw/source/core/doc/DocumentRedlineManager.cxx
+++ b/sw/source/core/doc/DocumentRedlineManager.cxx
@@ -1798,8 +1798,8 @@ DocumentRedlineManager::AppendRedline(SwRangeRedline* 
pNewRedl, bool const bCall
                         delete pNewRedl;
                         pNewRedl = nullptr;
 
-                        if (!bDec)
-                            MaybeNotifyRedlineModification(*pRedl, m_rDoc);
+                        // No need to call MaybeNotifyRedlineModification, 
because a notification
+                        // was already sent in 
DocumentRedlineManager::DeleteRedline
                         break;
 
                     case SwComparePosition::Outside:

Reply via email to