Skip to content

Refactoring of string data handling in OpenXmlWriter#961

Merged
michelebastione merged 10 commits into
mini-software:masterfrom
michelebastione:data-types-refactoring
May 17, 2026
Merged

Refactoring of string data handling in OpenXmlWriter#961
michelebastione merged 10 commits into
mini-software:masterfrom
michelebastione:data-types-refactoring

Conversation

@michelebastione
Copy link
Copy Markdown
Collaborator

  • Corrected the implementation of inline string cells by marking them with the inlineStr data type instead of the str one and replacing the <v> tag with the <is><t> for their contents.
  • Added support for shared strings storage when exporting, wired to the new OpenXmlConfiguration option StringStorageMode
  • Added documentation and a new check for invalid sheet name characters to OpenXmlExporter methods
  • Various minor code cleanups

Corrected oversight that prevented numerical string to be read as text by Excel when exported even if exported with the format `"@"`
Modifies the cell witing process of string content replacing the <v> tag with <is><t> tags and changes the cell data type from "str" to "inlineStr" in order to adhere to the OpenXml specification for inlined strings
Implemented shared strings handling across the OpenXmlWriter and wired it to the new OpenXmlConfiguration option StringStorageMode.
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request refactors the OpenXml implementation to support a new StringStorageMode (Inline vs. Shared), updates namespaces for consistency, and improves resource disposal in MiniExcelStreamWriter. Key changes include the introduction of shared string support during export, enhanced sheet name validation, and the consolidation of OpenXml API classes. Feedback from the reviewer highlights several critical areas for improvement: ensuring consistent XML encoding by moving it to the XML generation layer rather than the value retrieval stage, correcting the count attribute in the shared strings table, and fixing typos in exception and error messages.

Comment thread src/MiniExcel.OpenXml/Constants/ExcelXml.cs Outdated
Comment thread src/MiniExcel.OpenXml/Constants/WorksheetXml.cs Outdated
Comment thread src/MiniExcel.OpenXml/OpenXmlWriter.DefaultOpenXml.cs Outdated
Comment thread src/MiniExcel.OpenXml/OpenXmlWriter.DefaultOpenXml.cs Outdated
Comment thread src/MiniExcel.OpenXml/OpenXmlWriter.DefaultOpenXml.cs Outdated
Comment thread src/MiniExcel.OpenXml/OpenXmlWriter.DefaultOpenXml.cs Outdated
Comment thread src/MiniExcel.OpenXml/OpenXmlWriter.cs Outdated
Comment thread src/MiniExcel.OpenXml/Constants/ExcelXml.cs Outdated
Comment thread src/MiniExcel.OpenXml/Helpers/ThrowHelper.cs Outdated
Comment thread src/MiniExcel.OpenXml/OpenXmlWriter.cs Outdated
@michelebastione michelebastione merged commit cfab654 into mini-software:master May 17, 2026
3 checks passed
@michelebastione michelebastione deleted the data-types-refactoring branch May 17, 2026 00:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant