Compare commits

...

3 Commits

Author SHA1 Message Date
03adca5bad [de] Fix specifying a default value for date time picker 2023-04-24 15:10:07 +05:00
6879b71ab1 Fix bug #62162
Select fixed form as the shape when adding it to the document
2023-04-19 16:26:53 +05:00
46411f2cb4 For bug #62024
Forbid to add fixed forms inside a shape
2023-04-19 02:52:49 +05:00

23
api.js
View File

@ -513,10 +513,10 @@ window["AscOForm"] = window.AscOForm = AscOForm;
{
isClear = true;
}
else if (oForm.IsTextForm() || oForm.IsComboBox() || oForm.IsDatePicker())
else if (oForm.IsTextForm() || oForm.IsComboBox())
{
let sValue = AscBuilder.GetStringParameter(value, "");
if (!value)
if (!sValue)
isClear = true;
else
oForm.SetInnerText(sValue);
@ -566,6 +566,19 @@ window["AscOForm"] = window.AscOForm = AscOForm;
isClear = true;
}
}
else if (oForm.IsDatePicker())
{
let sValue = AscBuilder.GetStringParameter(value, "");
if (!sValue)
isClear = true;
else
oForm.SetInnerText(sValue);
// TODO: Надо FullDate попытаться выставить по заданному значение. Сейчас мы всегда сбрасываем на текущую дату
let datePickerPr = oForm.GetDatePickerPr().Copy();
datePickerPr.SetFullDate(null);
oForm.SetDatePickerPr(datePickerPr);
}
if (isClear)
oForm.ClearContentControlExt();
@ -626,7 +639,8 @@ window["AscOForm"] = window.AscOForm = AscOForm;
form.private_FillPlaceholderContent();
}
if (form.IsMainForm() && formPr.GetFixed())
let paragraph = form.GetParagraph();
if (form.IsMainForm() && formPr.GetFixed() && (!paragraph || !paragraph.GetParentShape()))
{
logicDocument.Recalculate(true);
let drawing = form.ConvertFormToFixed();
@ -635,8 +649,7 @@ window["AscOForm"] = window.AscOForm = AscOForm;
let drawingPr = new Asc.asc_CImgProperty();
drawingPr.asc_putWrappingStyle(Asc.c_oAscWrapStyle2.Square);
drawing.Set_Props(drawingPr);
form.MoveCursorToContentControl(false);
drawing.SelectAsDrawing();
}
}
}