[Libreoffice-commits] core.git: include/svx officecfg/registry sd/sdi sd/source sd/uiconfig svx/sdi svx/source

Justin Luth (via logerrit) logerrit at kemper.freedesktop.org
Tue Jul 7 20:22:12 UTC 2020


 include/svx/svxids.hrc                                                   |    6 ++-
 officecfg/registry/data/org/openoffice/Office/UI/DrawImpressCommands.xcu |    8 ++++
 sd/sdi/tables.sdi                                                        |    5 ++
 sd/source/ui/table/tableobjectbar.cxx                                    |    2 +
 sd/uiconfig/sdraw/menubar/menubar.xml                                    |    1 
 sd/uiconfig/sdraw/toolbar/tableobjectbar.xml                             |    1 
 sd/uiconfig/simpress/menubar/menubar.xml                                 |    1 
 sd/uiconfig/simpress/toolbar/tableobjectbar.xml                          |    1 
 svx/sdi/svx.sdi                                                          |   17 ++++++++++
 svx/source/table/tablecontroller.cxx                                     |   16 ++++++++-
 10 files changed, 54 insertions(+), 4 deletions(-)

New commits:
commit 1e602c9c3f8dafd1e47d50c9670846fc1172700d
Author:     Justin Luth <justin_luth at sil.org>
AuthorDate: Fri Jul 3 11:45:24 2020 +0300
Commit:     Maxim Monastirsky <momonasmon at gmail.com>
CommitDate: Tue Jul 7 22:21:26 2020 +0200

    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 at gmail.com>
    Reviewed-by: Justin Luth <justin_luth at sil.org>
    Reviewed-by: Maxim Monastirsky <momonasmon at gmail.com>

diff --git a/include/svx/svxids.hrc b/include/svx/svxids.hrc
index 9081fe0f36f6..ead0bd87d48c 100644
--- a/include/svx/svxids.hrc
+++ b/include/svx/svxids.hrc
@@ -852,6 +852,7 @@ class SvxSetItem;
 #define SID_SHRINK_FONT_SIZE                            ( SID_SVX_START + 1043 )
 // color subtoolbar on graphictoolbar
 #define SID_COLOR_SETTINGS                              ( SID_SVX_START + 1044 )
+
 #define SID_FM_FORM_DESIGN_TOOLS                        ( SID_SVX_START + 1046 )
 #define SID_DRAWTBX_CS_BASIC                            ( SID_SVX_START + 1047 )
 #define SID_DRAWTBX_CS_SYMBOL                           ( SID_SVX_START + 1048 )
@@ -898,7 +899,7 @@ class SvxSetItem;
 #define SID_TABLE_STYLE_SETTINGS                        ( SID_SVX_START + 1089 )
 #define SID_CHAR_DLG_PREVIEW_STRING                     ( SID_SVX_START + 1090 )
 #define SID_RECHECK_DOCUMENT                            ( SID_SVX_START + 1091 )
-
+// 1092 is used out of order below
 #define SID_OBJECT_MIRROR                               ( SID_SVX_START + 1093 )
 
 #define SID_DELETE_POSTIT                               ( SID_SVX_START + 1094 )
@@ -994,7 +995,8 @@ class SvxSetItem;
 #define SID_EDIT_SIGNATURELINE                          ( SID_SVX_START + 1174 )
 #define SID_SIGN_SIGNATURELINE                          ( SID_SVX_START + 1175 )
 #define SID_MEASURE_DLG                                 ( SID_SVX_START + 1176 )
-
+// free slots - available for use
+#define SID_TABLE_DELETE_TABLE                          ( SID_SVX_START + 1184 )
 #define SID_TABLE_MINIMAL_COLUMN_WIDTH                  ( SID_SVX_START + 1185 )
 #define SID_TABLE_MINIMAL_ROW_HEIGHT                    ( SID_SVX_START + 1186 )
 #define SID_TABLE_OPTIMAL_COLUMN_WIDTH                  ( SID_SVX_START + 1187 )
