Skip to content

Fix #2572: namespace prefixes and calc attributes in worksheet XML - #2575

Merged
JanKallman merged 2 commits into
develop8from
bug/sc1083
Oct 13, 2026
Merged

JanKallman merged 2 commits into
develop8from
bug/sc1083

Conversation

@swmal

@swmal swmal commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

See #2572

When a worksheet uses a namespace prefix for the main schema (e.g. x:, as written by the Open XML SDK), WorksheetXmlWriter wrote some elements without the prefix. These ended up in no namespace, so Excel ignored them or reported the file as corrupt.

Changes

  • Shared formula children (UpdateRowCellData): use fTag instead of a hard-coded <f>.
  • Icon set cfvo (WriteCfIcon, GetCFXML): pass the prefix to WriteCfIcon.
  • dxf children in extLst conditional formatting (UpdateExtLstConditionalFormatting, GetXMLCFExt, WriteStyle): pass the main prefix through, so the children of x14:dxf are written in the main namespace.
  • Calc attributes (SetCalcAttributesForArrayFormula): reset the attribute string for every cell, so aca/ca no longer leak from an array formula to the following formula cells.

Tests

New test class Core/Worksheet/WorksheetXmlWriterTests.cs with four tests, one per case. The prefix tests use a workbook saved by the Open XML SDK and assert that no element in the worksheet XML is written without a namespace. All four tests failed before the fix.

Output verified in Excel: shared formulas are kept, the icon set workbook opens without repair, and the extLst rule keeps its format.

@swmal swmal self-assigned this Oct 12, 2026
@swmal swmal added the bug Something isn't working label Oct 12, 2026
@swmal swmal moved this to PR Backlog in Bug Tracker Oct 12, 2026
@JanKallman
JanKallman merged commit e06129c into develop8 Oct 13, 2026
3 checks passed
@JanKallman
JanKallman deleted the bug/sc1083 branch October 13, 2026 07:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

Status: Pending Release

Development

Successfully merging this pull request may close these issues.

2 participants