From 0a7ca3a57d4e82d082ad62ecc62c64fb8c6eb5e1 Mon Sep 17 00:00:00 2001 From: mark-sil <83427558+mark-sil@users.noreply.github.com> Date: Tue, 17 Feb 2026 12:04:49 -0500 Subject: [PATCH] LT-22344: Word Export: Fix BulletAndNumbering error --- Src/xWorks/LcmWordGenerator.cs | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/Src/xWorks/LcmWordGenerator.cs b/Src/xWorks/LcmWordGenerator.cs index 02fc8e2cd6..d6e0923786 100644 --- a/Src/xWorks/LcmWordGenerator.cs +++ b/Src/xWorks/LcmWordGenerator.cs @@ -2561,15 +2561,19 @@ private void AddBulletAndNumberingData(IFragment elementContent, ListPart of the Word doc where bullet and numbering data is stored. internal static void GenerateBulletAndNumberingData(ParagraphElement styleElement, NumberingDefinitionsPart numberingPart) { - if (!styleElement.BulletInfo.HasValue) + // In most situations we are not expecting BulletAndNumberingUniqueId to be null if BulletInfo + // is not null. If that happens, and a bulleted or numbered list is not being displayed correctly + // in Word, then most likely either there is another place where we need to call AddBulletAndNumberingData() + // or some check in AddBulletAndNumberingData() is preventing BulletAndNumberingUniqueId from being set. + // + // Note: If the 'Bullet and Numbering' for the 'Normal' paragraph style is set to 'Number', + // then we will get in this method when BulletInfo has a value but BulletAndNumberingUniqueId + // does not (LT-22344). + if (!styleElement.BulletInfo.HasValue || !styleElement.BulletAndNumberingUniqueId.HasValue) { return; } - // Not expecting this to be null if BulletInfo is not null. If we hit this assert then - // most likely there is another place where we need to call AddBulletAndNumberingData(). - Debug.Assert(styleElement.BulletAndNumberingUniqueId.HasValue); - var bulletInfo = styleElement.BulletInfo.Value; var bulletUniqueId = styleElement.BulletAndNumberingUniqueId.Value; var numScheme = bulletInfo.m_numberScheme;