Task #1201: HWPX masterpage idRef 연결 보강#1242
Merged
Merged
Conversation
1ea1429 to
658a030
Compare
Owner
|
메인테이너 확인 완료했습니다.
원본
기여 감사합니다. |
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.
변경 내용
content.hpf에서 masterpage manifest 항목의id와href를 함께 보존합니다.<hp:masterPage idRef="...">를 수집하고,idRef -> manifest id -> href -> masterpage XML순서로SectionDef.master_pages에 연결합니다.masterPage@type표기를 정규화해EVEN/ODD뿐 아니라Even/Odd,LastPage,OptionalPage계열도 안정적으로 해석합니다.section_master_page_files경로는idRef연결이 실패한 경우의 fallback으로 유지했습니다.원인
기존 HWPX 파서는 section XML의
masterPage@idRef를 직접 따라가지 않고 manifest 순서 기반으로 masterpage 파일을 추정했습니다.이 방식은 샘플에 따라 우연히 맞을 수는 있지만, manifest 순서가 section 참조 순서와 달라지면 section별 바탕쪽이 잘못 연결되거나 홀짝 바탕쪽이 반대로 보일 수 있습니다. HWPX에서는 HWP5 raw parser의 순서 기반 규칙이 아니라 XML에 명시된
idRef와type을 우선해야 합니다.범위와 주의
관련 이슈
Closes #1201
테스트
cargo fmt --all --checkcargo testcargo clippy -- -D warningscargo test --lib hwpxcargo test --test issue_1100_exam_social_hwpx_headercargo test --test issue_1113_header_autonum_placeholderdump로 section별Even/Odd바탕쪽 연결 확인export-svg및 PDF 4~7쪽 참고 비교스크린샷
이번 PR은 parser/IR 연결 보강이 주 범위라 변경 전후 스크린샷 차이는 제한적입니다.
대상 샘플의 시각적 pagination 차이는 별도 layout 이슈에서 다루는 것이 적절합니다.