diff --git a/officecfg/registry/data/org/openoffice/Office/UI/DrawImpressCommands.xcu b/officecfg/registry/data/org/openoffice/Office/UI/DrawImpressCommands.xcu
index 0a0803d950cb..542b1208f00e 100644
--- a/officecfg/registry/data/org/openoffice/Office/UI/DrawImpressCommands.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/UI/DrawImpressCommands.xcu
@@ -2042,6 +2042,14 @@
           <value>1</value>
         </prop>
       </node>
+      <node oor:name=".uno:DeleteTable" oor:op="replace">
+        <prop oor:name="Label" oor:type="xs:string">
+          <value xml:lang="en-US">Delete Table</value>
+        </prop>
+        <prop oor:name="Properties" oor:type="xs:int">
+          <value>1</value>
+        </prop>
+      </node>
       <node oor:name=".uno:SelectTable" oor:op="replace">
         <prop oor:name="Label" oor:type="xs:string">
           <value xml:lang="en-US">Select Table</value>
diff --git a/sd/sdi/tables.sdi b/sd/sdi/tables.sdi
index a5918af490db..9943ce719e29 100644
--- a/sd/sdi/tables.sdi
+++ b/sd/sdi/tables.sdi
@@ -113,6 +113,11 @@ shell TableObjectBar
         ExecMethod = Execute;
         StateMethod = GetState;
     ]
