[Libreoffice-commits] online.git: Branch 'distro/collabora/collabora-online-1-9' - 11 commits - loleaflet/dist loleaflet/.gitignore loleaflet/Makefile loleaflet/src loolwsd/debian loolwsd/test loolwsd/TileCache.cpp loolwsd/UnitHTTP.hpp

Tor Lillqvist tml at collabora.com
Wed Sep 21 21:07:35 UTC 2016


 loleaflet/.gitignore                      |    3 +++
 loleaflet/Makefile                        |   20 +++++++++++---------
 loleaflet/dist/toolbar/toolbar.js         |    8 ++++++--
 loleaflet/src/core/Socket.js              |    8 +++++---
 loleaflet/src/layer/tile/TileLayer.js     |   11 +++++++++++
 loleaflet/src/map/handler/Map.Keyboard.js |    5 +++++
 loolwsd/TileCache.cpp                     |    6 ++----
 loolwsd/UnitHTTP.hpp                      |    5 ++++-
 loolwsd/debian/control                    |    2 +-
 loolwsd/test/test.cpp                     |    2 +-
 10 files changed, 49 insertions(+), 21 deletions(-)

New commits:
commit 391d9c0e5e512173c0d13fe9aca587e415b5d9e5
Author: Tor Lillqvist <tml at collabora.com>
Date:   Wed Sep 21 18:44:02 2016 +0300

    Check LOOL_NO_LOGCOLOR here, too
    
    Note that just like for loolwsd, LOOL_NO_LOGCOLOR is effective only
    when stderr is not going to a terminal. If it goes to a terminal, there
    is no way to avoid use of color, see Log::initialize().
    
    (cherry picked from commit 857c3c4f044f1e4d323576532364c890c7de283e)

diff --git a/loolwsd/test/test.cpp b/loolwsd/test/test.cpp
index a8c697c..60d694f 100644
--- a/loolwsd/test/test.cpp
+++ b/loolwsd/test/test.cpp
@@ -72,7 +72,7 @@ bool filterTests(CPPUNIT_NS::TestRunner& runner, CPPUNIT_NS::Test* testRegistry)
 
 int main(int /*argc*/, char** /*argv*/)
 {
-    Log::initialize("tst", "trace", true, false);
+    Log::initialize("tst", "trace", !std::getenv("LOOL_NO_LOGCOLOR"), false);
 
 
     CPPUNIT_NS::TestResult controller;
commit 4e48f2a5641c0443d3eec39a59a3a63cfc11520e
Author: Tor Lillqvist <tml at collabora.com>
Date:   Wed Sep 21 17:38:23 2016 +0300

    Fix heap-use-after-free detectec by Clang's AddressSanitizer
    
    (cherry picked from commit 299a57399670ded9ea5bfb1ca2b7601f269d3855)

diff --git a/loolwsd/TileCache.cpp b/loolwsd/TileCache.cpp
index 416543e..6a2053f 100644
--- a/loolwsd/TileCache.cpp
+++ b/loolwsd/TileCache.cpp
@@ -491,13 +491,11 @@ std::string TileCache::cancelTiles(const std::shared_ptr<ClientSession> &subscri
                 // No other subscriber, remove it from the render queue.
                 oss << it->second->getVersion() << ',';
                 it = _tilesBeingRendered.erase(it);
+                continue;
             }
         }
 
-        if (!subscribers.empty())
-        {
-            ++it;
-        }
+        ++it;
     }
 
     const auto canceltiles = oss.str();
commit 605024e5416022e9ad0d9281fecfd18151bb24d8
Author: Tor Lillqvist <tml at collabora.com>
Date:   Wed Sep 21 17:03:34 2016 +0300

    The secure() is only in quite fresh Poco
    
    (cherry picked from commit fbc992ca4203cfd7d51d57db96d4b65cdce3bd40)

diff --git a/loolwsd/UnitHTTP.hpp b/loolwsd/UnitHTTP.hpp
index aa9c1e3..8d89d40 100644
--- a/loolwsd/UnitHTTP.hpp
+++ b/loolwsd/UnitHTTP.hpp
@@ -72,8 +72,10 @@ public:
     virtual bool expectContinue() const override
         { return false; }
 #endif
+#if POCO_VERSION >= 0x02000000
     virtual bool secure() const override
         { return true; }
+#endif
 	virtual const SocketAddress& clientAddress() const override
         { return _clientAddress; }
 	virtual const SocketAddress& serverAddress() const override
