From c09fea6ca62d30dd1fae617d3b40bd483471fcd6 Mon Sep 17 00:00:00 2001 From: Ariel Rorabaugh Date: Mon, 15 Apr 2024 16:11:26 -0400 Subject: [PATCH] Add StyleNames to style definitions in Word export - Fixes styles not linking with the style sheet in Microsoft Word. - Fixes styles not appearing in LibreOffice. Change-Id: I433acde125f638f963b35bcbb9b92b319062cb9a --- Src/xWorks/WordStylesGenerator.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Src/xWorks/WordStylesGenerator.cs b/Src/xWorks/WordStylesGenerator.cs index d0dea0b589..9c389f9242 100644 --- a/Src/xWorks/WordStylesGenerator.cs +++ b/Src/xWorks/WordStylesGenerator.cs @@ -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();