[Libreoffice-commits] core.git: sc/inc sc/qa sc/source

Noel Grandin noel.grandin at collabora.co.uk
Wed Apr 18 11:33:54 UTC 2018


 sc/inc/global.hxx                  |   12 +++---
 sc/qa/unit/ucalc.cxx               |   18 ++++-----
 sc/qa/unit/ucalc_formula.cxx       |   34 ++++++++---------
 sc/qa/unit/ucalc_sharedformula.cxx |    8 ++--
 sc/source/ui/docshell/docfunc.cxx  |   74 ++++++++++++++++++-------------------
 sc/source/ui/docshell/docsh3.cxx   |    4 +-
 sc/source/ui/miscdlgs/delcldlg.cxx |   10 ++---
 sc/source/ui/undo/undoblk.cxx      |   32 ++++++++--------
 sc/source/ui/unoobj/cellsuno.cxx   |   10 ++---
 sc/source/ui/unoobj/docuno.cxx     |    4 +-
 sc/source/ui/view/cellsh1.cxx      |   28 +++++++-------
 sc/source/ui/view/gridwin.cxx      |   14 +++----
 sc/source/ui/view/viewfunc.cxx     |   18 ++++-----
 13 files changed, 133 insertions(+), 133 deletions(-)

New commits:
commit 42595315324e2b06ec661d1069573c9ec99650a4
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Wed Apr 18 08:53:29 2018 +0200

    convert DelCellCmd to scoped enum
    
    Change-Id: I4766fc874026f218b33e66944b98562d1ec614d3
    Reviewed-on: https://gerrit.libreoffice.org/53088
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/sc/inc/global.hxx b/sc/inc/global.hxx
index d6e810f4f95c..93521c4d0b8e 100644
--- a/sc/inc/global.hxx
+++ b/sc/inc/global.hxx
@@ -288,13 +288,13 @@ enum CellType
         CELLTYPE_EDIT,
     };
 
-enum DelCellCmd
+enum class DelCellCmd
     {
-        DEL_CELLSUP,
-        DEL_CELLSLEFT,
-        DEL_DELROWS,
-        DEL_DELCOLS,
-        DEL_NONE
+        CellsUp,
+        CellsLeft,
+        Rows,
+        Cols,
+        NONE
     };
 
 enum InsCellCmd
diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx
index 103ee5d3de71..3eff3f0dac9a 100644
--- a/sc/qa/unit/ucalc.cxx
+++ b/sc/qa/unit/ucalc.cxx
@@ -4273,7 +4273,7 @@ void Test::testCopyPasteRepeatOneFormula()
     }
 
     // Delete row at row 1 to shift the cells up.
-    rFunc.DeleteCells(aRowOne, &aMark, DEL_DELROWS, true);
+    rFunc.DeleteCells(aRowOne, &aMark, DelCellCmd::Rows, true);
 
     // Check the formula results again.
     for (SCROW i = 0; i < 10; ++i)
@@ -5245,7 +5245,7 @@ void Test::testNoteDeleteRow()
     ScDocFunc& rDocFunc = getDocShell().GetDocFunc();
     ScMarkData aMark;
     aMark.SelectOneTable(0);
-    rDocFunc.DeleteCells(ScRange(0,1,0,MAXCOL,1,0), &aMark, DEL_CELLSUP, true);
+    rDocFunc.DeleteCells(ScRange(0,1,0,MAXCOL,1,0), &aMark, DelCellCmd::CellsUp, true);
 
     // Check to make sure the notes have shifted upward.
     pNote = m_pDoc->GetNote(ScAddress(1,1,0));
@@ -5274,7 +5274,7 @@ void Test::testNoteDeleteRow()
     CPPUNIT_ASSERT_EQUAL(OUString("Second Note"), pNote->GetText());
 
     // Delete row 3.
-    rDocFunc.DeleteCells(ScRange(0,2,0,MAXCOL,2,0), &aMark, DEL_CELLSUP, true);
+    rDocFunc.DeleteCells(ScRange(0,2,0,MAXCOL,2,0), &aMark, DelCellCmd::CellsUp, true);
 
     pNote = m_pDoc->GetNote(ScAddress(1,2,0));
     CPPUNIT_ASSERT_MESSAGE("B3 should have a note.", pNote);
@@ -6965,7 +6965,7 @@ void Test::testProtectedSheetEditByRow()
         ScRange aRow3(0,2,0,MAXCOL,2,0);
         ScMarkData aMark;
         aMark.SelectOneTable(0);
-        bool bDeleted = rDocFunc.DeleteCells(aRow3, &aMark, DEL_DELROWS, true);
+        bool bDeleted = rDocFunc.DeleteCells(aRow3, &aMark, DelCellCmd::Rows, true);
         CPPUNIT_ASSERT_MESSAGE("deletion of row 3 should fail.", !bDeleted);
 
         // Protect the sheet but allow row deletion.
@@ -6973,12 +6973,12 @@ void Test::testProtectedSheetEditByRow()
         m_pDoc->SetTabProtection(0, &aProtect);
 
         // Now we should be able to delete row 3.
-        bDeleted = rDocFunc.DeleteCells(aRow3, &aMark, DEL_DELROWS, true);
+        bDeleted = rDocFunc.DeleteCells(aRow3, &aMark, DelCellCmd::Rows, true);
         CPPUNIT_ASSERT_MESSAGE("deletion of row 3 should succeed.", bDeleted);
 
         // But, row deletion should still fail on a protected row.
         ScRange aRow10(0,9,0,MAXCOL,9,0);
-        bDeleted = rDocFunc.DeleteCells(aRow10, &aMark, DEL_DELROWS, true);
+        bDeleted = rDocFunc.DeleteCells(aRow10, &aMark, DelCellCmd::Rows, true);
         CPPUNIT_ASSERT_MESSAGE("deletion of row 10 should not be allowed.", !bDeleted);
 
         // Try inserting a new row.  It should fail.
@@ -7041,7 +7041,7 @@ void Test::testProtectedSheetEditByColumn()
         ScRange aCol3(2,0,0,2,MAXROW,0);
         ScMarkData aMark;
         aMark.SelectOneTable(0);
-        bool bDeleted = rDocFunc.DeleteCells(aCol3, &aMark, DEL_DELCOLS, true);
+        bool bDeleted = rDocFunc.DeleteCells(aCol3, &aMark, DelCellCmd::Cols, true);
         CPPUNIT_ASSERT_MESSAGE("deletion of column 3 should fail.", !bDeleted);
 
         // Protect the sheet but allow column deletion.
@@ -7049,12 +7049,12 @@ void Test::testProtectedSheetEditByColumn()
         m_pDoc->SetTabProtection(0, &aProtect);
 
         // Now we should be able to delete column C.
-        bDeleted = rDocFunc.DeleteCells(aCol3, &aMark, DEL_DELCOLS, true);
+        bDeleted = rDocFunc.DeleteCells(aCol3, &aMark, DelCellCmd::Cols, true);
         CPPUNIT_ASSERT_MESSAGE("deletion of column 3 should succeed.", bDeleted);
 
         // But, column deletion should still fail on a protected column.
         ScRange aCol10(9,0,0,9,MAXROW,0);
-        bDeleted = rDocFunc.DeleteCells(aCol10, &aMark, DEL_DELCOLS, true);
+        bDeleted = rDocFunc.DeleteCells(aCol10, &aMark, DelCellCmd::Cols, true);
         CPPUNIT_ASSERT_MESSAGE("deletion of column 10 should not be allowed.", !bDeleted);
 
         // Try inserting a new column.  It should fail.
