Completed
Last Updated: 04 Nov 2019 11:19 by ADMIN
Release LIB 2019.3.1104 (11/04/2019)
Matt
Created on: 29 Oct 2019 14:18
Category: WordsProcessing
Type: Bug Report
0
WordsProcessing: StackOverflowException is thrown while evaluating the values of style linked to a table style
When importing a table style, which has the w:link attribute, the style is linked with the style whose ID is the link attribute's value. However, according to the specification, If the parent style is a table style, then the link element shall be ignored. DocxFormatProvider doesn't ignore this case and links the styles which might lead to StackOverflowException during the style property value evaluation.

Workaround: Remove the Linked style from table styles:
foreach (var style in this.document.StyleRepository.Styles)
{
    if (style.StyleType == StyleType.Table)
    {
        if (style.LinkedStyleId != null)
        {
            style.LinkedStyleId = null;
        }
    }
}

0 comments