Don't treat complex field with out ffData as a form field
This commit is contained in:
Ilya Kirillov
2025-10-10 17:54:37 +03:00
parent 98521f654c
commit d4a4476f47
3 changed files with 11 additions and 2 deletions

View File

@ -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()
{

View File

@ -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();

View File

@ -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);