commit 5c74785fd4dd5cd7442a11872b90399edc79dd3a
Author: Tor Lillqvist <tml at collabora.com>
Date:   Wed Sep 21 16:54:47 2016 +0300

    Add 'override'
    
    (cherry picked from commit d9c9ad0de53d2721f7b113c1c73f5d6b869bce42)

diff --git a/loolwsd/UnitHTTP.hpp b/loolwsd/UnitHTTP.hpp
index c87ce15..aa9c1e3 100644
--- a/loolwsd/UnitHTTP.hpp
+++ b/loolwsd/UnitHTTP.hpp
@@ -72,7 +72,8 @@ public:
     virtual bool expectContinue() const override
         { return false; }
 #endif
-    virtual bool secure() const { return true; }
+    virtual bool secure() const override
+        { return true; }
 	virtual const SocketAddress& clientAddress() const override
         { return _clientAddress; }
 	virtual const SocketAddress& serverAddress() const override
commit 151d451e6fe107a7953d63fd918ab0b15bc435c4
Author: László Németh <laszlo.nemeth at collabora.com>
Date:   Wed Sep 21 13:26:02 2016 +0200

    add Ctrl-Shift-Alt-d shortcut to tile debugging mode
    
    (cherry picked from commit 165ab830efd77914278075dd598dfa3386af10cc)

diff --git a/loleaflet/src/layer/tile/TileLayer.js b/loleaflet/src/layer/tile/TileLayer.js
index 5f099b6..1c2f2cc 100644
--- a/loleaflet/src/layer/tile/TileLayer.js
+++ b/loleaflet/src/layer/tile/TileLayer.js
@@ -387,6 +387,17 @@ L.TileLayer = L.GridLayer.extend({
 		else if (textMsg.startsWith('graphicviewselection:')) {
 			this._onGraphicViewSelectionMsg(textMsg);
 		}
+		else if (textMsg.startsWith('tiledebuggingmode:')) {
+			this._invalidateClientVisibleArea();
+			this._debug = !this._debug;
+			if (this._debug) {
+				if (!this._debugInfo) {
+					this._debugInfo = new L.LayerGroup();
+					map.addLayer(this._debugInfo);
+				}
+				this._onMessage('invalidatetiles: EMPTY', null);
+			}
+		}
 	},
 
 	_onCommandValuesMsg: function (textMsg) {
diff --git a/loleaflet/src/map/handler/Map.Keyboard.js b/loleaflet/src/map/handler/Map.Keyboard.js
index e75ffed..9835846 100644
--- a/loleaflet/src/map/handler/Map.Keyboard.js
+++ b/loleaflet/src/map/handler/Map.Keyboard.js
@@ -386,6 +386,11 @@ L.Map.Keyboard = L.Handler.extend({
 					this._map._socket.sendMessage('uno .uno:InsertEndnote');
 					return true;
 				}
+			} else if (e.originalEvent.altKey) {
+				switch (e.originalEvent.keyCode) {
+				case 68: // Ctrl + Shift + Alt + d for tile debugging mode
+					this._map._docLayer._onMessage('tiledebuggingmode:', null);
+				}
 			}
 
 			return false;
commit af95d3a2b5d06f143760e7c8d4731d84d0c9cb77
Author: Pranav Kant <pranavk at collabora.co.uk>
Date:   Wed Sep 21 13:39:00 2016 +0530

    loleaflet: Factor out generation of .json
    
    ... so that one can use the factored-out rule, build-l10n, to
    install these translation .json files in dist/ and start using
    them, without having to do 'make dist' first and then extract the
    package.
    
    Change-Id: Ie2814a9f2596246b487799968f3027aa48475e7b
    (cherry picked from commit 5ba6360a8b19073379f404b25771e95b11bbd56e)

diff --git a/loleaflet/.gitignore b/loleaflet/.gitignore
index 4bdf28b..30212c1 100644
--- a/loleaflet/.gitignore
+++ b/loleaflet/.gitignore
@@ -22,3 +22,6 @@ coverage/
 /load_test_out
 /spec/data/load_test
 *.tar.gz
+dist/l10n/ui-*json
+dist/l10n/help-*.json
+dist/l10n/styles/
diff --git a/loleaflet/Makefile b/loleaflet/Makefile
index 7ca562f..135b8bf 100644
--- a/loleaflet/Makefile
+++ b/loleaflet/Makefile
@@ -21,7 +21,16 @@ build:
 	jake bundle[,$(DEBUG),$(MINIFY)]
 	jake bundle[admin,$(DEBUG),$(MINIFY)]
 
-all: build
+.PHONY: build-l10n
+build-l10n:
+	mkdir -p dist/l10n/styles
+
+	util/po2json.py --quiet po/*.po
+	mv po/*.json dist/l10n/
+	util/po2json.py --quiet po/styles/*.po
+	mv po/styles/*.json dist/l10n/styles/
+
+all: build build-l10n
 
 .PHONY: dist
 dist: MINIFY=true
@@ -29,11 +38,6 @@ dist: all
 	rm -rf loleaflet-$(VERSION)
 	mkdir loleaflet-$(VERSION)
 	cp -ar dist loleaflet-$(VERSION)
-	util/po2json.py --quiet po/*.po
-	mv po/*.json loleaflet-$(VERSION)/dist/l10n
-	util/po2json.py --quiet po/styles/*.po
-	mkdir -p loleaflet-$(VERSION)/dist/l10n/styles/
-	mv po/styles/*.json loleaflet-$(VERSION)/dist/l10n/styles/
 	tar cfz loleaflet-$(VERSION).tar.gz loleaflet-$(VERSION)
 	rm -rf loleaflet-$(VERSION)
 
commit ad7ac41d13a1c8fc4a0b0f2623a0686c2e587cbc
Author: Pranav Kant <pranavk at collabora.co.uk>
Date:   Wed Sep 21 13:14:52 2016 +0530

    loleaflet: Don't try to delete .pot files
    
    The behavior has changed to include .pot files in git as well in
    7839aecac6a9715294eb56f8bbe2e522668ae4d1
    
    So, don't try to delete these .pot files now
    
    Change-Id: I6f5d015596ff1f2d98adca426b1458f66bc7d4b4
    Reviewed-on: https://gerrit.libreoffice.org/29130
    Reviewed-by: Andras Timar <andras.timar at collabora.com>
    Tested-by: Andras Timar <andras.timar at collabora.com>
    (cherry picked from commit c2f0b84dd1871913e797c74fcb58b6388eb592d5)

diff --git a/loleaflet/Makefile b/loleaflet/Makefile
index 3cbbf70..7ca562f 100644
--- a/loleaflet/Makefile
+++ b/loleaflet/Makefile
@@ -62,8 +62,6 @@ pot:
 l10n: pot
 	for i in po/ui-*.po; do pot2po --input=po/templates/loleaflet-ui.pot --template=$$i --output=$$i.new; mv $$i.new $$i;done
 	for i in po/help-*.po; do pot2po --input=po/templates/loleaflet-help.pot --template=$$i --output=$$i.new; mv $$i.new $$i;done
-	rm po/loleaflet-ui.pot
-	rm po/loleaflet-help.pot
 
 spec/data/load-test:
 	if [ ! -d spec/data/load_test ]; then \
commit 564943499b6d2070f90e1ebfe199da381ae92123
Author: Katarina Behrens <Katarina.Behrens at cib.de>
Date:   Mon Sep 19 11:59:21 2016 +0200

    Add dependency on 'adduser', postinst script needs it
    
    Change-Id: I41c6b2d6ef9191db3a07bfaf55530659bc06a1d0
    Reviewed-on: https://gerrit.libreoffice.org/29017
    Reviewed-by: Tor Lillqvist <tml at collabora.com>
    Tested-by: Andras Timar <andras.timar at collabora.com>
    (cherry picked from commit 7424bfd11e00ff261ed11556d7ced09a13abcd91)

diff --git a/loolwsd/debian/control b/loolwsd/debian/control
index 9bdbfa7..fcd503b 100644
--- a/loolwsd/debian/control
+++ b/loolwsd/debian/control
@@ -8,7 +8,7 @@ Standards-Version: 3.9.2
 Package: loolwsd
 Section: web
 Architecture: any
-Depends: ${shlibs:Depends}, ${misc:Depends}, libsm6, libssl1.0.0, libodbc1, libxinerama1, libcairo2, libgl1-mesa-glx, libcups2, libdbus-glib-1-2, cpio, collaboraofficebasis5.1-base, collaboraofficebasis5.1-calc, collaboraofficebasis5.1-core, collaboraofficebasis5.1-draw, collaboraofficebasis5.1-extension-beanshell-script-provider, collaboraofficebasis5.1-extension-ct2n, collaboraofficebasis5.1-extension-javascript-script-provider, collaboraofficebasis5.1-extension-mediawiki-publisher, collaboraofficebasis5.1-extension-nlpsolver, collaboraofficebasis5.1-extension-numbertext, collaboraofficebasis5.1-extension-pdf-import, collaboraofficebasis5.1-extension-report-builder, collaboraofficebasis5.1-gnome-integration, collaboraofficebasis5.1-graphicfilter, collaboraofficebasis5.1-images, collaboraofficebasis5.1-impress, collaboraofficebasis5.1-librelogo, collaboraofficebasis5.1-math, collaboraofficebasis5.1-ogltrans, collaboraofficebasis5.1-ooofonts, collaboraofficebasis5.1-ooolinguistic, c
 ollaboraofficebasis5.1-postgresql-sdbc, collaboraofficebasis5.1-python-script-provider, collaboraofficebasis5.1-pyuno, collaboraofficebasis5.1-writer, collaboraofficebasis5.1-xsltfilter, collaboraoffice5.1, collaboraoffice5.1-base, collaboraoffice5.1-calc, collaboraoffice5.1-dict-en, collaboraoffice5.1-draw, collaboraoffice5.1-debian-menus, collaboraoffice5.1-impress, collaboraoffice5.1-math, collaboraoffice5.1-ure, collaboraoffice5.1-writer, collaboraofficebasis5.1-en-us, collaboraofficebasis5.1-en-us-base, collaboraofficebasis5.1-en-us-calc, collaboraofficebasis5.1-en-us-math, collaboraofficebasis5.1-en-us-res, collaboraofficebasis5.1-en-us-writer, collaboraoffice5.1-en-us
+Depends: ${shlibs:Depends}, ${misc:Depends}, adduser, libsm6, libssl1.0.0, libodbc1, libxinerama1, libcairo2, libgl1-mesa-glx, libcups2, libdbus-glib-1-2, cpio, collaboraofficebasis5.1-base, collaboraofficebasis5.1-calc, collaboraofficebasis5.1-core, collaboraofficebasis5.1-draw, collaboraofficebasis5.1-extension-beanshell-script-provider, collaboraofficebasis5.1-extension-ct2n, collaboraofficebasis5.1-extension-javascript-script-provider, collaboraofficebasis5.1-extension-mediawiki-publisher, collaboraofficebasis5.1-extension-nlpsolver, collaboraofficebasis5.1-extension-numbertext, collaboraofficebasis5.1-extension-pdf-import, collaboraofficebasis5.1-extension-report-builder, collaboraofficebasis5.1-gnome-integration, collaboraofficebasis5.1-graphicfilter, collaboraofficebasis5.1-images, collaboraofficebasis5.1-impress, collaboraofficebasis5.1-librelogo, collaboraofficebasis5.1-math, collaboraofficebasis5.1-ogltrans, collaboraofficebasis5.1-ooofonts, collaboraofficebasis5.1-oooling
 uistic, collaboraofficebasis5.1-postgresql-sdbc, collaboraofficebasis5.1-python-script-provider, collaboraofficebasis5.1-pyuno, collaboraofficebasis5.1-writer, collaboraofficebasis5.1-xsltfilter, collaboraoffice5.1, collaboraoffice5.1-base, collaboraoffice5.1-calc, collaboraoffice5.1-dict-en, collaboraoffice5.1-draw, collaboraoffice5.1-debian-menus, collaboraoffice5.1-impress, collaboraoffice5.1-math, collaboraoffice5.1-ure, collaboraoffice5.1-writer, collaboraofficebasis5.1-en-us, collaboraofficebasis5.1-en-us-base, collaboraofficebasis5.1-en-us-calc, collaboraofficebasis5.1-en-us-math, collaboraofficebasis5.1-en-us-res, collaboraofficebasis5.1-en-us-writer, collaboraoffice5.1-en-us
 Description: LibreOffice On-Line WebSocket Daemon
  LOOLWSD is a daemon that talks to web browser clients and provides LibreOffice
  services.
commit 0aac9105ba918b61ce9d4e3a492a1fb8bfb4259a
Author: Pranav Kant <pranavk at collabora.co.uk>
Date:   Wed Sep 21 13:05:52 2016 +0530

    loleaflet: Fix admin l10n strings file location
    
    Location was changed in 6c69b63be58f9a2989a5dc8a47a44c9eafc72b4e
    in an effort to modularize everything including these l10n
    strings.
    
    Change-Id: I4d7538a6e6d1370a45326bc163a496cf7c681259
    (cherry picked from commit ede173201f01faf74d97d9f0b3028442badbe36f)

diff --git a/loleaflet/Makefile b/loleaflet/Makefile
index 021df96..3cbbf70 100644
--- a/loleaflet/Makefile
+++ b/loleaflet/Makefile
@@ -39,13 +39,13 @@ dist: all
 
 pot:
 	xgettext --from-code=UTF-8 --keyword=_ --output=po/templates/loleaflet-ui.pot \
+		admin.strings.js \
 		evol.colorpicker.strings.js \
 		unocommands.js \
 		dist/errormessages.js \
 		dist/toolbar/toolbar.js \
 		src/admin/AdminSocketBase.js \
 		src/admin/AdminSocketOverview.js \
-		src/admin/AdminStrings.js \
 		src/admin/Util.js \
 		src/control/Control.ColumnHeader.js \
 		src/control/Control.DocumentRepair.js \
commit 97697e2cb9c17ff278c68e075e4a43ae12fb266c
Author: Pranav Kant <pranavk at collabora.co.uk>
Date:   Wed Sep 21 13:00:39 2016 +0530

    loleaflet: Guard against null
    
    This helps in preventing some of many warnings in the browser
    console.
    
    Change-Id: I568b9a20e7cecfddaffd7309271fae4f6c265b46
    (cherry picked from commit ed860594a1ec4d3161c99e291674768a6c54ab5c)

diff --git a/loleaflet/dist/toolbar/toolbar.js b/loleaflet/dist/toolbar/toolbar.js
index 401936f..25b5205 100644
--- a/loleaflet/dist/toolbar/toolbar.js
+++ b/loleaflet/dist/toolbar/toolbar.js
@@ -895,7 +895,9 @@ map.on('commandstatechanged', function (e) {
 			color = '#' + '0'.repeat(6 - color.length) + color;
 		}
 		div = L.DomUtil.get('fontcolorindicator');
-		L.DomUtil.setStyle(div, 'background', color);
+		if (div) {
+			L.DomUtil.setStyle(div, 'background', color);
+		}
 	}
 	else if (commandName === '.uno:BackColor' || commandName === '.uno:BackgroundColor' || commandName === '.uno:CharBackColor') {
 		// confusingly, the .uno: command is named differently in Writer, Calc and Impress
@@ -908,7 +910,9 @@ map.on('commandstatechanged', function (e) {
 			color = '#' + '0'.repeat(6 - color.length) + color;
 		}
 		div = L.DomUtil.get('backcolorindicator');
-		L.DomUtil.setStyle(div, 'background', color);
+		if (div) {
+			L.DomUtil.setStyle(div, 'background', color);
+		}
 	}
 	else if (commandName === '.uno:ModifiedStatus') {
 		var modifiedStatus = e.state === 'true';
commit db8ff07adaf1e882a184b435fc42ef097d536a16
Author: Pranav Kant <pranavk at collabora.co.uk>
Date:   Wed Sep 21 12:46:49 2016 +0530

    loleaflet: cleanup
    
    Change-Id: Ia61402f5e0d650d7de606b1d8c8a548453972475
    (cherry picked from commit a9946c59c0ddd22857096c557815843994d7d3c1)

diff --git a/loleaflet/src/core/Socket.js b/loleaflet/src/core/Socket.js
index edeac8d..4bb4b8e 100644
--- a/loleaflet/src/core/Socket.js
+++ b/loleaflet/src/core/Socket.js
@@ -305,11 +305,13 @@ L.Socket = L.Class.extend({
 
 	_onSocketClose: function () {
 		this.hideBusy();
-		if (this._map) {
-			this._map._active = false;
+		if (this) {
+			this._active = false;
 		}
 
-		this._docLayer.removeAllViews();
+		if (this._docLayer) {
+			this._docLayer.removeAllViews();
+		}
 		if (this.fail) {
 			this.fire('error', {msg: _('Well, this is embarrassing, we cannot connect to your document. Please try again.'), cmd: 'socket', kind: 'closed', id: 4});
 		}


More information about the Libreoffice-commits mailing list