Skip to content

Commit

Permalink
Add StyleNames to style definitions in Word export
Browse files Browse the repository at this point in the history
- Fixes styles not linking with the style sheet in Microsoft Word.
- Fixes styles not appearing in LibreOffice.

Change-Id: I433acde125f638f963b35bcbb9b92b319062cb9a
  • Loading branch information
aror92 committed Apr 15, 2024
1 parent b800cf5 commit c09fea6
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Src/xWorks/WordStylesGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,10 @@ internal static Style GenerateWordStyleFromLcmStyleSheet(
var projectStyle = styleSheet.Styles[styleName];
var exportStyleInfo = new ExportStyleInfo(projectStyle);
var exportStyle = new Style();
// StyleId is used for style linking in the xml.
exportStyle.StyleId = styleName.Trim('.');
// StyleName is the name a user will see for the given style in Word's style sheet.
exportStyle.Append(new StyleName() {Val = exportStyle.StyleId});
var parProps = new ParagraphProperties();
var runProps = new StyleRunProperties();

Expand Down

0 comments on commit c09fea6

Please sign in to comment.