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

Henry Castro (via logerrit) logerrit at kemper.freedesktop.org
Thu Apr 2 13:44:13 UTC 2020


 loleaflet/src/control/Control.JSDialogBuilder.js |   39 ++++-------------------
 1 file changed, 8 insertions(+), 31 deletions(-)

New commits:
commit 91b2e52ce2d2f78802faec1025c13bd1e438fae7
Author:     Henry Castro <hcastro at collabora.com>
AuthorDate: Fri Mar 27 20:02:16 2020 -0400
Commit:     Henry Castro <hcastro at collabora.com>
CommitDate: Thu Apr 2 15:43:54 2020 +0200

    loleaflet: update position and size transformation values
    
    Now the LO Core server sends the converted units formatted
    text to update in client side when mobile wizard is visible.
    
    Change-Id: I82416bb4712aa20bcddb409c1129da1aff521a34
    Reviewed-on: https://gerrit.libreoffice.org/c/online/+/91266
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Henry Castro <hcastro at collabora.com>

diff --git a/loleaflet/src/control/Control.JSDialogBuilder.js b/loleaflet/src/control/Control.JSDialogBuilder.js
index 862c218a4..27c8f35d7 100644
--- a/loleaflet/src/control/Control.JSDialogBuilder.js
+++ b/loleaflet/src/control/Control.JSDialogBuilder.js
@@ -904,34 +904,6 @@ L.Control.JSDialogBuilder = L.Control.extend({
 			}
 			break;
 
-		case 'selectwidth':
-			state = items.getItemValue('.uno:Size');
-			if (state) {
-				return String(L.mm100thToInch(state.split('x')[0]).toFixed(2));
-			}
-			break;
-
-		case 'selectheight':
-			state = items.getItemValue('.uno:Size');
-			if (state) {
-				return String(L.mm100thToInch(state.split('x')[1]).toFixed(2));
-			}
-			break;
-
-		case 'horizontalpos':
-			state = items.getItemValue('.uno:Position');
-			if (state) {
-				return String(L.mm100thToInch(state.split('/')[0]).toFixed(2));
-			}
-			break;
-
-		case 'verticalpos':
-			state = items.getItemValue('.uno:Position');
-			if (state) {
-				return String(L.mm100thToInch(state.split('/')[1]).toFixed(2));
-			}
-			break;
-
 		case 'transtype':
 			state = items.getItemValue('.uno:FillFloatTransparence');
 			if (state) {
@@ -999,8 +971,11 @@ L.Control.JSDialogBuilder = L.Control.extend({
 		if (data.readOnly === true)
 			$(spinfield).attr('readOnly', 'true');
 
-		var updateFunction = function() {
-			var value = builder._getUnoStateForItemId(data.id, builder);
+		var updateFunction = function(e) {
+			var value = e ? e[data.id] : undefined;
+			if (!value) {
+				value = builder._getUnoStateForItemId(data.id, builder);
+			}
 
 			if (!value && data.text != undefined)
 				value = data.text;
@@ -1013,7 +988,9 @@ L.Control.JSDialogBuilder = L.Control.extend({
 		updateFunction();
 
 		builder.map.on('commandstatechanged', function(e) {
-			if (e.commandName === builder._mapWindowIdToUnoCommand(data.id))
+			if (e.state[data.id]) {
+				updateFunction(e.state);
+			} else if (e.commandName === builder._mapWindowIdToUnoCommand(data.id))
 				updateFunction();
 		}, this);
 


More information about the Libreoffice-commits mailing list