From 1105dd079cd8c2edba25a97c5096670885057d82 Mon Sep 17 00:00:00 2001 From: Eduard Belozertsev Date: Thu, 7 Aug 2025 13:39:12 +0700 Subject: [PATCH] Fix reading order setting in ApiParagraph --- word/apiBuilder.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/word/apiBuilder.js b/word/apiBuilder.js index 37e388f2cd..a7195ae0b1 100644 --- a/word/apiBuilder.js +++ b/word/apiBuilder.js @@ -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);