Skip to content

Read stylesheets with non-contiguous xfId's

Scott Barnes requested to merge topic/3.1/issue-1457 into branch/3.1

Currently Openpyxl cannot properly read stylesheets which contain valid but non-contiguous xfId's in the <cellStyles> elements. In the process of renumbering the xfId's, the incoming style information is lost. This MR moves responsibility for renumbering the xfId's from the _NamedStyleCellList.names() method to the Stylesheet._merge_named_styles() method, which allows Stylesheet._expand_named_style() to work as intended.

See also #1457 (comment 329545) for an example.

The "pypy3" and "python312" failed CI tests are unrelated to any changes being made here.

Closes #1457 (closed).

--HG-- branch : 3.1

Merge request reports

Loading