[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.2' - include/svx officecfg/registry sd/sdi sd/source svx/sdi svx/source

Justin Luth (via logerrit) logerrit at kemper.freedesktop.org
Mon Aug 10 19:15:36 UTC 2020


 include/svx/svxids.hrc                                                   |    3 +
 officecfg/registry/data/org/openoffice/Office/UI/DrawImpressCommands.xcu |    8 ++++
 sd/sdi/tables.sdi                                                        |    5 ++
 sd/source/ui/table/tableobjectbar.cxx                                    |    1 
 svx/sdi/svx.sdi                                                          |   17 ++++++++++
 svx/source/table/tablecontroller.cxx                                     |   16 ++++++++-
 6 files changed, 47 insertions(+), 3 deletions(-)

New commits:
commit df4c1556478bf0cbe1f6c754e22d137a79a9b0d5
Author:     Justin Luth <justin_luth at sil.org>
AuthorDate: Fri Jul 3 11:45:24 2020 +0300
Commit:     Jan Holesovsky <kendy at collabora.com>
CommitDate: Mon Aug 10 21:15:04 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>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100205
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Jan Holesovsky <kendy at collabora.com>

diff --git a/include/svx/svxids.hrc b/include/svx/svxids.hrc
index a9960d216b4e..0ffe72e3bb30 100644
--- a/include/svx/svxids.hrc
+++ b/include/svx/svxids.hrc
@@ -985,7 +985,8 @@ class SfxStringItem;
 #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 36a275b6268c..6390f895c2d9 100644
--- a/officecfg/registry/data/org/openoffice/Office/UI/DrawImpressCommands.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/UI/DrawImpressCommands.xcu
@@ -1986,6 +1986,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 9b01ee63a290..54687d02d174 100644
--- a/sd/source/ui/table/tableobjectbar.cxx
+++ b/sd/source/ui/table/tableobjectbar.cxx
@@ -191,6 +191,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:
diff --git a/svx/sdi/svx.sdi b/svx/sdi/svx.sdi
index f077e5abaddb..36fe1d2e528d 100644
--- a/svx/sdi/svx.sdi
+++ b/svx/sdi/svx.sdi
@@ -11108,6 +11108,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 d119367632a6..43c74993961b 100644
--- a/svx/source/table/tablecontroller.cxx
+++ b/svx/source/table/tablecontroller.cxx
@@ -468,6 +468,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);
@@ -787,10 +791,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 );
@@ -968,6 +979,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