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

Szymon Kłos (via logerrit) logerrit at kemper.freedesktop.org
Wed Nov 27 09:58:18 UTC 2019


 loleaflet/src/control/Control.JSDialogBuilder.js |   85 +++++++++++++----------
 1 file changed, 50 insertions(+), 35 deletions(-)

New commits:
commit 649ca253db594805ed8f355e25770384961728de
Author:     Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Fri Nov 22 14:40:42 2019 +0100
Commit:     Szymon Kłos <szymon.klos at collabora.com>
CommitDate: Wed Nov 27 10:57:54 2019 +0100

    jsdialogs: update FillGradient
    
    Change-Id: I4667d6f1c02590b077fd59dc5f2b6b71fa6df7cb
    Reviewed-on: https://gerrit.libreoffice.org/83859
    Reviewed-by: Szymon Kłos <szymon.klos at collabora.com>
    Tested-by: Szymon Kłos <szymon.klos at collabora.com>

diff --git a/loleaflet/src/control/Control.JSDialogBuilder.js b/loleaflet/src/control/Control.JSDialogBuilder.js
index d8d003837..b1b442aa4 100644
--- a/loleaflet/src/control/Control.JSDialogBuilder.js
+++ b/loleaflet/src/control/Control.JSDialogBuilder.js
@@ -230,9 +230,9 @@ L.Control.JSDialogBuilder = L.Control.extend({
 
 		var updateFunction = function() {
 			var state = null;
-			if (data.command) {
+			if (data.id)
 				state = builder._getUnoStateForItemId(data.id, builder);
-			}
+
 			if (state) {
 				titleSpan.innerHTML = state;
 			} else {
@@ -242,12 +242,10 @@ L.Control.JSDialogBuilder = L.Control.extend({
 
 		updateFunction();
 
-		if (data.command) {
-			builder.map.on('commandstatechanged', function(e) {
-				if (e.commandName === data.command)
-					updateFunction();
-			}, this);
-		}
+		builder.map.on('commandstatechanged', function(e) {
+			if (e.commandName === data.command || e.commandName === builder._mapWindowIdToUnoCommand(data.id))
+				updateFunction();
+		}, this);
 
 		var contentDiv = L.DomUtil.create('div', 'ui-content level-' + builder._currentDepth + ' mobile-wizard', parentContainer);
 		contentDiv.title = data.text;
@@ -548,6 +546,9 @@ L.Control.JSDialogBuilder = L.Control.extend({
 
 		case 'FIELD_TRANSPARENCY':
 			return '.uno:FillShadowTransparency';
+
+		case 'gradientstyle':
+			return '.uno:FillGradient';
 		}
 
 		return null;
@@ -680,6 +681,28 @@ L.Control.JSDialogBuilder = L.Control.extend({
 				}
 			}
 			break;
+
+		case 'fillattr':
+			var hatch = items.getItemValue('.uno:FillHatch');
+			var bitmap = items.getItemValue('.uno:FillBitmap');
+			if (hatch || bitmap) {
+				// TODO
+			}
+			break;
+
+		case 'gradientstyle':
+			state = items.getItemValue('.uno:FillGradient');
+			if (state) {
+				return state.style;
+			}
+			break;
+
+		case 'gradangle':
+			state = items.getItemValue('.uno:FillGradient');
+			if (state) {
+				return state.angle;
+			}
+			break;
 		}
 
 		return null;
commit 1d865e8ce42d7b308d19fcd975636e010fdf9038
Author:     Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Tue Nov 26 10:59:15 2019 +0100
Commit:     Szymon Kłos <szymon.klos at collabora.com>
CommitDate: Wed Nov 27 10:57:34 2019 +0100

    jsdialogs: avoid using string as a JSON
    
    Change-Id: I5e3c3f8c914cc3c6de5962db4bb55b67b4f23270
    Reviewed-on: https://gerrit.libreoffice.org/83861
    Reviewed-by: Szymon Kłos <szymon.klos at collabora.com>
    Tested-by: Szymon Kłos <szymon.klos at collabora.com>

diff --git a/loleaflet/src/control/Control.JSDialogBuilder.js b/loleaflet/src/control/Control.JSDialogBuilder.js
index c22700b61..d8d003837 100644
--- a/loleaflet/src/control/Control.JSDialogBuilder.js
+++ b/loleaflet/src/control/Control.JSDialogBuilder.js
@@ -561,32 +561,32 @@ L.Control.JSDialogBuilder = L.Control.extend({
 		case 'beforetextindent':
 			state = items.getItemValue('.uno:LeftRightParaMargin');
 			if (state)
-				return state.left.replace(',', '.');
+				return JSON.parse(state).left.replace(',', '.');
 			break;
 
 		case 'aftertextindent':
 			state = items.getItemValue('.uno:LeftRightParaMargin');
 			if (state) {
-				return state.right.replace(',', '.');
+				return JSON.parse(state).right.replace(',', '.');
 			}
 			break;
 
 		case 'firstlineindent':
 			state = items.getItemValue('.uno:LeftRightParaMargin');
 			if (state)
-				return state.firstline.replace(',', '.');
+				return JSON.parse(state).firstline.replace(',', '.');
 			break;
 
 		case 'aboveparaspacing':
 			state = items.getItemValue('.uno:ULSpacing');
 			if (state)
-				return state.upper.replace(',', '.');
+				return JSON.parse(state).upper.replace(',', '.');
 			break;
 
 		case 'belowparaspacing':
 			state = items.getItemValue('.uno:ULSpacing');
 			if (state)
-				return state.lower.replace(',', '.');
+				return JSON.parse(state).lower.replace(',', '.');
 			break;
 
 		case 'rowheight':
commit 03d442f7bb97dacba83e571234f5a915c557c1b4
Author:     Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Fri Nov 22 13:30:27 2019 +0100
Commit:     Szymon Kłos <szymon.klos at collabora.com>
CommitDate: Wed Nov 27 10:57:18 2019 +0100

    jsdialogs: process JSON for FillStyle
    
    Change-Id: Ib1e9ae0b73b5d49adb2b776b6c788a742febf3e0
    Reviewed-on: https://gerrit.libreoffice.org/83858
    Reviewed-by: Szymon Kłos <szymon.klos at collabora.com>
    Tested-by: Szymon Kłos <szymon.klos at collabora.com>

diff --git a/loleaflet/src/control/Control.JSDialogBuilder.js b/loleaflet/src/control/Control.JSDialogBuilder.js
index 7f1a0253d..c22700b61 100644
--- a/loleaflet/src/control/Control.JSDialogBuilder.js
+++ b/loleaflet/src/control/Control.JSDialogBuilder.js
@@ -229,12 +229,9 @@ L.Control.JSDialogBuilder = L.Control.extend({
 		arrowSpan.innerHTML = '>';
 
 		var updateFunction = function() {
-			var items = builder.map['stateChangeHandler'];
-
 			var state = null;
 			if (data.command) {
-				state = items.getItemValue(data.command);
-				state = builder._getTextForUnoState(data.command, state);
+				state = builder._getUnoStateForItemId(data.id, builder);
 			}
 			if (state) {
 				titleSpan.innerHTML = state;
@@ -660,33 +657,28 @@ L.Control.JSDialogBuilder = L.Control.extend({
 				return state.replace(',', '.');
 			}
 			break;
-		}
-
-		return null;
-	},
-
-	_getTextForUnoState: function(command, state) {
-		switch (command) {
-		case '.uno:FillStyle':
 
-			switch (state) {
-			case 'NONE':
-				return _('None');
+		case 'fillstyle':
+			state = items.getItemValue('.uno:FillStyle');
+			if (state) {
+				switch (state) {
+				case 'NONE':
+					return _('None');
 
-			case 'SOLID':
-				return _('Color');
+				case 'SOLID':
+					return _('Color');
 
-			case 'GRADIENT':
-				return _('Gradient');
+				case 'GRADIENT':
+					return _('Gradient');
 
-			case 'HATCH':
-				return _('Hatching');
+				case 'HATCH':
+					return _('Hatching');
 
-			case 'BITMAP':
-				// FIXME: can be bitmap or pattern, for now we cant import bitmap
-				return _('Pattern');
+				case 'BITMAP':
+					// FIXME: can be bitmap or pattern, for now we cant import bitmap
+					return _('Pattern');
+				}
 			}
-
 			break;
 		}
 


More information about the Libreoffice-commits mailing list