Repository navigation
XLSX: keep the sensitivity label, table column data formats and sheet custom properties on save - #867
marcoarnulfo wants to merge 3 commits into
Conversation
… custom properties on save (fixes storytold#865)
|
Thanks @marcoarnulfo, this fully fixes #865 on Windows. I tested it with the same real-world
Also checked: all 131 tables and the VBA project survive. While testing I found one more thing that #865 didn't cover: styling set on the |
|
Thanks a lot for running it on the real file, that's way better than any fixture I had 🙌 Good catch on the |
|
Thanks @marcoarnulfo, please go ahead with #1209, it makes sense alongside #867. Happy to test it on the same workbook when it's ready. |
|
Great, on it! I'll bring this branch up to date with main first (it's conflicting now), then open #1209 on top of it. I'll ping you when it's ready to test. |
Fixes #865.
None of the three were in the #330 pass-through or the model, so a plain open and save dropped them. The sensitivity label is a package-root part (
classificationlabelsrelationship todocMetadata/LabelInfo.xml), so it now goes through the same path as custom document properties. Sheet<customProperties>and theircustomPropertyN.binparts are kept like printer settings and controls, and written after<colBreaks>where the schema puts them; unlike controls they don't need the VML drawing.dataDxfIdanddataCellStyleare now read intoTableColumn(the dxf as a style, like conditional formats) and written back. The cell style name is only written when that named style is still in the workbook, so a deleted style can't leave a dangling reference (happy to switch to always writing it).The form-control button anchor in the drawing part (the fourth row in the issue) isn't touched here: the drawing is rewritten by GridCraft, and the button's VML and ctrlProp were already kept.
This touches the same pass-through code as #863 (XML maps); whichever lands second will need a small rebase, which I'll do.
Validation:
passthrough_tests::sensitivity_label_and_sheet_custom_properties_survive_save: fails on main (noclassificationlabelsrelationship in the output), passes herefixtures::table_column_data_formats_survive_save: fails on main (dataCellStylemissing on the column), passes herecargo test -p gridcraft-xlsx --lib -- tests::passthrough_tests tests::fixtures tests::roundtrip tests::array_export tests::pivot_testscargo clippy -p gridcraft-xlsx -p gridcraft-model -p gridcraft-engine -p gridcraft-calc --all-targets -- -D warnings,cargo fmt --all -- --check