summaryrefslogtreecommitdiff
path: root/svx/source
diff options
context:
space:
mode:
authorJustin Luth <justin_luth@sil.org>2020-07-03 11:45:24 +0300
committerMaxim Monastirsky <momonasmon@gmail.com>2020-07-07 22:21:26 +0200
commit1e602c9c3f8dafd1e47d50c9670846fc1172700d (patch)
treec53f06d3c2374900b474b1f41299ee73ca30a823 /svx/source
parent71227e2306987cb8aa5fbda2943e73237674e9ba (diff)
tdf#100772 sd: add uno:DeleteTable to non-NB menus
Delete Row and Delete Column were there, but no option to delete table, so that major omission was fixed for Draw and Impress. The notebookbar looks very incomplete. Also, I didn't really understand the pop-out menu configuration, and at least in the one case there didn't seem to be a good space to add delete table. So I left the notebookbar completely alone. Change-Id: I5d6c98e3238bc545a02325edfd62f5d937ac6371 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97821 Tested-by: Jenkins Tested-by: Maxim Monastirsky <momonasmon@gmail.com> Reviewed-by: Justin Luth <justin_luth@sil.org> Reviewed-by: Maxim Monastirsky <momonasmon@gmail.com>
Diffstat (limited to 'svx/source')
-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 1264b9a2eb90..c766b7c13020 100644
--- a/svx/source/table/tablecontroller.cxx
+++ b/svx/source/table/tablecontroller.cxx
@@ -473,6 +473,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);
@@ -786,10 +790,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 );
@@ -966,6 +977,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: