From b982f8f8a83f92de6a22ca3c83b2e4353178ad8c Mon Sep 17 00:00:00 2001 From: mark-sil Date: Wed, 11 Dec 2024 13:50:36 -0500 Subject: [PATCH] =?UTF-8?q?Word=20Export:=20RTL=20=E2=80=93=20Set=20first?= =?UTF-8?q?=20column=20to=20be=20on=20the=20right?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit For right to left documents this sets every section so that the column on the right is filled first. With this change the user no longer needs to do the following steps in the Word document: In the Layout tab, click the icon at the lower right of the Page Setup section, and in the dialog that comes up, set Section direction: to Right-to-left. This is critical for RTL documents so that the first column on the page is on the right side. Change-Id: I52848598e4a5b6dc9931a05e276d092d469e5b77 --- Src/xWorks/LcmWordGenerator.cs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/Src/xWorks/LcmWordGenerator.cs b/Src/xWorks/LcmWordGenerator.cs index c5194a12e7..388879ee1c 100644 --- a/Src/xWorks/LcmWordGenerator.cs +++ b/Src/xWorks/LcmWordGenerator.cs @@ -140,6 +140,11 @@ public static void SavePublishedDocx(int[] entryHvos, DictionaryPublicationDecor new Columns() { EqualWidth = true, ColumnCount = 2 }, new SectionType() { Val = SectionMarkValues.Continuous } ); + // Set the section to BiDi so the columns are displayed right to left. + if (IsBidi) + { + sectProps.Append(new BiDi()); + } fragment.DocBody.Append(sectProps); if (progress != null) @@ -329,6 +334,11 @@ internal static DocFragment GenerateLetterHeaderDocFragment(string str, string s new Columns() { EqualWidth = true, ColumnCount = 2 }, new SectionType() { Val = SectionMarkValues.Continuous } ); + // Set the section to BiDi so the columns are displayed right to left. + if (IsBidi) + { + sectProps2.Append(new BiDi()); + } docFrag.DocBody.AppendChild(new WP.Paragraph(new WP.ParagraphProperties(sectProps2))); } @@ -349,6 +359,11 @@ internal static DocFragment GenerateLetterHeaderDocFragment(string str, string s new Columns() { EqualWidth = true, ColumnCount = 1 }, new SectionType() { Val = SectionMarkValues.Continuous } ); + // Set the section to BiDi so the columns are displayed right to left. + if (IsBidi) + { + sectProps1.Append(new BiDi()); + } docFrag.DocBody.AppendChild(new WP.Paragraph(new WP.ParagraphProperties(sectProps1))); } return docFrag;