Skip to content

Commit

Permalink
Word Export: RTL – Set first column to be on the right
Browse files Browse the repository at this point in the history
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
  • Loading branch information
mark-sil committed Dec 11, 2024
1 parent d44d14f commit b982f8f
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions Src/xWorks/LcmWordGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)));
}

Expand All @@ -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;
Expand Down

0 comments on commit b982f8f

Please sign in to comment.