From d4a4476f473ebb2e36a1cd97451cab7076e7bc02 Mon Sep 17 00:00:00 2001 From: Ilya Kirillov Date: Fri, 10 Oct 2025 17:54:37 +0300 Subject: [PATCH] Fix bug #77520 Don't treat complex field with out ffData as a form field --- word/Editor/Paragraph/ComplexField.js | 7 ++++++- word/Editor/Paragraph/ComplexFields/ffdata.js | 4 ++++ word/Editor/Run.js | 2 +- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/word/Editor/Paragraph/ComplexField.js b/word/Editor/Paragraph/ComplexField.js index 3e9fb11bf2..3b77eda29b 100644 --- a/word/Editor/Paragraph/ComplexField.js +++ b/word/Editor/Paragraph/ComplexField.js @@ -2093,7 +2093,12 @@ CComplexField.prototype.IsFormFieldEnabled = function() }; CComplexField.prototype.IsFormCheckBox = function() { - return this.CheckType(AscWord.fieldtype_FORMCHECKBOX); + if (!this.CheckType(AscWord.fieldtype_FORMCHECKBOX)) + return false; + + let beginChar = this.GetBeginChar(); + let ffData = beginChar ? beginChar.GetFFData() : null; + return ffData && ffData.isCheckBox(); }; CComplexField.prototype.ToggleFormCheckBox = function() { diff --git a/word/Editor/Paragraph/ComplexFields/ffdata.js b/word/Editor/Paragraph/ComplexFields/ffdata.js index 186e9437f9..a1b25a90ef 100644 --- a/word/Editor/Paragraph/ComplexFields/ffdata.js +++ b/word/Editor/Paragraph/ComplexFields/ffdata.js @@ -200,6 +200,10 @@ writer.WriteLong(flags); writer.Seek(endPos); }; + FFData.prototype.isCheckBox = function() + { + return (!!this.checkBox); + }; FFData.fromBinary = function(reader) { let ffData = new FFData(); diff --git a/word/Editor/Run.js b/word/Editor/Run.js index 9df54e968c..c5b0d0699e 100644 --- a/word/Editor/Run.js +++ b/word/Editor/Run.js @@ -4861,7 +4861,7 @@ ParaRun.prototype.Recalculate_Range = function(PRS, ParaPr, Depth) } isVisualFieldChar = true; } - else if (oInstruction && AscWord.fieldtype_FORMCHECKBOX === oInstruction.GetType()) + else if (oComplexField.IsFormCheckBox()) { isVisualFieldChar = true; Item.SetFormCheckBox(true);