summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2015-09-01 16:32:15 +0100
committerCaolán McNamara <caolanm@redhat.com>2015-09-01 16:32:54 +0100
commitd38e4b2ee73ad38881465f9f97eb8d8397ee98ff (patch)
tree705009b027ba64129b2dbc825841049bcfb7e647 /svx
parent7a12d4d7fde8e80774c968956f2e5ec5d30e545e (diff)
implement undo of delete impress cell contents
Change-Id: I7aa99f3a6668e66b8d02e20b7ea1cf0862e5d760
Diffstat (limited to 'svx')
-rw-r--r--svx/source/svdraw/svdstr.src5
-rw-r--r--svx/source/table/tablecontroller.cxx15
2 files changed, 18 insertions, 2 deletions
diff --git a/svx/source/svdraw/svdstr.src b/svx/source/svdraw/svdstr.src
index 6dc442028236..f790f000155d 100644
--- a/svx/source/svdraw/svdstr.src
+++ b/svx/source/svdraw/svdstr.src
@@ -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" ;
diff --git a/svx/source/table/tablecontroller.cxx b/svx/source/table/tablecontroller.cxx
index 2fbb606c4c7a..cee5e2b7dc51 100644
--- a/svx/source/table/tablecontroller.cxx
+++ b/svx/source/table/tablecontroller.cxx
@@ -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;
}