Preserve explicit zero page margins and expose presence - #373
Merged
Merged
Conversation
Signed-off-by: Yonghye Kwon <developer.0hye@gmail.com>
Owner
|
@developer0hye |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Explicitly setting all six print margins to zero currently writes Excel defaults instead. This change distinguishes unset margins from supplied values, so zero survives a write/read cycle and defaults apply only to unset fields.
PageMargins::has_left,has_right,has_top,has_bottom,has_header, andhas_footerusing the existing internal presence state. Existing numeric accessors retain their behavior.pageMarginselement. Tests use synthetic workbooks generated in memory.The base-compatible zero-margin regression fails on master
35bbffa4(all six values reopen as defaults) and passes with this change. The default-only control passes on both.Validation on macOS:
cargo test --locked: 344 passed, 23 existing ignored tests.cargo clippy --locked -- -D warnings: passed.cargo clippy --locked --test page_margin_presence -- -D warnings: passed.cargo +nightly-2026-09-11 fmt --all --check: passed.git diff --check: passed.The local lockfile is untracked, consistent with this repository. No dependency changes or external fixtures.
Related: #372. Downstream: developer0hye/office2pdf#1812.