sc/source/ui/view/cellsh1.cxx |   29 +++++++++++++++++------------
 1 file changed, 17 insertions(+), 12 deletions(-)

New commits:
commit f05e127991a63a2cf4fed556e5304e0adbd4b87b
Author:     Caolán McNamara <[email protected]>
AuthorDate: Mon Feb 9 11:51:14 2026 +0000
Commit:     Caolán McNamara <[email protected]>
CommitDate: Tue Feb 10 14:58:51 2026 +0100

    split out a DeleteContents
    
    Change-Id: I5d99a03d7c59f851b1e84772bccf087ce2d80622
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/198976
    Reviewed-by: Miklos Vajna <[email protected]>
    Tested-by: Jenkins CollaboraOffice <[email protected]>
    (cherry picked from commit 84912d8c7b416a5360d0e8afe0abd548590064d8)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/199049
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <[email protected]>

diff --git a/sc/source/ui/view/cellsh1.cxx b/sc/source/ui/view/cellsh1.cxx
index 02d5239fbd37..efab25af5f9d 100644
--- a/sc/source/ui/view/cellsh1.cxx
+++ b/sc/source/ui/view/cellsh1.cxx
@@ -274,6 +274,22 @@ void DeleteCells(ScTabViewShell* pTabViewShell, SfxRequest 
&rReq, DelCellCmd eCm
         }
     }
 }
+
+void DeleteContents(ScTabViewShell* pTabViewShell, SfxRequest &rReq, 
InsertDeleteFlags nFlags)
+{
+    if( nFlags != InsertDeleteFlags::NONE )
+    {
+        pTabViewShell->DeleteContents( nFlags );
+
+        if( ! rReq.IsAPI() )
+        {
+            OUString aFlags = FlagsToString( nFlags, InsertDeleteFlags::ALL );
+
+            rReq.AppendItem( SfxStringItem( SID_DELETE, aFlags ) );
+            rReq.Done();
+        }
+    }
+}
 }
 
 void ScCellShell::ExecuteEdit( SfxRequest& rReq )
@@ -506,18 +522,7 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
                         pTabViewShell->ErrorMessage(aTester.GetMessageId());
                 }
 
-                if( nFlags != InsertDeleteFlags::NONE )
-                {
-                    pTabViewShell->DeleteContents( nFlags );
-
-                    if( ! rReq.IsAPI() )
-                    {
-                        OUString aFlags = FlagsToString( nFlags, 
InsertDeleteFlags::ALL );
-
-                        rReq.AppendItem( SfxStringItem( SID_DELETE, aFlags ) );
-                        rReq.Done();
-                    }
-                }
+                DeleteContents(pTabViewShell, rReq, nFlags);
             }
             break;
 

Reply via email to