Fix reading order setting in ApiParagraph

This commit is contained in:
Eduard Belozertsev
2025-08-07 13:39:12 +07:00
parent 52b9e5ea4c
commit 1105dd079c

View File

@ -10211,8 +10211,12 @@
* @see office-js-api/Examples/{Editor}/ApiParagraph/Methods/SetReadingOrder.js
*/
ApiParagraph.prototype.SetReadingOrder = function (direction) {
const allowed = ['ltr', 'rtl'];
const bidi = allowed.indexOf(direction) === -1 ? null : direction;
let bidi;
switch (direction) {
case 'ltr': bidi = 0; break;
case 'rtl': bidi = 1; break;
default: bidi = null;
}
this.Paragraph.SetApplyToAll(true);
this.Paragraph.SetParagraphBidi(bidi);
this.Paragraph.SetApplyToAll(false);