Skip to content

Commit 23632d2

Browse files
authored
LT-22344: Word Export: Fix BulletAndNumbering error
1 parent 89e54ef commit 23632d2

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

Src/xWorks/LcmWordGenerator.cs

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2561,15 +2561,19 @@ private void AddBulletAndNumberingData(IFragment elementContent, List<Configurab
25612561
/// <param name="numberingPart">Part of the Word doc where bullet and numbering data is stored.</param>
25622562
internal static void GenerateBulletAndNumberingData(ParagraphElement styleElement, NumberingDefinitionsPart numberingPart)
25632563
{
2564-
if (!styleElement.BulletInfo.HasValue)
2564+
// In most situations we are not expecting BulletAndNumberingUniqueId to be null if BulletInfo
2565+
// is not null. If that happens, and a bulleted or numbered list is not being displayed correctly
2566+
// in Word, then most likely either there is another place where we need to call AddBulletAndNumberingData()
2567+
// or some check in AddBulletAndNumberingData() is preventing BulletAndNumberingUniqueId from being set.
2568+
//
2569+
// Note: If the 'Bullet and Numbering' for the 'Normal' paragraph style is set to 'Number',
2570+
// then we will get in this method when BulletInfo has a value but BulletAndNumberingUniqueId
2571+
// does not (LT-22344).
2572+
if (!styleElement.BulletInfo.HasValue || !styleElement.BulletAndNumberingUniqueId.HasValue)
25652573
{
25662574
return;
25672575
}
25682576

2569-
// Not expecting this to be null if BulletInfo is not null. If we hit this assert then
2570-
// most likely there is another place where we need to call AddBulletAndNumberingData().
2571-
Debug.Assert(styleElement.BulletAndNumberingUniqueId.HasValue);
2572-
25732577
var bulletInfo = styleElement.BulletInfo.Value;
25742578
var bulletUniqueId = styleElement.BulletAndNumberingUniqueId.Value;
25752579
var numScheme = bulletInfo.m_numberScheme;

0 commit comments

Comments
 (0)