[Libreoffice-commits] online.git: Branch 'distro/collabora/collabora-online-3-0' - loleaflet/src

Pranav Kant pranavk at collabora.co.uk
Thu Jan 25 16:08:55 UTC 2018


 loleaflet/src/control/Control.LokDialog.js |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

New commits:
commit 3e4a78ccc3410b16fe6b34eea23720f551f53383
Author: Pranav Kant <pranavk at collabora.co.uk>
Date:   Thu Jan 25 20:02:32 2018 +0530

    loleaflet: Don't try to paint if floating window has vanished
    
    Change-Id: I9284c7ec73f6f0e900d3efa2d055eb8b7d5303b2
    Reviewed-on: https://gerrit.libreoffice.org/48620
    Reviewed-by: Jan Holesovsky <kendy at collabora.com>
    Tested-by: Jan Holesovsky <kendy at collabora.com>

diff --git a/loleaflet/src/control/Control.LokDialog.js b/loleaflet/src/control/Control.LokDialog.js
index 95cb64d8..eac2baf0 100644
--- a/loleaflet/src/control/Control.LokDialog.js
+++ b/loleaflet/src/control/Control.LokDialog.js
@@ -297,7 +297,10 @@ L.Control.LokDialog = L.Control.extend({
 	_paintDialogChild: function(dialogId, width, height, rectangle, imgData) {
 		var strDlgId = this._toDlgPrefix(dialogId);
 		var img = new Image();
-		var canvas = document.getElementById(strDlgId + '-floating');
+		var canvas = L.DomUtil.get(strDlgId + '-floating');
+		if (!canvas)
+			return; // no floating window to paint to
+
 		canvas.width = width;
 		canvas.height = height;
 		var ctx = canvas.getContext('2d');


More information about the Libreoffice-commits mailing list