Compare commits

...

11 Commits

Author SHA1 Message Date
1970ce1d9b Merge branch release/v7.4.0 into master 2023-06-13 11:23:34 +00:00
5fa0d5013e Merge remote-tracking branch 'remotes/origin/hotfix/v7.3.3' into release/v7.4.0 2023-05-17 19:55:04 +05:00
93f3d5c0c9 Fix bug #62455
Fix issue with minimization
2023-05-04 13:56:34 +03:00
390d472b51 Fix bug #62375
Fix positioning of the added fixed form
2023-05-02 16:30:03 +03:00
e8037d127e Merge pull request #37 from ONLYOFFICE/feature/spi-docs
Api documentation
2023-04-28 18:48:27 +05:00
25754f8445 updated api docs 2023-04-28 16:42:25 +03:00
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
8a0aa0fdb4 Merge branch hotfix/v7.3.3 into master 2023-03-15 10:51:27 +00:00
b4073edd9a [oform] Fix problem with lock check when setting form value 2023-02-08 23:52:26 +05:00
2 changed files with 46 additions and 9 deletions

47
api.js
View File

@ -488,6 +488,11 @@ window["AscOForm"] = window.AscOForm = AscOForm;
|| !oForm.IsForm())
return;
// При проверке лока внутри параграфа мы ориентируемся на выделение внутри этого параграфа
// поэтому нужно выделить форму
let state = oLogicDocument.SaveDocumentState();
oForm.SelectContentControl();
let oParagraph = oForm.GetParagraph();
oForm.SkipFillingFormModeCheck(true);
@ -499,10 +504,12 @@ window["AscOForm"] = window.AscOForm = AscOForm;
CheckType : AscCommon.changestype_Paragraph_Content
}, true, oLogicDocument.IsFillingFormMode()))
{
oLogicDocument.LoadDocumentState(state);
oForm.SkipFillingFormModeCheck(false);
oForm.SkipSpecialContentControlLock(false);
return;
}
oLogicDocument.LoadDocumentState(state);
oForm.SkipFillingFormModeCheck(false);
oForm.SkipSpecialContentControlLock(false);
@ -513,10 +520,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 +573,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,17 +646,34 @@ 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();
if (drawing)
{
logicDocument.Recalculate(true);
let x = drawing.Internal_Position.Calculate_X_Value(Asc.c_oAscRelativeFromH.Page);
let y = drawing.Internal_Position.Calculate_Y_Value(Asc.c_oAscRelativeFromV.Page);
let drawingPr = new Asc.asc_CImgProperty();
drawingPr.asc_putWrappingStyle(Asc.c_oAscWrapStyle2.Square);
drawing.Set_Props(drawingPr);
form.MoveCursorToContentControl(false);
let positionH = new Asc.CImagePositionH();
drawingPr.asc_putPositionH(positionH);
positionH.put_UseAlign(false);
positionH.put_RelativeFrom(Asc.c_oAscRelativeFromH.Page);
positionH.put_Value(x);
let positionV = new Asc.CImagePositionV();
drawingPr.asc_putPositionV(positionV);
positionV.put_UseAlign(false);
positionV.put_RelativeFrom(Asc.c_oAscRelativeFromV.Page);
positionV.put_Value(y);
drawing.Set_Props(drawingPr);
drawing.SelectAsDrawing();
}
}
}

View File

@ -80,8 +80,8 @@
/**
* Form insertion specific properties.
* @typedef {Object} FormInsertPr
* @property {boolean} [placeholderFromSelection=false] - Specifies if the currently selected text should be saved as placeholder for the inserted form.
* @property {boolean} [keepSelectedTextInForm=true] - Specifies if the currently selected text should be saved as content for the inserted form.
* @property {boolean} [placeholderFromSelection=false] - Specifies if the currently selected text should be saved as a placeholder of the inserted form.
* @property {boolean} [keepSelectedTextInForm=true] - Specifies if the currently selected text should be saved as the content of the inserted form.
*/
/**
@ -340,9 +340,9 @@
return new AscBuilder.ApiPictureForm(oCC);
};
/**
* Insert a text box with the specified text box properties over of the selected text.
* Inserts a text box with the specified text box properties over the selected text.
* @memberof ApiDocument
* @param {TextFormPr} oFormPr - Text field properties.
* @param {TextFormInsertPr} oFormPr - Properties for inserting a text field.
* @returns {ApiTextForm}
*/
ApiDocument.prototype.InsertTextForm = function(oFormPr)