summaryrefslogtreecommitdiff
path: root/svx/source/table/tablecontroller.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'svx/source/table/tablecontroller.cxx')
-rw-r--r--svx/source/table/tablecontroller.cxx16
1 files changed, 14 insertions, 2 deletions
diff --git a/svx/source/table/tablecontroller.cxx b/svx/source/table/tablecontroller.cxx
index d5d0468c530f..48a73e528143 100644
--- a/svx/source/table/tablecontroller.cxx
+++ b/svx/source/table/tablecontroller.cxx
@@ -471,6 +471,10 @@ void SvxTableController::GetState( SfxItemSet& rSet )
if( !mxTable.is() || !hasSelectedCells() || (!comphelper::LibreOfficeKit::isActive() && mxTable->getColumnCount() <= 1) )
rSet.DisableItem(SID_TABLE_DELETE_COL);
break;
+ case SID_TABLE_DELETE_TABLE:
+ if( !mxTable.is() )
+ rSet.DisableItem(SID_TABLE_DELETE_TABLE);
+ break;
case SID_TABLE_MERGE_CELLS:
if( !mxTable.is() || !hasSelectedCells() )
rSet.DisableItem(SID_TABLE_MERGE_CELLS);
@@ -784,10 +788,17 @@ void SvxTableController::onInsert( sal_uInt16 nSId, const SfxItemSet* pArgs )
void SvxTableController::onDelete( sal_uInt16 nSId )
{
sdr::table::SdrTableObj* pTableObj = mxTableObj.get();
- if( !pTableObj )
+ if( !pTableObj || !mxTable.is() )
return;
- if( mxTable.is() && hasSelectedCells() )
+ if( nSId == SID_TABLE_DELETE_TABLE )
+ {
+ if( pTableObj->IsTextEditActive() )
+ mrView.SdrEndTextEdit(true);
+
+ mrView.DeleteMarkedObj();
+ }
+ else if( hasSelectedCells() )
{
CellPos aStart, aEnd;
getSelectedCells( aStart, aEnd );
@@ -969,6 +980,7 @@ void SvxTableController::Execute( SfxRequest& rReq )
break;
case SID_TABLE_DELETE_ROW:
case SID_TABLE_DELETE_COL:
+ case SID_TABLE_DELETE_TABLE:
onDelete( nSId );
break;
case SID_TABLE_SELECT_ALL: