summaryrefslogtreecommitdiff
path: root/sc/source
diff options
context:
space:
mode:
Diffstat (limited to 'sc/source')
-rw-r--r--sc/source/ui/docshell/docfunc.cxx74
-rw-r--r--sc/source/ui/docshell/docsh3.cxx4
-rw-r--r--sc/source/ui/miscdlgs/delcldlg.cxx10
-rw-r--r--sc/source/ui/undo/undoblk.cxx32
-rw-r--r--sc/source/ui/unoobj/cellsuno.cxx10
-rw-r--r--sc/source/ui/unoobj/docuno.cxx4
-rw-r--r--sc/source/ui/view/cellsh1.cxx28
-rw-r--r--sc/source/ui/view/gridwin.cxx14
-rw-r--r--sc/source/ui/view/viewfunc.cxx18
9 files changed, 97 insertions, 97 deletions
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);