diff --git a/sc/qa/unit/ucalc_formula.cxx b/sc/qa/unit/ucalc_formula.cxx
index 5d3bdd5aafbc..352cb4ae1d38 100644
--- a/sc/qa/unit/ucalc_formula.cxx
+++ b/sc/qa/unit/ucalc_formula.cxx
@@ -2574,7 +2574,7 @@ void Test::testFormulaRefUpdateDeleteAndShiftLeft()
     ScMarkData aMark;
     aMark.SelectOneTable(0);
     ScDocFunc& rFunc = getDocShell().GetDocFunc();
-    bool bDeleted = rFunc.DeleteCells(ScRange(3,0,0,4,MAXROW,0), &aMark, DEL_CELLSLEFT, true);
+    bool bDeleted = rFunc.DeleteCells(ScRange(3,0,0,4,MAXROW,0), &aMark, DelCellCmd::CellsLeft, true);
     CPPUNIT_ASSERT(bDeleted);
 
     aPos.IncCol(-2);
@@ -2591,7 +2591,7 @@ void Test::testFormulaRefUpdateDeleteAndShiftLeft()
     ASSERT_FORMULA_EQUAL(*m_pDoc, aPos, "SUM(C1:G1)", "Wrong formula!");
 
     // Delete columns C:D (left end of the reference).
-    bDeleted = rFunc.DeleteCells(ScRange(2,0,0,3,MAXROW,0), &aMark, DEL_CELLSLEFT, true);
+    bDeleted = rFunc.DeleteCells(ScRange(2,0,0,3,MAXROW,0), &aMark, DelCellCmd::CellsLeft, true);
     CPPUNIT_ASSERT(bDeleted);
 
     aPos.IncCol(-2);
@@ -2605,7 +2605,7 @@ void Test::testFormulaRefUpdateDeleteAndShiftLeft()
     ASSERT_FORMULA_EQUAL(*m_pDoc, aPos, "SUM(C1:G1)", "Wrong formula!");
 
     // Delete columns B:E (overlaps on the left).
-    bDeleted = rFunc.DeleteCells(ScRange(1,0,0,4,MAXROW,0), &aMark, DEL_CELLSLEFT, true);
+    bDeleted = rFunc.DeleteCells(ScRange(1,0,0,4,MAXROW,0), &aMark, DelCellCmd::CellsLeft, true);
     CPPUNIT_ASSERT(bDeleted);
 
     aPos.IncCol(-4);
@@ -2631,7 +2631,7 @@ void Test::testFormulaRefUpdateDeleteAndShiftLeft()
     CPPUNIT_ASSERT_EQUAL(21.0, m_pDoc->GetValue(aPos));
 
     // Delete columns F:H (right end of the reference).
-    bDeleted = rFunc.DeleteCells(ScRange(5,0,0,7,MAXROW,0), &aMark, DEL_CELLSLEFT, true);
+    bDeleted = rFunc.DeleteCells(ScRange(5,0,0,7,MAXROW,0), &aMark, DelCellCmd::CellsLeft, true);
     CPPUNIT_ASSERT(bDeleted);
 
     CPPUNIT_ASSERT_EQUAL(6.0, m_pDoc->GetValue(aPos));
@@ -2643,7 +2643,7 @@ void Test::testFormulaRefUpdateDeleteAndShiftLeft()
     ASSERT_FORMULA_EQUAL(*m_pDoc, aPos, "SUM(C1:H1)", "Wrong formula!");
 
     // Delete columns G:I (overlaps on the right).
-    bDeleted = rFunc.DeleteCells(ScRange(6,0,0,8,MAXROW,0), &aMark, DEL_CELLSLEFT, true);
+    bDeleted = rFunc.DeleteCells(ScRange(6,0,0,8,MAXROW,0), &aMark, DelCellCmd::CellsLeft, true);
     CPPUNIT_ASSERT(bDeleted);
 
     CPPUNIT_ASSERT_EQUAL(10.0, m_pDoc->GetValue(aPos));
@@ -2709,7 +2709,7 @@ void Test::testFormulaRefUpdateDeleteAndShiftLeft2()
     ScMarkData aMark;
     aMark.SelectOneTable(0);
     ScDocFunc& rFunc = getDocShell().GetDocFunc();
-    bool bDeleted = rFunc.DeleteCells(ScRange(0,0,0,0,MAXROW,0), &aMark, DEL_CELLSLEFT, true);
+    bool bDeleted = rFunc.DeleteCells(ScRange(0,0,0,0,MAXROW,0), &aMark, DelCellCmd::CellsLeft, true);
     CPPUNIT_ASSERT(bDeleted);
 
     funcCheckDeleted();
@@ -2748,7 +2748,7 @@ void Test::testFormulaRefUpdateDeleteAndShiftUp()
     ScMarkData aMark;
     aMark.SelectOneTable(0);
     ScDocFunc& rFunc = getDocShell().GetDocFunc();
-    bool bDeleted = rFunc.DeleteCells(ScRange(0,3,0,MAXCOL,4,0), &aMark, DEL_CELLSUP, true);
+    bool bDeleted = rFunc.DeleteCells(ScRange(0,3,0,MAXCOL,4,0), &aMark, DelCellCmd::CellsUp, true);
     CPPUNIT_ASSERT(bDeleted);
 
     aPos.IncRow(-2);
@@ -2765,7 +2765,7 @@ void Test::testFormulaRefUpdateDeleteAndShiftUp()
     ASSERT_FORMULA_EQUAL(*m_pDoc, aPos, "SUM(A3:A7)", "Wrong formula!");
 
     // Delete rows 3:4 (top end of the reference).
-    bDeleted = rFunc.DeleteCells(ScRange(0,2,0,MAXCOL,3,0), &aMark, DEL_CELLSUP, true);
+    bDeleted = rFunc.DeleteCells(ScRange(0,2,0,MAXCOL,3,0), &aMark, DelCellCmd::CellsUp, true);
     CPPUNIT_ASSERT(bDeleted);
 
     aPos.IncRow(-2);
@@ -2779,7 +2779,7 @@ void Test::testFormulaRefUpdateDeleteAndShiftUp()
     ASSERT_FORMULA_EQUAL(*m_pDoc, aPos, "SUM(A3:A7)", "Wrong formula!");
 
     // Delete rows 2:5 (overlaps on the top).
-    bDeleted = rFunc.DeleteCells(ScRange(0,1,0,MAXCOL,4,0), &aMark, DEL_CELLSUP, true);
+    bDeleted = rFunc.DeleteCells(ScRange(0,1,0,MAXCOL,4,0), &aMark, DelCellCmd::CellsUp, true);
     CPPUNIT_ASSERT(bDeleted);
 
     aPos.IncRow(-4);
@@ -2805,7 +2805,7 @@ void Test::testFormulaRefUpdateDeleteAndShiftUp()
     CPPUNIT_ASSERT_EQUAL(21.0, m_pDoc->GetValue(aPos));
 
     // Delete rows 6:8 (bottom end of the reference).
-    bDeleted = rFunc.DeleteCells(ScRange(0,5,0,MAXCOL,7,0), &aMark, DEL_CELLSUP, true);
+    bDeleted = rFunc.DeleteCells(ScRange(0,5,0,MAXCOL,7,0), &aMark, DelCellCmd::CellsUp, true);
     CPPUNIT_ASSERT(bDeleted);
 
     CPPUNIT_ASSERT_EQUAL(6.0, m_pDoc->GetValue(aPos));
