Skip to content

Commit

Permalink
[de] Make fixed form square wrapping by default
Browse files Browse the repository at this point in the history
  • Loading branch information
KirillovIlya committed Jul 19, 2023
1 parent fccabc1 commit b3cf486
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions word/Editor/StructuredDocumentTags/InlineLevel.js
Original file line number Diff line number Diff line change
Expand Up @@ -3054,13 +3054,16 @@ CInlineLevelSdt.prototype.ConvertFormToFixed = function(nW, nH)
|| oParagraph.IsInFixedForm())
return null;

let oParaDrawing = this.private_ConvertFormToFixed(nW, nH);
oParaDrawing.Set_PositionH(Asc.c_oAscRelativeFromH.Page, false, X, false);
oParaDrawing.Set_PositionV(Asc.c_oAscRelativeFromV.Page, false, Y, false);
oParaDrawing.Set_Distance(0, 0, 0, 0);
let drawing = this.private_ConvertFormToFixed(nW, nH);
drawing.Set_PositionH(Asc.c_oAscRelativeFromH.Page, false, X, false);
drawing.Set_PositionV(Asc.c_oAscRelativeFromV.Page, false, Y, false);
drawing.Set_Distance(0, 0, 0, 0);
drawing.Set_DrawingType(drawing_Anchor);
drawing.Set_WrappingType(WRAPPING_TYPE_SQUARE);
drawing.Set_BehindDoc(false);

var oRun = new ParaRun(oParagraph, false);
oRun.AddToContent(0, oParaDrawing);
oRun.AddToContent(0, drawing);

// Этот код выравнивает позицию рана по вертикали, чтобы после конвертации типа формы текст внутри автофигуры
// визуально оставался на месте, но сама настройка позиции по вертикали вызывает много непонятных ситуаций у
Expand Down Expand Up @@ -3095,7 +3098,7 @@ CInlineLevelSdt.prototype.ConvertFormToFixed = function(nW, nH)
this.SetTextFormPr(oNewPr);
}

return oParaDrawing;
return drawing;
};
CInlineLevelSdt.prototype.private_ConvertFormToFixed = function(nW, nH)
{
Expand Down

0 comments on commit b3cf486

Please sign in to comment.