+    SID_TABLE_DELETE_TABLE
+    [
+        ExecMethod = Execute;
+        StateMethod = GetState;
+    ]
     SID_TABLE_SELECT_ALL
     [
         ExecMethod = Execute;
diff --git a/sd/source/ui/table/tableobjectbar.cxx b/sd/source/ui/table/tableobjectbar.cxx
index 3c4c59ce2b3d..846d5fb6bbfc 100644
--- a/sd/source/ui/table/tableobjectbar.cxx
+++ b/sd/source/ui/table/tableobjectbar.cxx
@@ -180,6 +180,7 @@ void TableObjectBar::Execute( SfxRequest& rReq )
     case SID_OPTIMIZE_TABLE:
     case SID_TABLE_DELETE_ROW:
     case SID_TABLE_DELETE_COL:
+    case SID_TABLE_DELETE_TABLE:
     case SID_FORMAT_TABLE_DLG:
     case SID_TABLE_INSERT_ROW:
     case SID_TABLE_INSERT_COL:
@@ -187,6 +188,7 @@ void TableObjectBar::Execute( SfxRequest& rReq )
         pView->AdjustMarkHdl();
         pBindings->Invalidate( SID_TABLE_DELETE_ROW );
         pBindings->Invalidate( SID_TABLE_DELETE_COL );
+        pBindings->Invalidate( SID_TABLE_DELETE_TABLE );
         pBindings->Invalidate( SID_FRAME_LINESTYLE );
         pBindings->Invalidate( SID_FRAME_LINECOLOR );
         pBindings->Invalidate( SID_ATTR_BORDER );
diff --git a/sd/uiconfig/sdraw/menubar/menubar.xml b/sd/uiconfig/sdraw/menubar/menubar.xml
index d65e75e60fc7..8f20bbbb1348 100644
--- a/sd/uiconfig/sdraw/menubar/menubar.xml
+++ b/sd/uiconfig/sdraw/menubar/menubar.xml
@@ -384,6 +384,7 @@
           <menu:menuitem menu:id=".uno:MergeCells"/>
           <menu:menuitem menu:id=".uno:SplitCell"/>
           <menu:menuseparator/>
+          <menu:menuitem menu:id=".uno:DeleteTable"/>
           <menu:menuitem menu:id=".uno:SelectTable"/>
           <menu:menuitem menu:id=".uno:TableDialog"/>
         </menu:menupopup>
diff --git a/sd/uiconfig/sdraw/toolbar/tableobjectbar.xml b/sd/uiconfig/sdraw/toolbar/tableobjectbar.xml
index af2c3e6bcb45..87655aafe2f5 100644
--- a/sd/uiconfig/sdraw/toolbar/tableobjectbar.xml
+++ b/sd/uiconfig/sdraw/toolbar/tableobjectbar.xml
@@ -40,6 +40,7 @@
  <toolbar:toolbaritem xlink:href=".uno:InsertColumnsAfter"/>
  <toolbar:toolbaritem xlink:href=".uno:DeleteRows"/>
  <toolbar:toolbaritem xlink:href=".uno:DeleteColumns"/>
+ <toolbar:toolbaritem xlink:href=".uno:DeleteTable"/>
  <toolbar:toolbarseparator/>
  <toolbar:toolbaritem xlink:href=".uno:SelectTable" toolbar:visible="false"/>
  <toolbar:toolbaritem xlink:href=".uno:EntireColumn" toolbar:visible="false"/>
diff --git a/sd/uiconfig/simpress/menubar/menubar.xml b/sd/uiconfig/simpress/menubar/menubar.xml
index e45735b2f667..00485727dd82 100644
--- a/sd/uiconfig/simpress/menubar/menubar.xml
+++ b/sd/uiconfig/simpress/menubar/menubar.xml
@@ -415,6 +415,7 @@
           <menu:menuitem menu:id=".uno:MergeCells"/>
           <menu:menuitem menu:id=".uno:SplitCell"/>
           <menu:menuseparator/>
+          <menu:menuitem menu:id=".uno:DeleteTable"/>
           <menu:menuitem menu:id=".uno:SelectTable"/>
           <menu:menuitem menu:id=".uno:TableDialog"/>
         </menu:menupopup>
diff --git a/sd/uiconfig/simpress/toolbar/tableobjectbar.xml b/sd/uiconfig/simpress/toolbar/tableobjectbar.xml
index af2c3e6bcb45..87655aafe2f5 100644
--- a/sd/uiconfig/simpress/toolbar/tableobjectbar.xml
+++ b/sd/uiconfig/simpress/toolbar/tableobjectbar.xml
@@ -40,6 +40,7 @@
  <toolbar:toolbaritem xlink:href=".uno:InsertColumnsAfter"/>
  <toolbar:toolbaritem xlink:href=".uno:DeleteRows"/>
  <toolbar:toolbaritem xlink:href=".uno:DeleteColumns"/>
+ <toolbar:toolbaritem xlink:href=".uno:DeleteTable"/>
  <toolbar:toolbarseparator/>
  <toolbar:toolbaritem xlink:href=".uno:SelectTable" toolbar:visible="false"/>
  <toolbar:toolbaritem xlink:href=".uno:EntireColumn" toolbar:visible="false"/>
diff --git a/svx/sdi/svx.sdi b/svx/sdi/svx.sdi
index 738d3bc671fb..b7d5283fcb86 100644
--- a/svx/sdi/svx.sdi
+++ b/svx/sdi/svx.sdi
@@ -11162,6 +11162,23 @@ SfxVoidItem DeleteColumns SID_TABLE_DELETE_COL
     GroupId = SfxGroupId::Table;
 ]
 
+SfxVoidItem DeleteTable SID_TABLE_DELETE_TABLE
+()
+[
+    AutoUpdate = FALSE,
+    FastCall = TRUE,
+    ReadOnlyDoc = FALSE,
+    Toggle = FALSE,
+    Container = FALSE,
+    RecordAbsolute = FALSE,
+    RecordPerSet;
+
+    AccelConfig = TRUE,
+    MenuConfig = TRUE,
+    ToolBoxConfig = TRUE,
+    GroupId = SfxGroupId::Table;
+]
+
 SfxVoidItem SelectTable SID_TABLE_SELECT_ALL
 ()
 [
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:


More information about the Libreoffice-commits mailing list