Task #1350 useFontSpace 직렬화 시 항상 false 고정 (IR 값 무시)#1351
Closed
Martinel2 wants to merge 20 commits into
Closed
Conversation
) - render_run_content: text_buf.push(c) 직전에 0-length 필드 (start == end == idx) fieldEnd 방출 추가 — fieldBegin 슬롯 방출 직후에 인접 방출되어 올바른 순서 보장 - 기존 post-char fieldEnd 검사에 start < end guard 추가 — 0-length 필드가 idx-1 시점에 역순 방출되는 것 차단 - 신규 테스트: task1298_zero_length_field_at_para_start, task1298_zero_length_field_mid_text (14 passed) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- render_run_content: para.text == "" 일 때 메인 루프가 0회 실행되어 pre-char 0-length 검사가 건너뛰어지는 문제 해결 - 루프 진입 전 빈 문단 전용 블록 추가: slots(fieldBegin)를 먼저 방출한 뒤 0-length fieldEnd를 방출하여 올바른 순서 보장 - 신규 테스트: task1321_zero_length_field_in_empty_paragraph (51 passed) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
) - render_run_content: text_buf.push(c) 직전에 0-length 필드 (start == end == idx) fieldEnd 방출 추가 — fieldBegin 슬롯 방출 직후에 인접 방출되어 올바른 순서 보장 - 기존 post-char fieldEnd 검사에 start < end guard 추가 — 0-length 필드가 idx-1 시점에 역순 방출되는 것 차단 - 신규 테스트: task1298_zero_length_field_at_para_start, task1298_zero_length_field_mid_text (14 passed) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- render_run_content: para.text == "" 일 때 메인 루프가 0회 실행되어 pre-char 0-length 검사가 건너뛰어지는 문제 해결 - 루프 진입 전 빈 문단 전용 블록 추가: slots(fieldBegin)를 먼저 방출한 뒤 0-length fieldEnd를 방출하여 올바른 순서 보장 - 신규 테스트: task1321_zero_length_field_in_empty_paragraph (51 passed) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
CharShape 구조체에 use_font_space 필드가 없어 항상 false로 직렬화되던 결함을 수정한다. HWP5 attr bit 25, HWPX useFontSpace 속성을 모두 읽어 IR에 보존하고, HWPX 직렬화 시 IR 값을 그대로 출력한다. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Owner
|
PR #1351 수용 처리 완료했습니다. 반영 방식:
반영 커밋:
검증:
HWPX 기여 감사합니다. |
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.
변경 요약
요약
원인
CharShape 구조체에 use_font_space: bool 필드 자체가 존재하지 않았음.
HWP5 파서(parse_char_shape)는 attr에서 bit 25를 추출하지 않았고,
HWPX 파서(header.rs)는 useFontSpace 속성을 무시했으며,
HWPX 직렬화기는 항상 useFontSpace="0"을 출력했음.
변경사항
src/model/style.rs : CharShape에 use_font_space: bool 필드 추가, PartialEq impl 반영
src/parser/doc_info.rs : attr & (1 << 25) 추출 → use_font_space 초기화
src/parser/hwpx/header.rs : useFontSpace 속성 실제 파싱 (parse_bool 적용)
src/serializer/hwpx/header.rs : 하드코딩 제거, bool01(cs.use_font_space) 사용
src/serializer/doc_info/tests.rs : 명시적 CharShape 리터럴에 use_font_space: false 보완
Tests
test parser::doc_info::tests::test_parse_char_shape_use_font_space ... ok
test serializer::hwpx::header::tests::write_char_pr_use_font_space_roundtrip ... ok
관련 이슈
closes #1350
테스트
cargo test통과cargo clippy -- -D warnings통과스크린샷
변경 전후 비교가 필요한 경우 첨부해주세요.