diff --git a/Src/xWorks/WordStylesGenerator.cs b/Src/xWorks/WordStylesGenerator.cs index a3de5d4ada..0872ee1227 100644 --- a/Src/xWorks/WordStylesGenerator.cs +++ b/Src/xWorks/WordStylesGenerator.cs @@ -336,16 +336,15 @@ internal static Style GenerateWordStyleFromLcmStyleSheet(bool paragraphData, str parProps.Append(new SpacingBetweenLines() { Line = lineHeight.ToString(), LineRule = LineSpacingRuleValues.Exact }); } } - if (exportStyleInfo.HasSpaceAfter) - { - parProps.Append(new SpacingBetweenLines() { After = MilliPtToTwentiPt(exportStyleInfo.SpaceAfter).ToString() }); - } - if (exportStyleInfo.HasSpaceBefore) - { - parProps.Append(new SpacingBetweenLines() { Before = MilliPtToTwentiPt(exportStyleInfo.SpaceBefore).ToString() }); - } } + // Set the space before and after the line, even if the value is zero. If we do not set the value + // then Word generates a value, sometimes 8 or 24 point. + int spaceAfter = exportStyleInfo.HasSpaceAfter ? exportStyleInfo.SpaceAfter : 0; + int spaceBefore = exportStyleInfo.HasSpaceBefore ? exportStyleInfo.SpaceBefore : 0; + parProps.Append(new SpacingBetweenLines() { After = MilliPtToTwentiPt(spaceAfter).ToString() }); + parProps.Append(new SpacingBetweenLines() { Before = MilliPtToTwentiPt(spaceBefore).ToString() }); + if (exportStyleInfo.HasTrailingIndent) { parProps.Append(new Indentation() { Right = MilliPtToTwentiPt(exportStyleInfo.TrailingIndent).ToString() });