Skip to content

Commit 7a418b8

Browse files
authored
LT-22468: Display space between bullet and the text
For a bulleted or numbered list, Flex will now use the hanging indent value for the distance between the bullet/ number and the text that follows. This is similar to how Word uses the hanging indent value. Note that ‘hanging indent’ is still used to determine the indentation for lines after the first line.
1 parent 28e9888 commit 7a418b8

2 files changed

Lines changed: 17 additions & 0 deletions

File tree

Src/xWorks/CssGenerator.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -672,6 +672,17 @@ private static StyleRule AdjustRuleIfParagraphNumberScheme(StyleRule rule, Confi
672672
var wsFontInfo = exportStyleInfo.BulletInfo.FontInfo;
673673
bulletRule.Declarations.Add(new Property("font-size") { Term = new PrimitiveTerm(UnitType.Point, MilliPtToPt(wsFontInfo.FontSize.Value)) });
674674
bulletRule.Declarations.Add(new Property("color") { Term = new PrimitiveTerm(UnitType.RGB, wsFontInfo.FontColor.Value.Name) });
675+
676+
// Add the space between the bullet/number and the text that follows.
677+
if (exportStyleInfo.HasFirstLineIndent && exportStyleInfo.FirstLineIndent < 0)
678+
{
679+
var hangingIndent = -(MilliPtToPt(exportStyleInfo.FirstLineIndent));
680+
string marginDirection = "margin-right";
681+
if (exportStyleInfo.DirectionIsRightToLeft == TriStateBool.triTrue)
682+
marginDirection = "margin-left";
683+
bulletRule.Declarations.Add(new Property(marginDirection) { Term = new PrimitiveTerm(UnitType.Point, hangingIndent) });
684+
}
685+
675686
// remove the bullet content if present in the base rule
676687
var contentInRule = rule.Declarations.FirstOrDefault(p => p.Name == "content");
677688
if (contentInRule != null)

Src/xWorks/WordStylesGenerator.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,12 @@ internal static Style GenerateWordStyleFromLcmStyleSheet(bool paragraphData, str
270270
if (exportStyleInfo.HasFirstLineIndent)
271271
{
272272
// Handles both first-line and hanging indent, hanging-indent will result in a negative text-indent value
273+
// Note: Typically hanging indent is only applied to the lines after the first line. For bulleted/numbered lists,
274+
// it also has a use on the fist line. In Word it represents the distance between the bullet/number and the
275+
// text that follows the bullet/number. For the first line, Word does not honor small hanging indent
276+
// values (0.0" to 0.1"). It displays the distance as 0.2". (For lines after the first, Word does honor the
277+
// small values.) As a result of this behavior, the distance between a bullet/number and the text that follows
278+
// will be different between Flex and Word if the hanging indent value is less than 0.1".
273279
var firstLineIndentValue = MilliPtToTwentiPt(exportStyleInfo.FirstLineIndent);
274280

275281
if (firstLineIndentValue < 0.0f)

0 commit comments

Comments
 (0)