[feature] Rename textParams to {documentRenderer: {textAssociation: "plainParagraph"}}

This commit is contained in:
Sergey Konovalov
2022-02-04 00:16:10 +03:00
committed by Sergey Konovalov
parent b4d72bc7f8
commit 97dda5a991

View File

@ -290,24 +290,23 @@ function convertRequest(req, res, isJson) {
cmd.setOutputFormat(constants.AVS_OFFICESTUDIO_FILE_IMAGE);
}
}
var textParams = params.textParams;
if (textParams) {
if (typeof textParams === 'string') {
textParams = JSON.parse(textParams);
var documentRenderer = params.documentRenderer;
if (documentRenderer) {
if (typeof documentRenderer === 'string') {
documentRenderer = JSON.parse(documentRenderer);
}
var textParamsData = new commonDefines.CTextParams(textParams);
//todo text
switch (textParams.association) {
case 'block':
var textParamsData = new commonDefines.CTextParams();
switch (documentRenderer.textAssociation) {
case 'plainParagraph':
textParamsData.setAssociation(3);
break;
case 'noFrames':
case 'plainLine':
textParamsData.setAssociation(2);
break;
case 'line':
case 'blockLine':
textParamsData.setAssociation(1);
break;
case 'char':
case 'blockChar':
default:
textParamsData.setAssociation(0);
break;