From c79aa4507ea0579bc9802e4f869e373fd24120d3 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Tue, 1 Feb 2022 20:04:34 +0300 Subject: [PATCH] [DE] Fix Bug 41546 --- apps/documenteditor/main/app/controller/Main.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/apps/documenteditor/main/app/controller/Main.js b/apps/documenteditor/main/app/controller/Main.js index 3aee58441..483c8f70b 100644 --- a/apps/documenteditor/main/app/controller/Main.js +++ b/apps/documenteditor/main/app/controller/Main.js @@ -1381,6 +1381,8 @@ define([ if ( this.onServerVersion(params.asc_getBuildVersion()) || !this.onLanguageLoaded()) return; + var isPDFViewer = /^(?:(pdf|djvu|xps|oxps))$/.test(this.document.fileType); + this.permissions.review = (this.permissions.review === undefined) ? (this.permissions.edit !== false) : this.permissions.review; if (params.asc_getRights() !== Asc.c_oRights.Edit) @@ -1409,8 +1411,8 @@ define([ this.appOptions.canUseMailMerge= this.appOptions.canLicense && this.appOptions.canEdit && !this.appOptions.isOffline; this.appOptions.canSendEmailAddresses = this.appOptions.canLicense && this.editorConfig.canSendEmailAddresses && this.appOptions.canEdit && this.appOptions.canCoAuthoring; this.appOptions.canComments = this.appOptions.canLicense && (this.permissions.comment===undefined ? this.appOptions.isEdit : this.permissions.comment) && (this.editorConfig.mode !== 'view'); - this.appOptions.canComments = this.appOptions.canComments && !((typeof (this.editorConfig.customization) == 'object') && this.editorConfig.customization.comments===false); - this.appOptions.canViewComments = this.appOptions.canComments || !((typeof (this.editorConfig.customization) == 'object') && this.editorConfig.customization.comments===false); + this.appOptions.canComments = !isPDFViewer && this.appOptions.canComments && !((typeof (this.editorConfig.customization) == 'object') && this.editorConfig.customization.comments===false); + this.appOptions.canViewComments = this.appOptions.canComments || !isPDFViewer && !((typeof (this.editorConfig.customization) == 'object') && this.editorConfig.customization.comments===false); this.appOptions.canChat = this.appOptions.canLicense && !this.appOptions.isOffline && !(this.permissions.chat===false || (this.permissions.chat===undefined) && (typeof (this.editorConfig.customization) == 'object') && this.editorConfig.customization.chat===false); if ((typeof (this.editorConfig.customization) == 'object') && this.editorConfig.customization.chat!==undefined) { @@ -1464,7 +1466,7 @@ define([ var type = /^(?:(djvu))$/.exec(this.document.fileType); this.appOptions.canDownloadOrigin = this.permissions.download !== false && (type && typeof type[1] === 'string'); this.appOptions.canDownload = this.permissions.download !== false && (!type || typeof type[1] !== 'string'); - this.appOptions.canUseSelectHandTools = this.appOptions.canUseThumbnails = this.appOptions.canUseViwerNavigation = /^(?:(pdf|djvu|xps|oxps))$/.test(this.document.fileType); + this.appOptions.canUseSelectHandTools = this.appOptions.canUseThumbnails = this.appOptions.canUseViwerNavigation = isPDFViewer; this.appOptions.canDownloadForms = this.appOptions.canLicense && this.appOptions.canDownload; this.appOptions.fileKey = this.document.key;