[Libreoffice-commits] online.git: loleaflet/src

Pranam Lashkari (via logerrit) logerrit at kemper.freedesktop.org
Tue Jan 28 17:50:35 UTC 2020


 loleaflet/src/control/Control.RowHeader.js |   22 ++++++++++++++++++++--
 1 file changed, 20 insertions(+), 2 deletions(-)

New commits:
commit 2fb7bc633cef872fc45c8b130f4bf605b12f2e40
Author:     Pranam Lashkari <lpranam at collabora.com>
AuthorDate: Tue Jan 28 20:48:12 2020 +0530
Commit:     Jan Holesovsky <kendy at collabora.com>
CommitDate: Tue Jan 28 18:50:13 2020 +0100

    Added option in context menu/mobile wizard for "Add row below"
    
    Change-Id: Ib650a4aa5175e73a41dbdb6f203fc36e70c860c7
    Reviewed-on: https://gerrit.libreoffice.org/c/online/+/87642
    Reviewed-by: Jan Holesovsky <kendy at collabora.com>
    Tested-by: Jan Holesovsky <kendy at collabora.com>

diff --git a/loleaflet/src/control/Control.RowHeader.js b/loleaflet/src/control/Control.RowHeader.js
index f4330e59a..264d1bf76 100644
--- a/loleaflet/src/control/Control.RowHeader.js
+++ b/loleaflet/src/control/Control.RowHeader.js
@@ -65,6 +65,10 @@ L.Control.RowHeader = L.Control.Header.extend({
 				name: _UNO('.uno:InsertRowsBefore', 'spreadsheet', true),
 				callback: (this._insertRowAbove).bind(this)
 			},
+			'insertrowbelow': {
+				name: _UNO('.uno:InsertRowsAfter', 'spreadsheet', true),
+				callback: (this._insertRowBelow).bind(this)
+			},
 			'deleteselectedrow': {
 				name: _UNO('.uno:DeleteRows', 'spreadsheet', true),
 				callback: (this._deleteSelectedRow).bind(this)
@@ -110,7 +114,7 @@ L.Control.RowHeader = L.Control.Header.extend({
 		this._map.sendUnoCommand('.uno:SetOptimalRowHeight');
 	},
 
-	insertRow: function(index) {
+	insertRowAbove: function(index) {
 		// First select the corresponding row because
 		// .uno:InsertRows doesn't accept any row number
 		// as argument and just inserts before the selected row
@@ -120,6 +124,13 @@ L.Control.RowHeader = L.Control.Header.extend({
 		this._map.sendUnoCommand('.uno:InsertRows');
 	},
 
+	insertRowBelow: function(index) {
+		if (this._map._docLayer._selections.getLayers().length === 0) {
+			this._selectRow(index, 0);
+		}
+		this._map.sendUnoCommand('.uno:InsertRowsAfter');
+	},
+
 	deleteRow: function(index) {
 		if (this._map._docLayer._selections.getLayers().length === 0) {
 			this._selectRow(index, 0);
@@ -611,7 +622,14 @@ L.Control.RowHeader = L.Control.Header.extend({
 	_insertRowAbove: function() {
 		var index = this._lastMouseOverIndex;
 		if (index) {
-			this.insertRow.call(this, index);
+			this.insertRowAbove.call(this, index);
+		}
+	},
+
+	_insertRowBelow: function() {
+		var index = this._lastMouseOverIndex;
+		if (index) {
+			this.insertRowBelow.call(this, index);
 		}
 	},
 


More information about the Libreoffice-commits mailing list