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

Szymon Kłos (via logerrit) logerrit at kemper.freedesktop.org
Thu Nov 28 11:10:32 UTC 2019


 loleaflet/src/control/Control.JSDialogBuilder.js |   22 +++++++++++++++++++++-
 loleaflet/src/core/Util.js                       |    5 +++++
 2 files changed, 26 insertions(+), 1 deletion(-)

New commits:
commit 47d8f51b46d2b64e285437a33a19b74e5220c7d7
Author:     Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Thu Nov 28 12:10:01 2019 +0100
Commit:     Szymon Kłos <szymon.klos at collabora.com>
CommitDate: Thu Nov 28 12:10:01 2019 +0100

    jsdialog: correctly read .uno:Size values
    
    Change-Id: Ic469c959afbf28d04ef75b53eac5559a2ea8106d

diff --git a/loleaflet/src/control/Control.JSDialogBuilder.js b/loleaflet/src/control/Control.JSDialogBuilder.js
index 5d4975347..da6ce637f 100644
--- a/loleaflet/src/control/Control.JSDialogBuilder.js
+++ b/loleaflet/src/control/Control.JSDialogBuilder.js
@@ -565,6 +565,12 @@ L.Control.JSDialogBuilder = L.Control.extend({
 
 		case 'setgamma':
 			return '.uno:GrafGamma';
+
+		case 'selectwidth':
+			return '.uno:Size';
+
+		case 'selectheight':
+			return '.uno:Size';
 		}
 
 		return null;
@@ -782,6 +788,20 @@ L.Control.JSDialogBuilder = L.Control.extend({
 				return String(state.replace(',', '.') / 100.0);
 			}
 			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;
 		}
 
 		return null;
diff --git a/loleaflet/src/core/Util.js b/loleaflet/src/core/Util.js
index da81e6783..e504c92c5 100644
--- a/loleaflet/src/core/Util.js
+++ b/loleaflet/src/core/Util.js
@@ -195,6 +195,10 @@ L.Util = {
 
 	isEmpty: function(o) {
 		return !(o && o.length);
+	},
+
+	mm100thToInch: function(mm) {
+		return mm / 2540;
 	}
 };
 
@@ -249,3 +253,4 @@ L.round = L.Util.round;
 L.getDpiScaleFactor = L.Util.getDpiScaleFactor;
 L.toggleFullScreen = L.Util.toggleFullScreen;
 L.isEmpty = L.Util.isEmpty;
+L.mm100thToInch = L.Util.mm100thToInch;
commit 17601e461ce6dedcf33becd9ec3a0996e628d286
Author:     Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Thu Nov 28 11:53:56 2019 +0100
Commit:     Szymon Kłos <szymon.klos at collabora.com>
CommitDate: Thu Nov 28 11:54:25 2019 +0100

    jsdialog: correctly read gamma value
    
    Change-Id: I3eafd45bf405539a6c38d0901ec5a39d8ae1d788

diff --git a/loleaflet/src/control/Control.JSDialogBuilder.js b/loleaflet/src/control/Control.JSDialogBuilder.js
index 158c209e5..5d4975347 100644
--- a/loleaflet/src/control/Control.JSDialogBuilder.js
+++ b/loleaflet/src/control/Control.JSDialogBuilder.js
@@ -779,7 +779,7 @@ L.Control.JSDialogBuilder = L.Control.extend({
 		case 'setgamma':
 			state = items.getItemValue('.uno:GrafGamma');
 			if (state) {
-				return state.replace(',', '.');
+				return String(state.replace(',', '.') / 100.0);
 			}
 			break;
 		}


More information about the Libreoffice-commits mailing list