@@ -2817,7 +2817,7 @@ void Test::testFormulaRefUpdateDeleteAndShiftUp()
     ASSERT_FORMULA_EQUAL(*m_pDoc, aPos, "SUM(A3:A8)", "Wrong formula!");
 
     // Delete rows 7:9 (overlaps on the bottom).
-    bDeleted = rFunc.DeleteCells(ScRange(0,6,0,MAXCOL,8,0), &aMark, DEL_CELLSUP, true);
+    bDeleted = rFunc.DeleteCells(ScRange(0,6,0,MAXCOL,8,0), &aMark, DelCellCmd::CellsUp, true);
     CPPUNIT_ASSERT(bDeleted);
 
     CPPUNIT_ASSERT_EQUAL(10.0, m_pDoc->GetValue(aPos));
@@ -3247,7 +3247,7 @@ void Test::testFormulaRefUpdateNameDeleteRow()
     // Delete row 3.
     ScMarkData aMark;
     aMark.SelectOneTable(0);
-    rFunc.DeleteCells(ScRange(0,2,0,MAXCOL,2,0), &aMark, DEL_CELLSUP, true);
+    rFunc.DeleteCells(ScRange(0,2,0,MAXCOL,2,0), &aMark, DelCellCmd::CellsUp, true);
 
     // The reference in the 'MyRange' name should get updated to B2:B3.
     aExpr = pCode->CreateString(aCxt, ScAddress(0,0,0));
@@ -3258,7 +3258,7 @@ void Test::testFormulaRefUpdateNameDeleteRow()
     CPPUNIT_ASSERT_EQUAL(OUString("$B$#REF!"), aExpr2);
 
     // Delete row 3 again.
-    rFunc.DeleteCells(ScRange(0,2,0,MAXCOL,2,0), &aMark, DEL_CELLSUP, true);
+    rFunc.DeleteCells(ScRange(0,2,0,MAXCOL,2,0), &aMark, DelCellCmd::CellsUp, true);
     aExpr = pCode->CreateString(aCxt, ScAddress(0,0,0));
     CPPUNIT_ASSERT_EQUAL(OUString("$B$2:$B$2"), aExpr);
 
@@ -3286,7 +3286,7 @@ void Test::testFormulaRefUpdateNameDeleteRow()
     CPPUNIT_ASSERT_EQUAL(OUString("$B$2:$B$4"), aExpr);
 
     // Delete row 2-3.
-    rFunc.DeleteCells(ScRange(0,1,0,MAXCOL,2,0), &aMark, DEL_CELLSUP, true);
+    rFunc.DeleteCells(ScRange(0,1,0,MAXCOL,2,0), &aMark, DelCellCmd::CellsUp, true);
 
     aExpr = pCode->CreateString(aCxt, ScAddress(0,0,0));
     CPPUNIT_ASSERT_EQUAL(OUString("$B$2:$B$2"), aExpr);
@@ -3312,7 +3312,7 @@ void Test::testFormulaRefUpdateNameDeleteRow()
 
     ScMarkData aMark2;
     aMark2.SelectOneTable(1);
-    rFunc.DeleteCells(ScRange(0,2,1,MAXCOL,2,1), &aMark2, DEL_CELLSUP, true);
+    rFunc.DeleteCells(ScRange(0,2,1,MAXCOL,2,1), &aMark2, DelCellCmd::CellsUp, true);
 
     pName = m_pDoc->GetRangeName()->findByUpperName("MYRANGE");
     CPPUNIT_ASSERT(pName);
@@ -5647,7 +5647,7 @@ void Test::testFormulaDepTrackingDeleteRow()
     ScDocFunc& rFunc = getDocShell().GetDocFunc();
     ScMarkData aMark;
     aMark.SelectOneTable(0);
-    rFunc.DeleteCells(ScRange(0,1,0,MAXCOL,1,0), &aMark, DEL_CELLSUP, true);
+    rFunc.DeleteCells(ScRange(0,1,0,MAXCOL,1,0), &aMark, DelCellCmd::CellsUp, true);
 
     pBC = m_pDoc->GetBroadcaster(ScAddress(0,3,0));
     CPPUNIT_ASSERT_MESSAGE("Broadcaster at A5 should have shifted to A4.", pBC);
@@ -5705,7 +5705,7 @@ void Test::testFormulaDepTrackingDeleteCol()
     ScDocFunc& rFunc = getDocShell().GetDocFunc();
     ScMarkData aMark;
     aMark.SelectOneTable(0);
-    rFunc.DeleteCells(ScRange(0,0,0,0,MAXROW,0), &aMark, DEL_CELLSLEFT, true);
+    rFunc.DeleteCells(ScRange(0,0,0,0,MAXROW,0), &aMark, DelCellCmd::CellsLeft, true);
 
     {
         // Expected output table content.  0 = empty cell
diff --git a/sc/qa/unit/ucalc_sharedformula.cxx b/sc/qa/unit/ucalc_sharedformula.cxx
index a21f778d6411..ffd00aede191 100644
--- a/sc/qa/unit/ucalc_sharedformula.cxx
+++ b/sc/qa/unit/ucalc_sharedformula.cxx
@@ -675,7 +675,7 @@ void Test::testSharedFormulasRefUpdateRangeDeleteRow()
     ScDocFunc& rFunc = getDocShell().GetDocFunc();
     ScMarkData aMark;
     aMark.SelectOneTable(0);
-    rFunc.DeleteCells(ScRange(0,2,0,MAXCOL,2,0), &aMark, DEL_DELROWS, true);
+    rFunc.DeleteCells(ScRange(0,2,0,MAXCOL,2,0), &aMark, DelCellCmd::Rows, true);
 
     // Make sure C1:C4 belong to the same group.
     pFC = m_pDoc->GetFormulaCell(ScAddress(2,0,0));
@@ -777,7 +777,7 @@ void Test::testSharedFormulasRefUpdateExternal()
     ScDocFunc& rDocFunc = getDocShell().GetDocFunc();
     ScMarkData aMark;
     aMark.SelectOneTable(0);
-    rDocFunc.DeleteCells(ScRange(0,0,0,MAXCOL,1,0), &aMark, DEL_CELLSUP, true);
+    rDocFunc.DeleteCells(ScRange(0,0,0,MAXCOL,1,0), &aMark, DelCellCmd::CellsUp, true);
 
     // Check the shifted formula cells now in A5:A8.
     ASSERT_FORMULA_EQUAL(*m_pDoc, ScAddress(0,4,0), "'file:///extdata.fake'#$Data.A1", "Wrong formula!");
@@ -1019,7 +1019,7 @@ void Test::testSharedFormulasDeleteColumns()
     CPPUNIT_ASSERT_EQUAL(11.0, m_pDoc->GetValue(ScAddress(2,0,0)));
 
     // Delete column B.
-    rFunc.DeleteCells(ScRange(1,0,0,1,MAXROW,0), &aMark, DEL_CELLSLEFT, true);
+    rFunc.DeleteCells(ScRange(1,0,0,1,MAXROW,0), &aMark, DelCellCmd::CellsLeft, true);
     CPPUNIT_ASSERT_EQUAL(OUString("#REF!"), m_pDoc->GetString(ScAddress(1,0,0)));
 
     // The reference should still point to row 1 but the column status should be set to 'deleted'.
@@ -1062,7 +1062,7 @@ void Test::testSharedFormulasDeleteColumns()
     }
 
     // Delete column B.
