Repository navigation
XLSX: keep "remove personal information on save" and honour it (part of #3089) - #3238
Conversation
Excel's per-workbook privacy setting (Trust Center › Privacy Options › Remove personal information from file properties on save, set by the Document Inspector) is saved as <workbookPr filterPrivacy="1"/>, and while it is on Excel leaves the author and company empty on save. GridCraft dropped the attribute, so a cleaned workbook came back with the setting off, and it wrote the author and company back. Workbook.remove_personal_info now keeps the setting (read and written as filterPrivacy), and while it is on the writer leaves dc:creator and Company out. Other properties are written as before. Note authors and lastModifiedBy are the rest of the issue (the latter overlaps storytold#881). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 5 minutes. View limit details
Walkthrough
Merge Risk:
|
…iter Addresses CodeRabbit review on storytold#3238, "Limit the remove_personal_info doc comment to XLSX saves": only the XLSX writer leaves out the author and company; the workbook's own serialization still holds them. The comment now says so. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Merged — thank you @hectorviov for the contribution! |
Part of #3089: fixes the file part. The setting is now kept through open and save, and honoured for the author and company. Note authors made generic,
lastModifiedBy(which overlaps PR #881) and a command or Options control for the setting are still open, so this PR doesn't close the issue.What
Excel has a per-workbook privacy setting: Trust Center › Privacy Options › "Remove personal information from file properties on save". The Document Inspector also turns it on. Excel saves it as
<workbookPr filterPrivacy="1"/>, and while it's on, Excel leaves the author and company empty on every save. GridCraft dropped the attribute. So a cleaned workbook opened and saved in GridCraft came back with the setting off, and with the author and company GridCraft wrote back.Workbook.remove_personal_info(model) holds the setting. It's#[serde(default)]and skipped when false, so GridCraft JSON files are unchanged.filterPrivacy; the writer putsfilterPrivacy="1"back.dc:creatorandCompanyout. The other properties (title, subject, keywords, description) are written as before. The in-memory properties aren't touched, so turning the setting off writes them again.Comparison
A minimal workbook with
<workbookPr filterPrivacy="1"/>, thenfile.properties {author: "Jane Example", company: "Example Co"}(the issue's own example values), saved withgridcraft-cli run:workbookPr<workbookPr/>(setting lost)<workbookPr filterPrivacy="1"/>filterPrivacy="1"dc:creatorJane ExampleCompanyExample CoI didn't turn the setting on in Excel myself (it's set through the Trust Center or the Document Inspector). The Excel column is the issue's measurement.
Tests
tests::roundtrip::remove_personal_information_is_kept_and_honouredchecks that the setting is read from a file and written back, that the author and company are left out while it's on and other properties stay, and that with it off nothing changes. It fails on main.cargo xtask cipasses.🤖 Generated with Claude Code
Summary by CodeRabbit