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

Pranav Kant pranavk at collabora.com
Thu May 12 18:38:41 UTC 2016


 loleaflet/dist/toolbar/toolbar.js |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

New commits:
commit 870b46be78a3fd09384d7e8e3e74d02cfe66614e
Author: Pranav Kant <pranavk at collabora.com>
Date:   Fri May 13 00:00:49 2016 +0530

    bccu#1756: Check for empty input
    
    In case of presentation we are getting an empty value in response
    to .uno:CharFontName. While this looks like a bug in LOKit, no harm
    in putting a check for empty values here.
    
    In ES5 argument to Object.keys must be an object otherwise it
    throws an exception.
    
    Change-Id: I5c2f7963544fda55bab3f314f1b098b3c9e3bd0b

diff --git a/loleaflet/dist/toolbar/toolbar.js b/loleaflet/dist/toolbar/toolbar.js
index e074f7b..4b516d3 100644
--- a/loleaflet/dist/toolbar/toolbar.js
+++ b/loleaflet/dist/toolbar/toolbar.js
@@ -786,7 +786,11 @@ map.on('updatetoolbarcommandvalues', function (e) {
 		$(".styles-select").on('select2:select', onStyleSelect);
 	}
 	else if (e.commandName === '.uno:CharFontName') {
-		data = data.concat(Object.keys(e.commandValues));
+		// Old browsers like IE11 et al don't like Object.keys with
+		// empty arguments
+		if (typeof e.commandValues === 'object') {
+			data = data.concat(Object.keys(e.commandValues));
+		}
 		$(".fonts-select").select2({
 			data: data,
 			placeholder: _("Font")


More information about the Libreoffice-commits mailing list