-    rFunc.DeleteCells(ScRange(1,0,0,1,MAXROW,0), &aMark, DEL_CELLSLEFT, true);
+    rFunc.DeleteCells(ScRange(1,0,0,1,MAXROW,0), &aMark, DelCellCmd::CellsLeft, true);
 
     for (SCROW i = 0; i <= 1; ++i)
     {
diff --git a/sc/source/ui/docshell/docfunc.cxx b/sc/source/ui/docshell/docfunc.cxx
index 78b36aec755c..83304ecff7cb 100644
--- a/sc/source/ui/docshell/docfunc.cxx
+++ b/sc/source/ui/docshell/docfunc.cxx
@@ -1560,13 +1560,13 @@ bool canDeleteCellsByPivot(const ScRange& rRange, const ScMarkData& rMarkData, D
 
     switch (eCmd)
     {
-        case DEL_DELROWS:
+        case DelCellCmd::Rows:
         {
             aRange.aStart.SetCol(0);
             aRange.aEnd.SetCol(MAXCOL);
             SAL_FALLTHROUGH;
         }
-        case DEL_CELLSUP:
+        case DelCellCmd::CellsUp:
         {
             for (ScMarkData::const_iterator it = itBeg; it != itEnd; ++it)
             {
@@ -1585,13 +1585,13 @@ bool canDeleteCellsByPivot(const ScRange& rRange, const ScMarkData& rMarkData, D
             }
         }
         break;
-        case DEL_DELCOLS:
+        case DelCellCmd::Cols:
         {
             aRange.aStart.SetRow(0);
             aRange.aEnd.SetRow(MAXROW);
             SAL_FALLTHROUGH;
         }
-        case DEL_CELLSLEFT:
+        case DelCellCmd::CellsLeft:
         {
             for (ScMarkData::const_iterator it = itBeg; it != itEnd; ++it)
             {
@@ -2157,8 +2157,8 @@ bool ScDocFunc::DeleteCells( const ScRange& rRange, const ScMarkData* pTabMark,
     ScDocShellModificator aModificator( rDocShell );
 
     if (rDocShell.GetDocument().GetChangeTrack() &&
-            ((eCmd == DEL_CELLSUP   && (rRange.aStart.Col() != 0 || rRange.aEnd.Col() != MAXCOL)) ||
-             (eCmd == DEL_CELLSLEFT && (rRange.aStart.Row() != 0 || rRange.aEnd.Row() != MAXROW))))
+            ((eCmd == DelCellCmd::CellsUp   && (rRange.aStart.Col() != 0 || rRange.aEnd.Col() != MAXCOL)) ||
+             (eCmd == DelCellCmd::CellsLeft && (rRange.aStart.Row() != 0 || rRange.aEnd.Row() != MAXROW))))
     {
         // We should not reach this via UI disabled slots.
         assert(bApi);
@@ -2236,12 +2236,12 @@ bool ScDocFunc::DeleteCells( const ScRange& rRange, const ScMarkData* pTabMark,
         nPaintEndRow = nUndoEndRow;
     }
 
-    if (eCmd==DEL_DELROWS)
+    if (eCmd==DelCellCmd::Rows)
     {
         nUndoStartCol = 0;
         nUndoEndCol = MAXCOL;
     }
-    if (eCmd==DEL_DELCOLS)
+    if (eCmd==DelCellCmd::Cols)
     {
         nUndoStartRow = 0;
         nUndoEndRow = MAXROW;
@@ -2249,21 +2249,21 @@ bool ScDocFunc::DeleteCells( const ScRange& rRange, const ScMarkData* pTabMark,
                     // Test for cell protection
 
     SCCOL nEditTestEndX = nUndoEndCol;
-    if ( eCmd==DEL_DELCOLS || eCmd==DEL_CELLSLEFT )
+    if ( eCmd==DelCellCmd::Cols || eCmd==DelCellCmd::CellsLeft )
         nEditTestEndX = MAXCOL;
     SCROW nEditTestEndY = nUndoEndRow;
-    if ( eCmd==DEL_DELROWS || eCmd==DEL_CELLSUP )
+    if ( eCmd==DelCellCmd::Rows || eCmd==DelCellCmd::CellsUp )
         nEditTestEndY = MAXROW;
 
     ScEditableTester aTester;
 
     switch (eCmd)
     {
-        case DEL_DELCOLS:
+        case DelCellCmd::Cols:
             aTester = ScEditableTester(
                 rDoc, sc::ColRowEditAction::DeleteColumns, nUndoStartCol, nUndoEndCol, aMark);
             break;
-        case DEL_DELROWS:
+        case DelCellCmd::Rows:
             aTester = ScEditableTester(
                 rDoc, sc::ColRowEditAction::DeleteRows, nUndoStartRow, nUndoEndRow, aMark);
             break;
@@ -2287,8 +2287,8 @@ bool ScDocFunc::DeleteCells( const ScRange& rRange, const ScMarkData* pTabMark,
     }
                     // Test for merged cells
 
-    SCCOL nMergeTestEndCol = (eCmd==DEL_CELLSLEFT) ? MAXCOL : nUndoEndCol;
-    SCROW nMergeTestEndRow = (eCmd==DEL_CELLSUP)   ? MAXROW : nUndoEndRow;
+    SCCOL nMergeTestEndCol = (eCmd==DelCellCmd::CellsLeft) ? MAXCOL : nUndoEndCol;
+    SCROW nMergeTestEndRow = (eCmd==DelCellCmd::CellsUp)   ? MAXROW : nUndoEndRow;
     SCCOL nExtendStartCol = nUndoStartCol;
     SCROW nExtendStartRow = nUndoStartRow;
     bool bNeedRefresh = false;
@@ -2320,8 +2320,8 @@ bool ScDocFunc::DeleteCells( const ScRange& rRange, const ScMarkData* pTabMark,
 
             rDoc.ExtendMerge( nMergeStartCol, nMergeStartRow, nMergeEndCol, nMergeEndRow, i );
             rDoc.ExtendOverlapped( nMergeStartCol, nMergeStartRow, nMergeEndCol, nMergeEndRow, i );
-            if( ( eCmd == DEL_CELLSUP && ( nMergeStartCol != nUndoStartCol || nMergeEndCol != nMergeTestEndCol))||
-                ( eCmd == DEL_CELLSLEFT && ( nMergeStartRow != nUndoStartRow || nMergeEndRow != nMergeTestEndRow)))
+            if( ( eCmd == DelCellCmd::CellsUp && ( nMergeStartCol != nUndoStartCol || nMergeEndCol != nMergeTestEndCol))||
+                ( eCmd == DelCellCmd::CellsLeft && ( nMergeStartRow != nUndoStartRow || nMergeEndRow != nMergeTestEndRow)))
             {
                 if (!bApi)
                     rDocShell.ErrorMessage(STR_MSSG_DELETECELLS_0);
@@ -2380,13 +2380,13 @@ bool ScDocFunc::DeleteCells( const ScRange& rRange, const ScMarkData* pTabMark,
             if( bDeletingMerge )
             {
 
-                if( eCmd == DEL_DELROWS || eCmd == DEL_CELLSUP )
+                if( eCmd == DelCellCmd::Rows || eCmd == DelCellCmd::CellsUp )
                 {
                     nStartRow = aExtendMergeRange.aStart.Row();
                     nEndRow = aExtendMergeRange.aEnd.Row();
                     bNeedRefresh = true;
 
-                    if( eCmd == DEL_CELLSUP )
+                    if( eCmd == DelCellCmd::CellsUp )
                     {
                         nEndCol = aExtendMergeRange.aEnd.Col();
                     }
@@ -2396,12 +2396,12 @@ bool ScDocFunc::DeleteCells( const ScRange& rRange, const ScMarkData* pTabMark,
                         nEndCol = MAXCOL;
                     }
                 }
-                else if( eCmd == DEL_CELLSLEFT || eCmd == DEL_DELCOLS )
+                else if( eCmd == DelCellCmd::CellsLeft || eCmd == DelCellCmd::Cols )
                 {
 
                     nStartCol = aExtendMergeRange.aStart.Col();
                     nEndCol = aExtendMergeRange.aEnd.Col();
-                    if( eCmd == DEL_CELLSLEFT )
+                    if( eCmd == DelCellCmd::CellsLeft )
                     {
                         nEndRow = aExtendMergeRange.aEnd.Row();
                         bNeedRefresh = true;
@@ -2460,7 +2460,7 @@ bool ScDocFunc::DeleteCells( const ScRange& rRange, const ScMarkData* pTabMark,
         // so it's no longer necessary to copy more than the deleted range into pUndoDoc.
 
         pUndoDoc = new ScDocument( SCDOCMODE_UNDO );
-        pUndoDoc->InitUndo( &rDoc, 0, nTabCount-1, (eCmd==DEL_DELCOLS), (eCmd==DEL_DELROWS) );
+        pUndoDoc->InitUndo( &rDoc, 0, nTabCount-1, (eCmd==DelCellCmd::Cols), (eCmd==DelCellCmd::Rows) );
         itr = aMark.begin();
         for (; itr != itrEnd && *itr < nTabCount; ++itr)
         {
@@ -2491,22 +2491,22 @@ bool ScDocFunc::DeleteCells( const ScRange& rRange, const ScMarkData* pTabMark,
     bool bUndoOutline = false;
     switch (eCmd)
     {
-        case DEL_CELLSUP:
+        case DelCellCmd::CellsUp:
             rDoc.DeleteRow( nStartCol, 0, nEndCol, MAXTAB, nStartRow, static_cast<SCSIZE>(nEndRow-nStartRow+1), pRefUndoDoc, nullptr, &aFullMark );
             nPaintEndRow = MAXROW;
             break;
-        case DEL_DELROWS:
+        case DelCellCmd::Rows:
             rDoc.DeleteRow( 0, 0, MAXCOL, MAXTAB, nStartRow, static_cast<SCSIZE>(nEndRow-nStartRow+1), pRefUndoDoc, &bUndoOutline, &aFullMark );
             nPaintStartCol = 0;
             nPaintEndCol = MAXCOL;
             nPaintEndRow = MAXROW;
             nPaintFlags |= PaintPartFlags::Left;
             break;
-        case DEL_CELLSLEFT:
+        case DelCellCmd::CellsLeft:
             rDoc.DeleteCol( nStartRow, 0, nEndRow, MAXTAB, nStartCol, static_cast<SCSIZE>(nEndCol-nStartCol+1), pRefUndoDoc, nullptr, &aFullMark );
             nPaintEndCol = MAXCOL;
             break;
-        case DEL_DELCOLS:
+        case DelCellCmd::Cols:
             rDoc.DeleteCol( 0, 0, MAXROW, MAXTAB, nStartCol, static_cast<SCSIZE>(nEndCol-nStartCol+1), pRefUndoDoc, &bUndoOutline, &aFullMark );
             nPaintStartRow = 0;
             nPaintEndRow = MAXROW;
@@ -2570,7 +2570,7 @@ bool ScDocFunc::DeleteCells( const ScRange& rRange, const ScMarkData* pTabMark,
 
         long nDecreaseRowCount = 0;
         long nDecreaseColCount = 0;
-        if( eCmd == DEL_CELLSUP || eCmd == DEL_DELROWS )
+        if( eCmd == DelCellCmd::CellsUp || eCmd == DelCellCmd::Rows )
         {
             if( nStartRow >= aRange.aStart.Row() && nStartRow <= aRange.aEnd.Row() && nEndRow>= aRange.aStart.Row() && nEndRow <= aRange.aEnd.Row() )
                 nDecreaseRowCount = nEndRow-nStartRow+1;
@@ -2579,7 +2579,7 @@ bool ScDocFunc::DeleteCells( const ScRange& rRange, const ScMarkData* pTabMark,
             else if( nStartRow >= aRange.aStart.Row() && nStartRow >= aRange.aEnd.Row() && nEndRow>= aRange.aStart.Row() && nEndRow <= aRange.aEnd.Row() )
                 nDecreaseRowCount = aRange.aEnd.Row()-nEndRow+1;
         }
-        else if( eCmd == DEL_CELLSLEFT || eCmd == DEL_DELCOLS )
+        else if( eCmd == DelCellCmd::CellsLeft || eCmd == DelCellCmd::Cols )
         {
             if( nStartCol >= aRange.aStart.Col() && nStartCol <= aRange.aEnd.Col() && nEndCol>= aRange.aStart.Col() && nEndCol <= aRange.aEnd.Col() )
                 nDecreaseColCount = nEndCol-nStartCol+1;
@@ -2591,12 +2591,12 @@ bool ScDocFunc::DeleteCells( const ScRange& rRange, const ScMarkData* pTabMark,
 
         switch (eCmd)
         {
-            case DEL_CELLSUP:
-            case DEL_DELROWS:
+            case DelCellCmd::CellsUp:
+            case DelCellCmd::Rows:
                 aRange.aEnd.SetRow(static_cast<SCCOL>( aRange.aEnd.Row()-nDecreaseRowCount));
                 break;
-            case DEL_CELLSLEFT:
-            case DEL_DELCOLS:
+            case DelCellCmd::CellsLeft:
+            case DelCellCmd::Cols:
                 aRange.aEnd.SetCol(static_cast<SCCOL>( aRange.aEnd.Col()-nDecreaseColCount));
                 break;
             default:
@@ -2619,9 +2619,9 @@ bool ScDocFunc::DeleteCells( const ScRange& rRange, const ScMarkData* pTabMark,
         // #i51445# old merge flag attributes must be deleted also for single cells,
         // not only for whole columns/rows
 
-        if ( eCmd==DEL_DELCOLS || eCmd==DEL_CELLSLEFT )
+        if ( eCmd==DelCellCmd::Cols || eCmd==DelCellCmd::CellsLeft )
             nMergeTestEndCol = MAXCOL;
-        if ( eCmd==DEL_DELROWS || eCmd==DEL_CELLSUP )
+        if ( eCmd==DelCellCmd::Rows || eCmd==DelCellCmd::CellsUp )
             nMergeTestEndRow = MAXROW;
         ScPatternAttr aPattern( rDoc.GetPool() );
         aPattern.GetItemSet().Put( ScMergeFlagAttr() );
@@ -2648,7 +2648,7 @@ bool ScDocFunc::DeleteCells( const ScRange& rRange, const ScMarkData* pTabMark,
     {
         rDoc.SetDrawPageSize(*itr);
 
-        if ( eCmd == DEL_DELCOLS || eCmd == DEL_DELROWS )
+        if ( eCmd == DelCellCmd::Cols || eCmd == DelCellCmd::Rows )
             rDoc.UpdatePageBreaks( *itr );
 
         rDocShell.UpdatePaintExt( nExtFlags, nPaintStartCol, nPaintStartRow, *itr, nPaintEndCol, nPaintEndRow, *itr );
@@ -2659,7 +2659,7 @@ bool ScDocFunc::DeleteCells( const ScRange& rRange, const ScMarkData* pTabMark,
             nScenarioCount ++;
 
         //  delete entire rows: do not adjust
-        if ( eCmd == DEL_DELROWS || !AdjustRowHeight(ScRange( 0, nPaintStartRow, *itr, MAXCOL, nPaintEndRow, *itr+nScenarioCount )) )
+        if ( eCmd == DelCellCmd::Rows || !AdjustRowHeight(ScRange( 0, nPaintStartRow, *itr, MAXCOL, nPaintEndRow, *itr+nScenarioCount )) )
             rDocShell.PostPaint( nPaintStartCol, nPaintStartRow, *itr, nPaintEndCol, nPaintEndRow, *itr+nScenarioCount, nPaintFlags,  nExtFlags );
         else
         {
@@ -2676,11 +2676,11 @@ bool ScDocFunc::DeleteCells( const ScRange& rRange, const ScMarkData* pTabMark,
     ScTabViewShell* pViewSh = rDocShell.GetBestViewShell();
     if (pViewSh)
     {
-        if (eCmd == DEL_DELCOLS)
+        if (eCmd == DelCellCmd::Cols)
         {
             pViewSh->OnLOKInsertDeleteColumn(rRange.aStart.Col(), -1);
         }
-        if (eCmd == DEL_DELROWS)
+        if (eCmd == DelCellCmd::Rows)
         {
             pViewSh->OnLOKInsertDeleteRow(rRange.aStart.Row(), -1);
         }
diff --git a/sc/source/ui/docshell/docsh3.cxx b/sc/source/ui/docshell/docsh3.cxx
index 4ec58646fc21..d4893d627285 100644
--- a/sc/source/ui/docshell/docsh3.cxx
+++ b/sc/source/ui/docshell/docsh3.cxx
@@ -1031,7 +1031,7 @@ void ScDocShell::MergeDocument( ScDocument& rOtherDoc, bool bShared, bool bCheck
                             if ( pDel->IsTopDelete() )
                             {
                                 aSourceRange = pDel->GetOverAllRange().MakeRange();
-                                (void)GetDocFunc().DeleteCells( aSourceRange, nullptr, DEL_DELROWS, false );
+                                (void)GetDocFunc().DeleteCells( aSourceRange, nullptr, DelCellCmd::Rows, false );
 
                                 // #i101099# [Collaboration] Changes are not correctly shown
                                 if ( bShared )
@@ -1051,7 +1051,7 @@ void ScDocShell::MergeDocument( ScDocument& rOtherDoc, bool bShared, bool bCheck
                             if ( pDel->IsTopDelete() && !pDel->IsTabDeleteCol() )
                             {   // deleted table contains deleted cols, which are not
                                 aSourceRange = pDel->GetOverAllRange().MakeRange();
-                                (void)GetDocFunc().DeleteCells( aSourceRange, nullptr, DEL_DELCOLS, false );
+                                (void)GetDocFunc().DeleteCells( aSourceRange, nullptr, DelCellCmd::Cols, false );
                             }
                         }
                         break;
diff --git a/sc/source/ui/miscdlgs/delcldlg.cxx b/sc/source/ui/miscdlgs/delcldlg.cxx
index 7ac05e33f37e..07a3ac7d0f51 100644
--- a/sc/source/ui/miscdlgs/delcldlg.cxx
+++ b/sc/source/ui/miscdlgs/delcldlg.cxx
@@ -74,27 +74,27 @@ ScDeleteCellDlg::~ScDeleteCellDlg()
 
 DelCellCmd ScDeleteCellDlg::GetDelCellCmd() const
 {
-    DelCellCmd nReturn = DEL_NONE;
+    DelCellCmd nReturn = DelCellCmd::NONE;
 
     if ( m_xBtnCellsUp->get_active()   )
     {
         nDelItemChecked=0;
-        nReturn = DEL_CELLSUP;
+        nReturn = DelCellCmd::CellsUp;
     }
     else if ( m_xBtnCellsLeft->get_active() )
     {
         nDelItemChecked=1;
-        nReturn = DEL_CELLSLEFT;
+        nReturn = DelCellCmd::CellsLeft;
     }
     else if ( m_xBtnDelRows->get_active()   )
     {
         nDelItemChecked=2;
-        nReturn = DEL_DELROWS;
+        nReturn = DelCellCmd::Rows;
     }
     else if ( m_xBtnDelCols->get_active()   )
     {
         nDelItemChecked=3;
-        nReturn = DEL_DELCOLS;
+        nReturn = DelCellCmd::Cols;
     }
 
     return nReturn;
diff --git a/sc/source/ui/undo/undoblk.cxx b/sc/source/ui/undo/undoblk.cxx
index 6d96cdaeccaf..dbdfbbe35805 100644
--- a/sc/source/ui/undo/undoblk.cxx
+++ b/sc/source/ui/undo/undoblk.cxx
@@ -345,13 +345,13 @@ ScUndoDeleteCells::ScUndoDeleteCells( ScDocShell* pNewDocShell,
     pScenarios( pNewScenarios ),
     eCmd( eNewCmd )
 {
-    if (eCmd == DEL_DELROWS)            // whole row?
+    if (eCmd == DelCellCmd::Rows)            // whole row?
     {
         aEffRange.aStart.SetCol(0);
         aEffRange.aEnd.SetCol(MAXCOL);
     }
 
-    if (eCmd == DEL_DELCOLS)            // whole column?
+    if (eCmd == DelCellCmd::Cols)            // whole column?
     {
         aEffRange.aStart.SetRow(0);
         aEffRange.aEnd.SetRow(MAXROW);
@@ -397,8 +397,8 @@ void ScUndoDeleteCells::DoChange( const bool bUndo )
 
     switch (eCmd)
     {
-        case DEL_DELROWS:
-        case DEL_CELLSUP:
+        case DelCellCmd::Rows:
+        case DelCellCmd::CellsUp:
             for( i=0; i<nCount; i++ )
             {
                 if (bUndo)
@@ -415,8 +415,8 @@ void ScUndoDeleteCells::DoChange( const bool bUndo )
                 }
             }
             break;
-        case DEL_DELCOLS:
-        case DEL_CELLSLEFT:
+        case DelCellCmd::Cols:
+        case DelCellCmd::CellsLeft:
             for( i=0; i<nCount; i++ )
             {
                 if (bUndo)
@@ -447,7 +447,7 @@ void ScUndoDeleteCells::DoChange( const bool bUndo )
     }
 
     ScRange aWorkRange( aEffRange );
-    if ( eCmd == DEL_CELLSLEFT )        // only "shift left" requires refresh of the moved area
+    if ( eCmd == DelCellCmd::CellsLeft )        // only "shift left" requires refresh of the moved area
         aWorkRange.aEnd.SetCol(MAXCOL);
 
     for( i=0; i<nCount; i++ )
@@ -460,9 +460,9 @@ void ScUndoDeleteCells::DoChange( const bool bUndo )
 
             if ( !bUndo )
             {
-                if ( eCmd==DEL_DELCOLS || eCmd==DEL_CELLSLEFT )
+                if ( eCmd==DelCellCmd::Cols || eCmd==DelCellCmd::CellsLeft )
                     aWorkRange.aEnd.SetCol(MAXCOL);
-                if ( eCmd==DEL_DELROWS || eCmd==DEL_CELLSUP )
+                if ( eCmd==DelCellCmd::Rows || eCmd==DelCellCmd::CellsUp )
                     aWorkRange.aEnd.SetRow(MAXROW);
                 ScMarkData aMarkData;
                 aMarkData.SelectOneTable( aWorkRange.aStart.Tab() );
@@ -483,11 +483,11 @@ void ScUndoDeleteCells::DoChange( const bool bUndo )
     PaintPartFlags nPaint = PaintPartFlags::Grid;
     switch (eCmd)
     {
-        case DEL_DELROWS:
+        case DelCellCmd::Rows:
             nPaint |= PaintPartFlags::Left;
             aWorkRange.aEnd.SetRow(MAXROW);
             break;
-        case DEL_CELLSUP:
+        case DelCellCmd::CellsUp:
             for( i=0; i<nCount; i++ )
             {
                 aWorkRange.aEnd.SetRow(MAXROW);
@@ -499,10 +499,10 @@ void ScUndoDeleteCells::DoChange( const bool bUndo )
                 }
             }
             break;
-        case DEL_DELCOLS:
+        case DelCellCmd::Cols:
             nPaint |= PaintPartFlags::Top;                // top bar
             SAL_FALLTHROUGH;
-        case DEL_CELLSLEFT:
+        case DelCellCmd::CellsLeft:
             for( i=0; i<nCount; i++ )
             {
                 aWorkRange.aEnd.SetCol(MAXCOL);     // to the far right
@@ -534,10 +534,10 @@ void ScUndoDeleteCells::DoChange( const bool bUndo )
     {
         if (comphelper::LibreOfficeKit::isActive())
         {
-            if (eCmd == DEL_DELCOLS || eCmd == DEL_CELLSLEFT)
+            if (eCmd == DelCellCmd::Cols || eCmd == DelCellCmd::CellsLeft)
                 ScTabViewShell::notifyAllViewsHeaderInvalidation(COLUMN_HEADER,  pViewShell->GetViewData().GetTabNo());
 
-            if (eCmd == DEL_DELROWS || eCmd == DEL_CELLSUP)
+            if (eCmd == DelCellCmd::Rows || eCmd == DelCellCmd::CellsUp)
                 ScTabViewShell::notifyAllViewsHeaderInvalidation(ROW_HEADER,  pViewShell->GetViewData().GetTabNo());
         }
 
@@ -767,7 +767,7 @@ void ScUndoDeleteMulti::Repeat(SfxRepeatTarget& rTarget)
 {
     // if single selection
     if (dynamic_cast<const ScTabViewTarget*>( &rTarget) !=  nullptr)
-        static_cast<ScTabViewTarget&>(rTarget).GetViewShell()->DeleteCells( DEL_DELROWS );
+        static_cast<ScTabViewTarget&>(rTarget).GetViewShell()->DeleteCells( DelCellCmd::Rows );
 }
 
 bool ScUndoDeleteMulti::CanRepeat(SfxRepeatTarget& rTarget) const
diff --git a/sc/source/ui/unoobj/cellsuno.cxx b/sc/source/ui/unoobj/cellsuno.cxx
index c4cdf2f8b43d..8448dc6f1c94 100644
--- a/sc/source/ui/unoobj/cellsuno.cxx
+++ b/sc/source/ui/unoobj/cellsuno.cxx
@@ -7128,14 +7128,14 @@ void SAL_CALL ScTableSheetObj::removeRange( const table::CellRangeAddress& rRang
     if ( pDocSh )
     {
         bool bDo = true;
-        DelCellCmd eCmd = DEL_NONE;
+        DelCellCmd eCmd = DelCellCmd::NONE;
         switch (nMode)
         {
             case sheet::CellDeleteMode_NONE:     bDo = false;           break;
-            case sheet::CellDeleteMode_UP:       eCmd = DEL_CELLSUP;    break;
-            case sheet::CellDeleteMode_LEFT:     eCmd = DEL_CELLSLEFT;  break;
-            case sheet::CellDeleteMode_ROWS:     eCmd = DEL_DELROWS;    break;
-            case sheet::CellDeleteMode_COLUMNS:  eCmd = DEL_DELCOLS;    break;
+            case sheet::CellDeleteMode_UP:       eCmd = DelCellCmd::CellsUp;    break;
+            case sheet::CellDeleteMode_LEFT:     eCmd = DelCellCmd::CellsLeft;  break;
+            case sheet::CellDeleteMode_ROWS:     eCmd = DelCellCmd::Rows;    break;
+            case sheet::CellDeleteMode_COLUMNS:  eCmd = DelCellCmd::Cols;    break;
             default:
                 OSL_FAIL("deleteCells: wrong mode");
                 bDo = false;
diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx
index c0fcc48264e1..59f699d3a6ff 100644
--- a/sc/source/ui/unoobj/docuno.cxx
+++ b/sc/source/ui/unoobj/docuno.cxx
@@ -3828,7 +3828,7 @@ void SAL_CALL ScTableColumnsObj::removeByIndex( sal_Int32 nIndex, sal_Int32 nCou
     {
         ScRange aRange( static_cast<SCCOL>(nStartCol+nIndex), 0, nTab,
                         static_cast<SCCOL>(nStartCol+nIndex+nCount-1), MAXROW, nTab );
-        bDone = pDocShell->GetDocFunc().DeleteCells( aRange, nullptr, DEL_DELCOLS, true );
+        bDone = pDocShell->GetDocFunc().DeleteCells( aRange, nullptr, DelCellCmd::Cols, true );
     }
     if (!bDone)
         throw uno::RuntimeException();      // no other exceptions specified
@@ -4067,7 +4067,7 @@ void SAL_CALL ScTableRowsObj::removeByIndex( sal_Int32 nIndex, sal_Int32 nCount
     {
         ScRange aRange( 0, static_cast<SCROW>(nStartRow+nIndex), nTab,
                         MAXCOL, static_cast<SCROW>(nStartRow+nIndex+nCount-1), nTab );
-        bDone = pDocShell->GetDocFunc().DeleteCells( aRange, nullptr, DEL_DELROWS, true );
+        bDone = pDocShell->GetDocFunc().DeleteCells( aRange, nullptr, DelCellCmd::Rows, true );
     }
     if (!bDone)
         throw uno::RuntimeException();      // no other exceptions specified
diff --git a/sc/source/ui/view/cellsh1.cxx b/sc/source/ui/view/cellsh1.cxx
index d48b2babefee..9da11af442e3 100644
--- a/sc/source/ui/view/cellsh1.cxx
+++ b/sc/source/ui/view/cellsh1.cxx
@@ -247,12 +247,12 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
             break;
 
         case SID_DEL_ROWS:
-            pTabViewShell->DeleteCells( DEL_DELROWS );
+            pTabViewShell->DeleteCells( DelCellCmd::Rows );
             rReq.Done();
             break;
 
         case SID_DEL_COLS:
-            pTabViewShell->DeleteCells( DEL_DELCOLS );
+            pTabViewShell->DeleteCells( DelCellCmd::Cols );
             rReq.Done();
             break;
 
@@ -327,7 +327,7 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
 
         case FID_DELETE_CELL:
             {
-                DelCellCmd eCmd = DEL_NONE;
+                DelCellCmd eCmd = DelCellCmd::NONE;
 
                 if ( pReqArgs )
                 {
@@ -340,19 +340,19 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
                     {
                         switch( aFlags[0] )
                         {
-                            case 'U': eCmd = DEL_CELLSUP ;break;
-                            case 'L': eCmd = DEL_CELLSLEFT ;break;
-                            case 'R': eCmd = DEL_DELROWS ;break;
-                            case 'C': eCmd = DEL_DELCOLS ;break;
+                            case 'U': eCmd = DelCellCmd::CellsUp ;break;
+                            case 'L': eCmd = DelCellCmd::CellsLeft ;break;
+                            case 'R': eCmd = DelCellCmd::Rows ;break;
+                            case 'C': eCmd = DelCellCmd::Cols ;break;
                         }
                     }
                 }
                 else
                 {
                     if ( GetViewData()->SimpleColMarked() )
-                        eCmd = DEL_DELCOLS;
+                        eCmd = DelCellCmd::Cols;
                     else if ( GetViewData()->SimpleRowMarked() )
-                        eCmd = DEL_DELROWS;
+                        eCmd = DelCellCmd::Rows;
                     else
                     {
                         ScRange aRange;
@@ -372,7 +372,7 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
                     }
                 }
 
-                if (eCmd != DEL_NONE )
+                if (eCmd != DelCellCmd::NONE )
                 {
                     pTabViewShell->DeleteCells( eCmd );
 
@@ -382,10 +382,10 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
 
                         switch( eCmd )
                         {
-                            case DEL_CELLSUP: aParam = "U"; break;
-                            case DEL_CELLSLEFT: aParam = "L"; break;
-                            case DEL_DELROWS: aParam = "R"; break;
-                            case DEL_DELCOLS: aParam = "C"; break;
+                            case DelCellCmd::CellsUp: aParam = "U"; break;
+                            case DelCellCmd::CellsLeft: aParam = "L"; break;
+                            case DelCellCmd::Rows: aParam = "R"; break;
+                            case DelCellCmd::Cols: aParam = "C"; break;
                             default:
                             {
                                 // added to avoid warnings
diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx
index 5cc56686897c..a24ce844c5ba 100644
--- a/sc/source/ui/view/gridwin.cxx
+++ b/sc/source/ui/view/gridwin.cxx
@@ -4039,29 +4039,29 @@ sal_Int8 ScGridWindow::DropTransferObj( ScTransferObj* pTransObj, SCCOL nDestPos
 
                 if ( bDone && meDragInsertMode != INS_NONE && bIsMove && nThisTab == nSourceTab )
                 {
-                    DelCellCmd eCmd = DEL_NONE;
+                    DelCellCmd eCmd = DelCellCmd::NONE;
                     if ( meDragInsertMode == INS_CELLSDOWN )
                     {
-                        eCmd = DEL_CELLSUP;
+                        eCmd = DelCellCmd::CellsUp;
                     }
                     else if ( meDragInsertMode == INS_CELLSRIGHT )
                     {
-                        eCmd = DEL_CELLSLEFT;
+                        eCmd = DelCellCmd::CellsLeft;
                     }
 
-                    if ( ( eCmd == DEL_CELLSUP  && nDestPosX == aSource.aStart.Col() ) ||
-                         ( eCmd == DEL_CELLSLEFT && nDestPosY == aSource.aStart.Row() ) )
+                    if ( ( eCmd == DelCellCmd::CellsUp  && nDestPosX == aSource.aStart.Col() ) ||
+                         ( eCmd == DelCellCmd::CellsLeft && nDestPosY == aSource.aStart.Row() ) )
                     {
                         // call with bApi = sal_True to avoid error messages in drop handler
                         bDone = pDocSh->GetDocFunc().DeleteCells( aSource, nullptr, eCmd, true /*bApi*/ );
                         if ( bDone )
                         {
-                            if ( eCmd == DEL_CELLSUP && nDestPosY > aSource.aEnd.Row() )
+                            if ( eCmd == DelCellCmd::CellsUp && nDestPosY > aSource.aEnd.Row() )
                             {
                                 ScRange aErrorRange( ScAddress::UNINITIALIZED );
                                 bDone = aDest.Move( 0, -nSizeY, 0, aErrorRange, pThisDoc );
                             }
-                            else if ( eCmd == DEL_CELLSLEFT && nDestPosX > aSource.aEnd.Col() )
+                            else if ( eCmd == DelCellCmd::CellsLeft && nDestPosX > aSource.aEnd.Col() )
                             {
                                 ScRange aErrorRange( ScAddress::UNINITIALIZED );
                                 bDone = aDest.Move( -nSizeX, 0, 0, aErrorRange, pThisDoc );
diff --git a/sc/source/ui/view/viewfunc.cxx b/sc/source/ui/view/viewfunc.cxx
index a9cb736e67bd..1f1e5407318c 100644
--- a/sc/source/ui/view/viewfunc.cxx
+++ b/sc/source/ui/view/viewfunc.cxx
@@ -1650,11 +1650,11 @@ void ScViewFunc::DeleteCells( DelCellCmd eCmd )
 
 #if HAVE_FEATURE_MULTIUSER_ENVIRONMENT
         // #i94841# [Collaboration] if deleting rows is rejected, the content is sometimes wrong
-        if ( pDocSh->IsDocShared() && ( eCmd == DEL_DELROWS || eCmd == DEL_DELCOLS ) )
+        if ( pDocSh->IsDocShared() && ( eCmd == DelCellCmd::Rows || eCmd == DelCellCmd::Cols ) )
         {
             ScRange aDelRange( aRange.aStart );
             SCCOLROW nCount = 0;
-            if ( eCmd == DEL_DELROWS )
+            if ( eCmd == DelCellCmd::Rows )
             {
                 nCount = sal::static_int_cast< SCCOLROW >( aRange.aEnd.Row() - aRange.aStart.Row() + 1 );
             }
@@ -1678,9 +1678,9 @@ void ScViewFunc::DeleteCells( DelCellCmd eCmd )
         CellContentChanged();
         ResetAutoSpell();
 
-        if ( eCmd == DEL_DELROWS || eCmd == DEL_DELCOLS )
+        if ( eCmd == DelCellCmd::Rows || eCmd == DelCellCmd::Cols )
         {
-            OUString aOperation = ( eCmd == DEL_DELROWS) ?
+            OUString aOperation = ( eCmd == DelCellCmd::Rows) ?
               OUString("delete-rows"):
               OUString("delete-columns");
             HelperNotifyChanges::NotifyIfChangesListeners(*pDocSh, aRange, aOperation);
@@ -1689,7 +1689,7 @@ void ScViewFunc::DeleteCells( DelCellCmd eCmd )
         //  put cursor directly behind deleted range
         SCCOL nCurX = GetViewData().GetCurX();
         SCROW nCurY = GetViewData().GetCurY();
-        if ( eCmd==DEL_CELLSLEFT || eCmd==DEL_DELCOLS )
+        if ( eCmd==DelCellCmd::CellsLeft || eCmd==DelCellCmd::Cols )
             nCurX = aRange.aStart.Col();
         else
             nCurY = aRange.aStart.Row();
@@ -1697,18 +1697,18 @@ void ScViewFunc::DeleteCells( DelCellCmd eCmd )
 
         if (comphelper::LibreOfficeKit::isActive())
         {
-            if (eCmd == DEL_DELCOLS)
+            if (eCmd == DelCellCmd::Cols)
                 ScTabViewShell::notifyAllViewsHeaderInvalidation(COLUMN_HEADER, GetViewData().GetTabNo());
 
-            if (eCmd == DEL_DELROWS)
+            if (eCmd == DelCellCmd::Rows)
                 ScTabViewShell::notifyAllViewsHeaderInvalidation(ROW_HEADER, GetViewData().GetTabNo());
         }
     }
     else
     {
-        if (eCmd == DEL_DELCOLS)
+        if (eCmd == DelCellCmd::Cols)
             DeleteMulti( false );
-        else if (eCmd == DEL_DELROWS)
+        else if (eCmd == DelCellCmd::Rows)
             DeleteMulti( true );
         else
             ErrorMessage(STR_NOMULTISELECT);


More information about the Libreoffice-commits mailing list