Skip to content

Commit

Permalink
[de] Fixed alignment setting for rtl paragraphs
Browse files Browse the repository at this point in the history
  • Loading branch information
KirillovIlya committed Feb 2, 2025
1 parent 4c12a04 commit bbd6dc1
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 10 deletions.
12 changes: 10 additions & 2 deletions word/Editor/Paragraph.js
Original file line number Diff line number Diff line change
Expand Up @@ -16551,9 +16551,17 @@ Paragraph.prototype.GetParagraphBidi = function()
{
return !!this.Get_CompiledPr2(false).ParaPr.Bidi;
};
Paragraph.prototype.SetParagraphAlign = function(Align)
Paragraph.prototype.SetParagraphAlign = function(align)
{
this.Set_Align(Align);
if (this.isRtlDirection())
{
if (AscCommon.align_Left === align)
align = AscCommon.align_Right;
else if (AscCommon.align_Right === align)
align = AscCommon.align_Left;
}

this.Set_Align(align);
};
Paragraph.prototype.GetParagraphAlign = function()
{
Expand Down
19 changes: 11 additions & 8 deletions word/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -4179,15 +4179,18 @@ background-repeat: no-repeat;\
}
return false;
};

asc_docs_api.prototype.put_PrAlign = function(value)
asc_docs_api.prototype.put_PrAlign = function(value)
{
if (false === this.WordControl.m_oLogicDocument.Document_Is_SelectionLocked(changestype_Paragraph_Properties))
{
this.WordControl.m_oLogicDocument.StartAction(AscDFH.historydescription_Document_SetParagraphAlign);
this.WordControl.m_oLogicDocument.SetParagraphAlign(value);
this.WordControl.m_oLogicDocument.FinalizeAction();
}
let logicDocument = this.private_GetLogicDocument();
if (logicDocument.IsSelectionLocked(AscCommon.changestype_Paragraph_Properties))
return;

logicDocument.StartAction(AscDFH.historydescription_Document_SetParagraphAlign);
logicDocument.SetParagraphAlign(value);
logicDocument.UpdateInterface();
logicDocument.Recalculate();
logicDocument.FinalizeAction();
};
// 0- baseline, 2-subscript, 1-superscript
asc_docs_api.prototype.put_TextPrBaseline = function(value)
Expand Down

0 comments on commit bbd6dc1

Please sign in to comment.