From 1f344b69912254a22022787d6183f9949f44c1dc Mon Sep 17 00:00:00 2001 From: Ilya Kirillov Date: Wed, 19 Feb 2025 17:07:24 +0300 Subject: [PATCH] [oform] Add ability to set NoRole as a current role --- common/api/restrictionSettings.js | 19 +++++++++++++++---- word/api.js | 5 ++++- 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/common/api/restrictionSettings.js b/common/api/restrictionSettings.js index 9a731f4186..82d91048a3 100644 --- a/common/api/restrictionSettings.js +++ b/common/api/restrictionSettings.js @@ -40,8 +40,9 @@ */ function CRestrictionSettings() { - this.OFormRole = undefined; - this.ResetNone = false; + this.OFormRole = undefined; + this.OFormNoRole = false; + this.ResetNone = false; } CRestrictionSettings.prototype.GetOFormRole = function() { @@ -51,12 +52,22 @@ { this.OFormRole = roleName; }; + CRestrictionSettings.prototype.IsOFormNoRole = function() + { + return this.OFormNoRole; + }; + CRestrictionSettings.prototype.SetOFormNoRole = function(noRole) + { + this.OFormNoRole = noRole; + }; //--------------------------------------------------------export---------------------------------------------------- window['AscCommon'] = window['AscCommon'] || {}; window['AscCommon'].CRestrictionSettings = CRestrictionSettings; window['AscCommon']["CRestrictionSettings"] = CRestrictionSettings; - CRestrictionSettings.prototype['get_OFormRole'] = CRestrictionSettings.prototype.GetOFormRole; - CRestrictionSettings.prototype['put_OFormRole'] = CRestrictionSettings.prototype.SetOFormRole; + CRestrictionSettings.prototype['get_OFormRole'] = CRestrictionSettings.prototype.GetOFormRole; + CRestrictionSettings.prototype['put_OFormRole'] = CRestrictionSettings.prototype.SetOFormRole; + CRestrictionSettings.prototype['get_OFormNoRole'] = CRestrictionSettings.prototype.IsOFormNoRole; + CRestrictionSettings.prototype['put_OFormNoRole'] = CRestrictionSettings.prototype.SetOFormNoRole; })(window); diff --git a/word/api.js b/word/api.js index 4b0a6ee96e..14979d8f9b 100644 --- a/word/api.js +++ b/word/api.js @@ -13709,7 +13709,10 @@ background-repeat: no-repeat;\ if (oform) { let roleName = restrictionSettings ? restrictionSettings.GetOFormRole() : null; - if (oLogicDocument.IsFillingFormMode() && roleName) + + if (oLogicDocument.IsFillingFormMode() && restrictionSettings && restrictionSettings.IsOFormNoRole()) + oform.setCurrentNoRole(); + else if (oLogicDocument.IsFillingFormMode() && roleName) oform.setCurrentRole(roleName); else oform.clearCurrentRole();