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

Pranam Lashkari (via logerrit) logerrit at kemper.freedesktop.org
Tue Jan 28 21:53:36 UTC 2020


 loleaflet/src/control/Control.ColumnHeader.js |   12 ++++++------
 loleaflet/src/control/Control.RowHeader.js    |   12 ++++++------
 2 files changed, 12 insertions(+), 12 deletions(-)

New commits:
commit f41cf7c6ba1af02929704c80b6a7760277061c37
Author:     Pranam Lashkari <lpranam at collabora.com>
AuthorDate: Wed Jan 29 02:13:04 2020 +0530
Commit:     Michael Meeks <michael.meeks at collabora.com>
CommitDate: Tue Jan 28 22:53:13 2020 +0100

    fix: Row/Column header context menu operates incorrectly
    
    select any row/column now try to open the context menu
    by right-clicking row/column header and perform some action
    Action will be performed on the originally selected row/column
    (same goes with the mobile wizard)
    
    Change-Id: I2d2a7f871b1562d4706e9ea1e4382968a4502583
    Reviewed-on: https://gerrit.libreoffice.org/c/online/+/87658
    Reviewed-by: Michael Meeks <michael.meeks at collabora.com>
    Tested-by: Michael Meeks <michael.meeks at collabora.com>

diff --git a/loleaflet/src/control/Control.ColumnHeader.js b/loleaflet/src/control/Control.ColumnHeader.js
index 6ef875dc6..008b01bdc 100644
--- a/loleaflet/src/control/Control.ColumnHeader.js
+++ b/loleaflet/src/control/Control.ColumnHeader.js
@@ -110,7 +110,7 @@ L.Control.ColumnHeader = L.Control.Header.extend({
 	},
 
 	optimalWidth: function(index) {
-		if (this._map._docLayer._selections.getLayers().length === 0) {
+		if (!this.isHighlighted(index)) {
 			this._selectColumn(index, 0);
 		}
 		this._map.sendUnoCommand('.uno:SetOptimalColumnWidth');
@@ -120,7 +120,7 @@ L.Control.ColumnHeader = L.Control.Header.extend({
 		// First select the corresponding column because
 		// .uno:InsertColumn doesn't accept any column number
 		// as argument and just inserts before the selected column
-		if (this._map._docLayer._selections.getLayers().length === 0) {
+		if (!this.isHighlighted(index)) {
 			this._selectColumn(index, 0);
 		}
 		this._map.sendUnoCommand('.uno:InsertColumns');
@@ -128,7 +128,7 @@ L.Control.ColumnHeader = L.Control.Header.extend({
 	},
 
 	insertColumnAfter: function(index) {
-		if (this._map._docLayer._selections.getLayers().length === 0) {
+		if (!this.isHighlighted(index)) {
 			this._selectColumn(index, 0);
 		}
 		this._map.sendUnoCommand('.uno:InsertColumnsAfter');
@@ -136,7 +136,7 @@ L.Control.ColumnHeader = L.Control.Header.extend({
 	},
 
 	deleteColumn: function(index) {
-		if (this._map._docLayer._selections.getLayers().length === 0) {
+		if (!this.isHighlighted(index)) {
 			this._selectColumn(index, 0);
 		}
 		this._map.sendUnoCommand('.uno:DeleteColumns');
@@ -144,7 +144,7 @@ L.Control.ColumnHeader = L.Control.Header.extend({
 	},
 
 	hideColumn: function(index) {
-		if (this._map._docLayer._selections.getLayers().length === 0) {
+		if (!this.isHighlighted(index)) {
 			this._selectColumn(index, 0);
 		}
 		this._map.sendUnoCommand('.uno:HideColumn');
@@ -152,7 +152,7 @@ L.Control.ColumnHeader = L.Control.Header.extend({
 	},
 
 	showColumn: function(index) {
-		if (this._map._docLayer._selections.getLayers().length === 0) {
+		if (!this.isHighlighted(index)) {
 			this._selectColumn(index, 0);
 		}
 		this._map.sendUnoCommand('.uno:ShowColumn');
diff --git a/loleaflet/src/control/Control.RowHeader.js b/loleaflet/src/control/Control.RowHeader.js
index 264d1bf76..2b654a09e 100644
--- a/loleaflet/src/control/Control.RowHeader.js
+++ b/loleaflet/src/control/Control.RowHeader.js
@@ -108,7 +108,7 @@ L.Control.RowHeader = L.Control.Header.extend({
 	},
 
 	optimalHeight: function(index) {
-		if (this._map._docLayer._selections.getLayers().length === 0) {
+		if (!this.isHighlighted(index)) {
 			this._selectRow(index, 0);
 		}
 		this._map.sendUnoCommand('.uno:SetOptimalRowHeight');
@@ -118,35 +118,35 @@ L.Control.RowHeader = L.Control.Header.extend({
 		// First select the corresponding row because
 		// .uno:InsertRows doesn't accept any row number
 		// as argument and just inserts before the selected row
-		if (this._map._docLayer._selections.getLayers().length === 0) {
+		if (!this.isHighlighted(index)) {
 			this._selectRow(index, 0);
 		}
 		this._map.sendUnoCommand('.uno:InsertRows');
 	},
 
 	insertRowBelow: function(index) {
-		if (this._map._docLayer._selections.getLayers().length === 0) {
+		if (!this.isHighlighted(index)) {
 			this._selectRow(index, 0);
 		}
 		this._map.sendUnoCommand('.uno:InsertRowsAfter');
 	},
 
 	deleteRow: function(index) {
-		if (this._map._docLayer._selections.getLayers().length === 0) {
+		if (!this.isHighlighted(index)) {
 			this._selectRow(index, 0);
 		}
 		this._map.sendUnoCommand('.uno:DeleteRows');
 	},
 
 	hideRow: function(index) {
-		if (this._map._docLayer._selections.getLayers().length === 0) {
+		if (!this.isHighlighted(index)) {
 			this._selectRow(index, 0);
 		}
 		this._map.sendUnoCommand('.uno:HideRow');
 	},
 
 	showRow: function(index) {
-		if (this._map._docLayer._selections.getLayers().length === 0) {
+		if (!this.isHighlighted(index)) {
 			this._selectRow(index, 0);
 		}
 		this._map.sendUnoCommand('.uno:ShowRow');


More information about the Libreoffice-commits mailing list