Kaydet (Commit) d38e4b2e authored tarafından Caolán McNamara's avatar Caolán McNamara

implement undo of delete impress cell contents

Change-Id: I7aa99f3a6668e66b8d02e20b7ea1cf0862e5d760
üst 7a12d4d7
......@@ -713,5 +713,6 @@
#define STR_TABLE_STYLE (SIP_Begin + 274)
#define STR_TABLE_STYLE_SETTINGS (SIP_Begin + 275)
#define SIP_SA_CROP_MARKERS (SIP_Begin + 276)
#define STR_TABLE_DELETE_CELL_CONTENTS (SIP_Begin + 277)
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -2778,6 +2778,11 @@ String STR_TABLE_DISTRIBUTE_COLUMNS
Text [ en-US ] = "Distribute columns" ;
};
String STR_TABLE_DELETE_CELL_CONTENTS
{
Text [ en-US ] = "Delete cell contents" ;
};
String STR_TABLE_STYLE
{
Text [ en-US ] = "Table style" ;
......
......@@ -1331,6 +1331,10 @@ bool SvxTableController::DeleteMarked()
{
if( mxTable.is() )
{
const bool bUndo = mpModel && mpModel->IsUndoEnabled();
if (bUndo)
mpModel->BegUndo(ImpGetResStr(STR_TABLE_DELETE_CELL_CONTENTS));
CellPos aStart, aEnd;
getSelectedCells( aStart, aEnd );
for( sal_Int32 nRow = aStart.mnRow; nRow <= aEnd.mnRow; nRow++ )
......@@ -1338,11 +1342,18 @@ bool SvxTableController::DeleteMarked()
for( sal_Int32 nCol = aStart.mnCol; nCol <= aEnd.mnCol; nCol++ )
{
CellRef xCell( dynamic_cast< Cell* >( mxTable->getCellByPosition( nCol, nRow ).get() ) );
if( xCell.is() )
xCell->SetOutlinerParaObject( 0 );
if (xCell.is() && xCell->hasText())
{
if (bUndo)
xCell->AddUndo();
xCell->SetOutlinerParaObject(0);
}
}
}
if (bUndo)
mpModel->EndUndo();
UpdateTableShape();
return true;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment