[Libreoffice-commits] online.git: 5 commits - loleaflet/js loleaflet/src wsd/DocumentBroker.cpp wsd/Storage.cpp wsd/Storage.hpp

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Sat Dec 15 14:03:17 UTC 2018


 loleaflet/js/toolbar.js               |  144 +++++++++++++++++++++++-----------
 loleaflet/src/map/Map.js              |    9 --
 loleaflet/src/map/handler/Map.WOPI.js |    3 
 wsd/DocumentBroker.cpp                |    1 
 wsd/Storage.cpp                       |    4 
 wsd/Storage.hpp                       |   10 +-
 6 files changed, 117 insertions(+), 54 deletions(-)

New commits:
commit c5b98a7c896916fd23c963d5815441b2e9984aeb
Author:     Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Thu Dec 13 16:24:07 2018 +0100
Commit:     Andras Timar <andras.timar at collabora.com>
CommitDate: Sat Dec 15 15:01:19 2018 +0100

    Don't show 'null' in IE, Correct isArray test
    
    Change-Id: Ic1a34aebc989dd2bf7ab55097f2edf77189883e8

diff --git a/loleaflet/js/toolbar.js b/loleaflet/js/toolbar.js
index 90588b535..9ed53ec2a 100644
--- a/loleaflet/js/toolbar.js
+++ b/loleaflet/js/toolbar.js
@@ -882,9 +882,9 @@ function initMobileToolbar(toolItems) {
 
 			var showUserList = map['wopi'].HideUserList !== null &&
 								map['wopi'].HideUserList !== undefined &&
-								!$.inArray('true', map['wopi'].HideUserList) &&
-								((window.mode.isMobile() && !$.inArray('mobile', map['wopi'].HideUserList)) ||
-								(window.mode.isTablet() && !$.inArray('tablet', map['wopi'].HideUserList)));
+								$.inArray('true', map['wopi'].HideUserList) < 0 &&
+								((window.mode.isMobile() && $.inArray('mobile', map['wopi'].HideUserList) < 0) ||
+								(window.mode.isTablet() && $.inArray('tablet', map['wopi'].HideUserList) < 0));
 			if (this.get('userlist').hidden == true && showUserList) {
 				this.show('userlist');
 				this.show('userlistbreak');
@@ -1256,8 +1256,8 @@ function initNormalToolbar(toolItems) {
 
 				var showInDesktop = map['wopi'].HideUserList !== null &&
 									map['wopi'].HideUserList !== undefined &&
-									!$.inArray('true', map['wopi'].HideUserList) &&
-									!$.inArray('desktop', map['wopi'].HideUserList);
+									$.inArray('true', map['wopi'].HideUserList) < 0 &&
+									$.inArray('desktop', map['wopi'].HideUserList) < 0;
 				if (this.get('userlist').hidden == true && showInDesktop) {
 					this.show('userlist');
 					this.show('userlistbreak');
diff --git a/loleaflet/src/map/Map.js b/loleaflet/src/map/Map.js
index 25c2d7782..bad0ac53a 100644
--- a/loleaflet/src/map/Map.js
+++ b/loleaflet/src/map/Map.js
@@ -280,7 +280,7 @@ L.Map = L.Evented.extend({
 			this.updateModificationIndicator(this._lastmodtime);
 
 			// Replace menu button body with new content
-			lastModButton.firstChild.innerHTML = null;
+			lastModButton.firstChild.innerHTML = '';
 			lastModButton.firstChild.appendChild(mainSpan);
 		}
 	},
@@ -292,7 +292,7 @@ L.Map = L.Evented.extend({
 			var special = [ 'bn_IN', 'hi_IN', 'id_ID', 'nb_NO', 'nn_NO', 'pt_BR', 'zh_CN', 'zh_TW'];
 			var locale = String.locale;
 			locale = locale.replace('-', '_');
-			if (!$.inArray(locale, special)) {
+			if ($.inArray(locale, special) < 0) {
 				if (locale.indexOf('_') > 0) {
 					locale = locale.substring(0, locale.indexOf('_'));
 				}
commit 45282b1d5944716f7b5733c99e87669900c4936a
Author:     Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Thu Dec 13 16:11:31 2018 +0100
Commit:     Andras Timar <andras.timar at collabora.com>
CommitDate: Sat Dec 15 14:59:57 2018 +0100

    Replace 'includes' with 'jQuery.isArray'
    
    Change-Id: Idf5a0bc9cbb6850164b21c90bcf98876bc62db68

diff --git a/loleaflet/js/toolbar.js b/loleaflet/js/toolbar.js
index 13188614f..90588b535 100644
--- a/loleaflet/js/toolbar.js
+++ b/loleaflet/js/toolbar.js
@@ -882,9 +882,9 @@ function initMobileToolbar(toolItems) {
 
 			var showUserList = map['wopi'].HideUserList !== null &&
 								map['wopi'].HideUserList !== undefined &&
-								!map['wopi'].HideUserList.includes('true') &&
-								((window.mode.isMobile() && !map['wopi'].HideUserList.includes('mobile')) ||
-								(window.mode.isTablet() && !map['wopi'].HideUserList.includes('tablet')));
+								!$.inArray('true', map['wopi'].HideUserList) &&
+								((window.mode.isMobile() && !$.inArray('mobile', map['wopi'].HideUserList)) ||
+								(window.mode.isTablet() && !$.inArray('tablet', map['wopi'].HideUserList)));
 			if (this.get('userlist').hidden == true && showUserList) {
 				this.show('userlist');
 				this.show('userlistbreak');
@@ -1256,8 +1256,8 @@ function initNormalToolbar(toolItems) {
 
 				var showInDesktop = map['wopi'].HideUserList !== null &&
 									map['wopi'].HideUserList !== undefined &&
-									!map['wopi'].HideUserList.includes('true') &&
-									!map['wopi'].HideUserList.includes('desktop');
+									!$.inArray('true', map['wopi'].HideUserList) &&
+									!$.inArray('desktop', map['wopi'].HideUserList);
 				if (this.get('userlist').hidden == true && showInDesktop) {
 					this.show('userlist');
 					this.show('userlistbreak');
diff --git a/loleaflet/src/map/Map.js b/loleaflet/src/map/Map.js
index f6a3ee0ac..25c2d7782 100644
--- a/loleaflet/src/map/Map.js
+++ b/loleaflet/src/map/Map.js
@@ -292,7 +292,7 @@ L.Map = L.Evented.extend({
 			var special = [ 'bn_IN', 'hi_IN', 'id_ID', 'nb_NO', 'nn_NO', 'pt_BR', 'zh_CN', 'zh_TW'];
 			var locale = String.locale;
 			locale = locale.replace('-', '_');
-			if (!special.includes(locale)) {
+			if (!$.inArray(locale, special)) {
 				if (locale.indexOf('_') > 0) {
 					locale = locale.substring(0, locale.indexOf('_'));
 				}
commit 41413542ceda3b92fd13b72a93e98c7aa2f772e5
Author:     Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Thu Dec 13 15:37:35 2018 +0100
Commit:     Andras Timar <andras.timar at collabora.com>
CommitDate: Sat Dec 15 14:58:25 2018 +0100

    Fix typo in the timeago.js languages
    
    Change-Id: I1776d749fc6a03f70279897285688deafbe71d59

diff --git a/loleaflet/src/map/Map.js b/loleaflet/src/map/Map.js
index 0e6e4ec48..f6a3ee0ac 100644
--- a/loleaflet/src/map/Map.js
+++ b/loleaflet/src/map/Map.js
@@ -289,15 +289,14 @@ L.Map = L.Evented.extend({
 		this._lastmodtime = newModificationTime;
 		if (this.lastModIndicator !== null && this.lastModIndicator !== undefined) {
 			// Get locale
-			var special = [ 'bn_IN', 'hi_IN', 'id_ID', 'nb_NO', 'nn_NO', 'pt-BR', 'zh_CN', 'zh_TW'];
+			var special = [ 'bn_IN', 'hi_IN', 'id_ID', 'nb_NO', 'nn_NO', 'pt_BR', 'zh_CN', 'zh_TW'];
 			var locale = String.locale;
 			locale = locale.replace('-', '_');
 			if (!special.includes(locale)) {
 				if (locale.indexOf('_') > 0) {
-					locale = locale.substring(0, locale.indexOf('_') - 1);
+					locale = locale.substring(0, locale.indexOf('_'));
 				}
 			}
-
 			// Real-time auto update
 			this.lastModIndicator.setAttribute('datetime', newModificationTime);
 			timeago().render(this.lastModIndicator, locale);
commit e2b464b2378e8c96523c81ed54e5de2a081d8836
Author:     Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Wed Dec 12 14:51:37 2018 +0100
Commit:     Andras Timar <andras.timar at collabora.com>
CommitDate: Sat Dec 15 14:55:35 2018 +0100

    WOPI: Extend HideUserList property
    
    Added "mobile" | "tablet" | "desktop" values support.
    "," is used as a delimiter
    
    Change-Id: Idfa4670f229725dfedfb2d55b622263cbcfd6fc2

diff --git a/loleaflet/js/toolbar.js b/loleaflet/js/toolbar.js
index 0b2918571..13188614f 100644
--- a/loleaflet/js/toolbar.js
+++ b/loleaflet/js/toolbar.js
@@ -879,6 +879,19 @@ function initMobileToolbar(toolItems) {
 				this.show('prev');
 				this.show('next');
 			}
+
+			var showUserList = map['wopi'].HideUserList !== null &&
+								map['wopi'].HideUserList !== undefined &&
+								!map['wopi'].HideUserList.includes('true') &&
+								((window.mode.isMobile() && !map['wopi'].HideUserList.includes('mobile')) ||
+								(window.mode.isTablet() && !map['wopi'].HideUserList.includes('tablet')));
+			if (this.get('userlist').hidden == true && showUserList) {
+				this.show('userlist');
+				this.show('userlistbreak');
+				map.on('deselectuser', deselectUser);
+				map.on('addview', onAddView);
+				map.on('removeview', onRemoveView);
+			}
 		}
 	});
 	toolbar.bind('touchstart', function(e) {
@@ -1241,13 +1254,16 @@ function initNormalToolbar(toolItems) {
 				$('#search-input').off('input', onSearch).on('input', onSearch);
 				$('#search-input').off('keydown', onSearchKeyDown).on('keydown', onSearchKeyDown);
 
-				if (this.get('userlist').hidden == true && map['wopi'].HideUserList === false) {
+				var showInDesktop = map['wopi'].HideUserList !== null &&
+									map['wopi'].HideUserList !== undefined &&
+									!map['wopi'].HideUserList.includes('true') &&
+									!map['wopi'].HideUserList.includes('desktop');
+				if (this.get('userlist').hidden == true && showInDesktop) {
 					this.show('userlist');
 					this.show('userlistbreak');
-				}
-				else if (this.get('userlist').hidden == false && map['wopi'].HideUserList === true) {
-					this.hide('userlist');
-					this.hide('userlistbreak');
+					map.on('deselectuser', deselectUser);
+					map.on('addview', onAddView);
+					map.on('removeview', onRemoveView);
 				}
 			}
 		});
@@ -1262,12 +1278,6 @@ function initNormalToolbar(toolItems) {
 	toolbar.bind('touchstart', function() {
 		w2ui['actionbar'].touchStarted = true;
 	});
-
-	if (map['wopi'].HideUserList === false) {
-		map.on('deselectuser', deselectUser);
-		map.on('addview', onAddView);
-		map.on('removeview', onRemoveView);
-	}
 }
 
 var userJoinedPopupMessage = '<div>' + _('%user has joined') + '</div>';
diff --git a/loleaflet/src/map/handler/Map.WOPI.js b/loleaflet/src/map/handler/Map.WOPI.js
index 088cea644..b0d5a7750 100644
--- a/loleaflet/src/map/handler/Map.WOPI.js
+++ b/loleaflet/src/map/handler/Map.WOPI.js
@@ -22,7 +22,7 @@ L.Map.WOPI = L.Handler.extend({
 	UserCanNotWriteRelative: true,
 	EnableInsertRemoteImage: false,
 	EnableShare: false,
-	HideUserList: false,
+	HideUserList: null,
 	CallPythonScriptSource: null,
 
 	_appLoadedConditions: {
@@ -80,7 +80,8 @@ L.Map.WOPI = L.Handler.extend({
 		this.UserCanNotWriteRelative = !!wopiInfo['UserCanNotWriteRelative'];
 		this.EnableInsertRemoteImage = !!wopiInfo['EnableInsertRemoteImage'];
 		this.EnableShare = !!wopiInfo['EnableShare'];
-		this.HideUserList = !!wopiInfo['HideUserList'];
+		if (wopiInfo['HideUserList'])
+			this.HideUserList = wopiInfo['HideUserList'].split(',');
 
 		this._map.fire('postMessage', {
 			msgId: 'App_LoadingStatus',
diff --git a/wsd/Storage.cpp b/wsd/Storage.cpp
index ef5c11d4b..ebb5acd42 100644
--- a/wsd/Storage.cpp
+++ b/wsd/Storage.cpp
@@ -498,7 +498,7 @@ std::unique_ptr<WopiStorage::WOPIFileInfo> WopiStorage::getWOPIFileInfo(const Au
     bool userCanNotWriteRelative = true;
     bool enableInsertRemoteImage = false;
     bool enableShare = false;
-    bool hideUserList = false;
+    std::string hideUserList("false");
     WOPIFileInfo::TriState disableChangeTrackingRecord = WOPIFileInfo::TriState::Unset;
     WOPIFileInfo::TriState disableChangeTrackingShow = WOPIFileInfo::TriState::Unset;
     WOPIFileInfo::TriState hideChangeTrackingControls = WOPIFileInfo::TriState::Unset;
diff --git a/wsd/Storage.hpp b/wsd/Storage.hpp
index 2b926eb97..fd70515c4 100644
--- a/wsd/Storage.hpp
+++ b/wsd/Storage.hpp
@@ -324,7 +324,7 @@ public:
                      const bool userCanNotWriteRelative,
                      const bool enableInsertRemoteImage,
                      const bool enableShare,
-                     const bool hideUserList,
+                     const std::string& hideUserList,
                      const TriState disableChangeTrackingShow,
                      const TriState disableChangeTrackingRecord,
                      const TriState hideChangeTrackingControls,
@@ -438,8 +438,10 @@ public:
         bool _enableInsertRemoteImage;
         /// If set to true, users can access the file share functionality
         bool _enableShare;
-        /// If set to true, user list on the status bar will be hidden
-        bool _hideUserList;
+        /// If set to "true", user list on the status bar will be hidden
+        /// If set to "mobile" | "tablet" | "desktop", will be hidden on a specified device
+        /// (may be joint, delimited by commas eg. "mobile,tablet")
+        std::string _hideUserList;
         /// If we should disable change-tracking visibility by default (meaningful at loading).
         TriState _disableChangeTrackingShow;
         /// If we should disable change-tracking ability by default (meaningful at loading).
commit f6266188822ffc2c300932cdbf2f4681f6cb4321
Author:     Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Wed Dec 12 11:05:31 2018 +0100
Commit:     Andras Timar <andras.timar at collabora.com>
CommitDate: Sat Dec 15 14:50:30 2018 +0100

    WOPI: Added HideUserList to CheckFileInfo
    
    Change-Id: Id0f9597d52fb339162a9ce4f622aa39694d1a25e

diff --git a/loleaflet/js/toolbar.js b/loleaflet/js/toolbar.js
index f1d8c611f..0b2918571 100644
--- a/loleaflet/js/toolbar.js
+++ b/loleaflet/js/toolbar.js
@@ -1196,8 +1196,8 @@ function initNormalToolbar(toolItems) {
 				{type: 'html',  id: 'left'},
 				{type: 'html',  id: 'right'},
 				{type: 'html',    id: 'modifiedstatuslabel', html: '<div id="modifiedstatuslabel" class="loleaflet-font"></div>', mobile:false},
-				{type: 'break', id: 'modifiedstatuslabelbreak', mobile:false},
-				{type: 'drop', id: 'userlist', hidden: true, text: _('No users'), html: '<div id="userlist_container"><table id="userlist_table"><tbody></tbody></table>' +
+				{type: 'break', id: 'modifiedstatuslabelbreak', mobile: false},
+				{type: 'drop', id: 'userlist', img: 'users', hidden: true, html: '<div id="userlist_container"><table id="userlist_table"><tbody></tbody></table>' +
 					'<hr><table class="loleaflet-font" id="editor-btn">' +
 					'<tr>' +
 					'<td><input type="checkbox" name="alwaysFollow" id="follow-checkbox" onclick="editorUpdate(event)"></td>' +
@@ -1207,7 +1207,7 @@ function initNormalToolbar(toolItems) {
 					'<p id="currently-msg">' + _('Current') + ' - <b><span id="current-editor"></span></b></p>' +
 					'</div>'
 				},
-				{type: 'break', id: 'userlistbreak'},
+				{type: 'break', id: 'userlistbreak', hidden: true, mobile: false },
 				{type: 'button',  id: 'prev', img: 'prev', hint: _UNO('.uno:PageUp', 'text')},
 				{type: 'button',  id: 'next', img: 'next', hint: _UNO('.uno:PageDown', 'text')},
 				{type: 'break', id: 'prevnextbreak'},
@@ -1240,6 +1240,15 @@ function initNormalToolbar(toolItems) {
 				$('#tb_actionbar_item_userlist .w2ui-tb-caption').addClass('loleaflet-font');
 				$('#search-input').off('input', onSearch).on('input', onSearch);
 				$('#search-input').off('keydown', onSearchKeyDown).on('keydown', onSearchKeyDown);
+
+				if (this.get('userlist').hidden == true && map['wopi'].HideUserList === false) {
+					this.show('userlist');
+					this.show('userlistbreak');
+				}
+				else if (this.get('userlist').hidden == false && map['wopi'].HideUserList === true) {
+					this.hide('userlist');
+					this.hide('userlistbreak');
+				}
 			}
 		});
 	}
@@ -1253,6 +1262,12 @@ function initNormalToolbar(toolItems) {
 	toolbar.bind('touchstart', function() {
 		w2ui['actionbar'].touchStarted = true;
 	});
+
+	if (map['wopi'].HideUserList === false) {
+		map.on('deselectuser', deselectUser);
+		map.on('addview', onAddView);
+		map.on('removeview', onRemoveView);
+	}
 }
 
 var userJoinedPopupMessage = '<div>' + _('%user has joined') + '</div>';
@@ -1587,34 +1602,49 @@ function onDocLayerInit() {
 
 		if (!_inMobileMode()) {
 			statusbar.insert('left', [
-				{type: 'break', id:'break1'},
-				{type: 'html',  id: 'StatusDocPos',
-					html: '<div id="StatusDocPos" class="loleaflet-font" title="'+_('Number of Sheets')+ '" style="padding: 5px 5px;">    &nbsp</div>' },
-				{type: 'break', id:'break2'},
-				{type: 'html',  id: 'RowColSelCount',
-					html: '<div id="RowColSelCount" class="loleaflet-font" title="'+_('Selected range of cells')+ '" style="padding: 5px 5px;">    &nbsp</div>' },
-				{type: 'break', id:'break3'},
-				{type: 'html',  id: 'InsertMode', mobile: false,
-					html: '<div id="InsertMode" class="loleaflet-font" title="'+_('Entering text mode')+ '" style="padding: 5px 5px;">    &nbsp</div>' },
-				{type: 'break', id:'break4'},
-				{type: 'html',  id: 'LanguageStatus', mobile: false,
-					html: '<div id="LanguageStatus" class="loleaflet-font" title="'+_('Text Language')+ '" style="padding: 5px 5px;">    &nbsp</div>' },
-				{type: 'break', id:'break5'},
-				{type: 'html',  id: 'StatusSelectionMode', mobile: false,
-					html: '<div id="StatusSelectionMode" class="loleaflet-font" title="'+_('Selection Mode')+ '" style="padding: 5px 5px;">    &nbsp</div>' },
-				{type: 'break', id:'break8', mobile: false},
-				{type: 'html',  id: 'StateTableCell', mobile:false,
-				 html: '<div id="StateTableCell" class="loleaflet-font" title="'+_('Choice of functions')+ '" style="padding: 5px 5px;">    &nbsp</div>' },
-				{type: 'menu-check', id: 'StateTableCellMenu', caption: '', selected: ['2', '512'], items: [
-					{ id: '2', text: _('Average')},
-					{ id: '8', text: _('CountA')},
-					{ id: '4', text: _('Count')},
-					{ id: '16', text: _('Maximum')},
-					{ id: '32', text: _('Minimum')},
-					{ id: '512', text: _('Sum')},
-					{ id: '8192', text: _('Selection count')},
-					{ id: '1', text: _('None')}
-				]}
+				{type: 'break', id: 'break1'},
+				{
+					type: 'html', id: 'StatusDocPos',
+					html: '<div id="StatusDocPos" class="loleaflet-font" title="' + _('Number of Sheets') + '" style="padding: 5px 5px;">    &nbsp</div>'
+				},
+				{type: 'break', id: 'break2'},
+				{
+					type: 'html', id: 'RowColSelCount',
+					html: '<div id="RowColSelCount" class="loleaflet-font" title="' + _('Selected range of cells') + '" style="padding: 5px 5px;">    &nbsp</div>'
+				},
+				{type: 'break', id: 'break3'},
+				{
+					type: 'html', id: 'InsertMode', mobile: false,
+					html: '<div id="InsertMode" class="loleaflet-font" title="' + _('Entering text mode') + '" style="padding: 5px 5px;">    &nbsp</div>'
+				},
+				{type: 'break', id: 'break4'},
+				{
+					type: 'html', id: 'LanguageStatus', mobile: false,
+					html: '<div id="LanguageStatus" class="loleaflet-font" title="' + _('Text Language') + '" style="padding: 5px 5px;">    &nbsp</div>'
+				},
+				{type: 'break', id: 'break5'},
+				{
+					type: 'html', id: 'StatusSelectionMode', mobile: false,
+					html: '<div id="StatusSelectionMode" class="loleaflet-font" title="' + _('Selection Mode') + '" style="padding: 5px 5px;">    &nbsp</div>'
+				},
+				{type: 'break', id: 'break8', mobile: false},
+				{
+					type: 'html', id: 'StateTableCell', mobile: false,
+					html: '<div id="StateTableCell" class="loleaflet-font" title="' + _('Choice of functions') + '" style="padding: 5px 5px;">    &nbsp</div>'
+				},
+				{
+					type: 'menu-check', id: 'StateTableCellMenu', caption: '', selected: ['2', '512'], items: [
+						{id: '2', text: _('Average')},
+						{id: '8', text: _('CountA')},
+						{id: '4', text: _('Count')},
+						{id: '16', text: _('Maximum')},
+						{id: '32', text: _('Minimum')},
+						{id: '512', text: _('Sum')},
+						{id: '8192', text: _('Selection count')},
+						{id: '1', text: _('None')}
+					]
+				},
+				{type: 'break', id: 'break8', mobile: false}
 			]);
 
 			$('#spreadsheet-toolbar').show();
@@ -1630,20 +1660,31 @@ function onDocLayerInit() {
 		if (!_inMobileMode()) {
 			statusbar.insert('left', [
 				{type: 'break', id: 'break1'},
-				{type: 'html',  id: 'StatePageNumber',
-					html: '<div id="StatePageNumber" class="loleaflet-font" title="'+_('Number of Pages')+ '" style="padding: 5px 5px;">    &nbsp</div>' },
-				{type: 'break', id:'break2'},
-				{type: 'html',  id: 'StateWordCount', mobile: false,
-					html: '<div id="StateWordCount" class="loleaflet-font" title="'+_('Word Counter')+ '" style="padding: 5px 5px;">    &nbsp</div>' },
-				{type: 'break', id:'break5', mobile: false},
-				{type: 'html',  id: 'InsertMode', mobile: false,
-					html: '<div id="InsertMode" class="loleaflet-font" title="'+_('Entering text mode')+ '" style="padding: 5px 5px;">    &nbsp</div>' },
-				{type: 'break', id:'break6', mobile:false},
-				{type: 'html',  id: 'StatusSelectionMode', mobile: false,
-					html: '<div id="StatusSelectionMode" class="loleaflet-font" title="'+_('Selection Mode')+ '" style="padding: 5px 5px;">    &nbsp</div>' },
-				{type: 'break', id:'break7', mobile:false},
-				{type: 'html',  id: 'LanguageStatus', mobile: false,
-					html: '<div id="LanguageStatus" class="loleaflet-font" title="'+_('Text Language')+ '" style="padding: 5px 5px;">    &nbsp</div>' }
+				{
+					type: 'html', id: 'StatePageNumber',
+					html: '<div id="StatePageNumber" class="loleaflet-font" title="' + _('Number of Pages') + '" style="padding: 5px 5px;">    &nbsp</div>'
+				},
+				{type: 'break', id: 'break2'},
+				{
+					type: 'html', id: 'StateWordCount', mobile: false,
+					html: '<div id="StateWordCount" class="loleaflet-font" title="' + _('Word Counter') + '" style="padding: 5px 5px;">    &nbsp</div>'
+				},
+				{type: 'break', id: 'break5', mobile: false},
+				{
+					type: 'html', id: 'InsertMode', mobile: false,
+					html: '<div id="InsertMode" class="loleaflet-font" title="' + _('Entering text mode') + '" style="padding: 5px 5px;">    &nbsp</div>'
+				},
+				{type: 'break', id: 'break6', mobile: false},
+				{
+					type: 'html', id: 'StatusSelectionMode', mobile: false,
+					html: '<div id="StatusSelectionMode" class="loleaflet-font" title="' + _('Selection Mode') + '" style="padding: 5px 5px;">    &nbsp</div>'
+				},
+				{type: 'break', id: 'break7', mobile: false},
+				{
+					type: 'html', id: 'LanguageStatus', mobile: false,
+					html: '<div id="LanguageStatus" class="loleaflet-font" title="' + _('Text Language') + '" style="padding: 5px 5px;">    &nbsp</div>'
+				},
+				{type: 'break', id: 'break8', mobile: false}
 			]);
 		}
 
@@ -1664,7 +1705,8 @@ function onDocLayerInit() {
 				{
 					type: 'html', id: 'LanguageStatus', mobile: false,
 					html: '<div id="LanguageStatus" class="loleaflet-font" title="' + _('Text Language') + '" style="padding: 5px 5px;">    &nbsp</div>'
-				}
+				},
+				{type: 'break', id: 'break8', mobile: false}
 			]);
 		}
 		// FALLTHROUGH intended
diff --git a/loleaflet/src/map/handler/Map.WOPI.js b/loleaflet/src/map/handler/Map.WOPI.js
index 7120977d3..088cea644 100644
--- a/loleaflet/src/map/handler/Map.WOPI.js
+++ b/loleaflet/src/map/handler/Map.WOPI.js
@@ -22,6 +22,7 @@ L.Map.WOPI = L.Handler.extend({
 	UserCanNotWriteRelative: true,
 	EnableInsertRemoteImage: false,
 	EnableShare: false,
+	HideUserList: false,
 	CallPythonScriptSource: null,
 
 	_appLoadedConditions: {
@@ -79,6 +80,7 @@ L.Map.WOPI = L.Handler.extend({
 		this.UserCanNotWriteRelative = !!wopiInfo['UserCanNotWriteRelative'];
 		this.EnableInsertRemoteImage = !!wopiInfo['EnableInsertRemoteImage'];
 		this.EnableShare = !!wopiInfo['EnableShare'];
+		this.HideUserList = !!wopiInfo['HideUserList'];
 
 		this._map.fire('postMessage', {
 			msgId: 'App_LoadingStatus',
diff --git a/wsd/DocumentBroker.cpp b/wsd/DocumentBroker.cpp
index 531cf9e74..2ea017bc2 100644
--- a/wsd/DocumentBroker.cpp
+++ b/wsd/DocumentBroker.cpp
@@ -552,6 +552,7 @@ bool DocumentBroker::load(const std::shared_ptr<ClientSession>& session, const s
         wopiInfo->set("UserCanNotWriteRelative", wopifileinfo->getUserCanNotWriteRelative());
         wopiInfo->set("EnableInsertRemoteImage", wopifileinfo->getEnableInsertRemoteImage());
         wopiInfo->set("EnableShare", wopifileinfo->getEnableShare());
+        wopiInfo->set("HideUserList", wopifileinfo->_hideUserList);
         if (wopifileinfo->getHideChangeTrackingControls() != WopiStorage::WOPIFileInfo::TriState::Unset)
             wopiInfo->set("HideChangeTrackingControls", wopifileinfo->getHideChangeTrackingControls() == WopiStorage::WOPIFileInfo::TriState::True);
 
diff --git a/wsd/Storage.cpp b/wsd/Storage.cpp
index 11c658b65..ef5c11d4b 100644
--- a/wsd/Storage.cpp
+++ b/wsd/Storage.cpp
@@ -498,6 +498,7 @@ std::unique_ptr<WopiStorage::WOPIFileInfo> WopiStorage::getWOPIFileInfo(const Au
     bool userCanNotWriteRelative = true;
     bool enableInsertRemoteImage = false;
     bool enableShare = false;
+    bool hideUserList = false;
     WOPIFileInfo::TriState disableChangeTrackingRecord = WOPIFileInfo::TriState::Unset;
     WOPIFileInfo::TriState disableChangeTrackingShow = WOPIFileInfo::TriState::Unset;
     WOPIFileInfo::TriState hideChangeTrackingControls = WOPIFileInfo::TriState::Unset;
@@ -578,6 +579,7 @@ std::unique_ptr<WopiStorage::WOPIFileInfo> WopiStorage::getWOPIFileInfo(const Au
         JsonUtil::findJSONValue(object, "UserCanNotWriteRelative", userCanNotWriteRelative);
         JsonUtil::findJSONValue(object, "EnableInsertRemoteImage", enableInsertRemoteImage);
         JsonUtil::findJSONValue(object, "EnableShare", enableShare);
+        JsonUtil::findJSONValue(object, "HideUserList", hideUserList);
         bool booleanFlag = false;
         if (JsonUtil::findJSONValue(object, "DisableChangeTrackingRecord", booleanFlag))
             disableChangeTrackingRecord = (booleanFlag ? WOPIFileInfo::TriState::True : WOPIFileInfo::TriState::False);
@@ -606,7 +608,7 @@ std::unique_ptr<WopiStorage::WOPIFileInfo> WopiStorage::getWOPIFileInfo(const Au
          postMessageOrigin, hidePrintOption, hideSaveOption, hideExportOption,
          enableOwnerTermination, disablePrint, disableExport, disableCopy,
          disableInactiveMessages, userCanNotWriteRelative, enableInsertRemoteImage, enableShare,
-         disableChangeTrackingShow, disableChangeTrackingRecord,
+         hideUserList, disableChangeTrackingShow, disableChangeTrackingRecord,
          hideChangeTrackingControls, callDuration}));
 }
 
diff --git a/wsd/Storage.hpp b/wsd/Storage.hpp
index 77a2f675b..2b926eb97 100644
--- a/wsd/Storage.hpp
+++ b/wsd/Storage.hpp
@@ -324,6 +324,7 @@ public:
                      const bool userCanNotWriteRelative,
                      const bool enableInsertRemoteImage,
                      const bool enableShare,
+                     const bool hideUserList,
                      const TriState disableChangeTrackingShow,
                      const TriState disableChangeTrackingRecord,
                      const TriState hideChangeTrackingControls,
@@ -345,6 +346,7 @@ public:
               _userCanNotWriteRelative(userCanNotWriteRelative),
               _enableInsertRemoteImage(enableInsertRemoteImage),
               _enableShare(enableShare),
+              _hideUserList(hideUserList),
               _disableChangeTrackingShow(disableChangeTrackingShow),
               _disableChangeTrackingRecord(disableChangeTrackingRecord),
               _hideChangeTrackingControls(hideChangeTrackingControls),
@@ -432,10 +434,12 @@ public:
         bool _disableInactiveMessages;
         /// If set to false, users can access the save-as functionality
         bool _userCanNotWriteRelative;
-        /// if set to true, users can access the insert remote image functionality
+        /// If set to true, users can access the insert remote image functionality
         bool _enableInsertRemoteImage;
-        /// if set to true, users can access the file share functionality
+        /// If set to true, users can access the file share functionality
         bool _enableShare;
+        /// If set to true, user list on the status bar will be hidden
+        bool _hideUserList;
         /// If we should disable change-tracking visibility by default (meaningful at loading).
         TriState _disableChangeTrackingShow;
         /// If we should disable change-tracking ability by default (meaningful at loading).


More information about the Libreoffice-commits mailing list