Skip to content

Task #1188 그림/표/도형의 textFlow 속성이 roundtrip 시 항상 BOTH_SIDES로 초기화됨#1213

Merged
edwardkim merged 3 commits into
edwardkim:develfrom
Martinel2:fix/issue-1188
Jun 1, 2026
Merged

Task #1188 그림/표/도형의 textFlow 속성이 roundtrip 시 항상 BOTH_SIDES로 초기화됨#1213
edwardkim merged 3 commits into
edwardkim:develfrom
Martinel2:fix/issue-1188

Conversation

@Martinel2

Copy link
Copy Markdown
Contributor

변경 요약

CommonObjAttrtext_flow 필드(TextFlow enum)를 추가합니다.
이전까지 textFlow 속성은 HWPX 직렬화 시 "BOTH_SIDES"로 하드코딩되어 있었고, HWP5 바이너리의 attr bit 24-25도 파싱하지 않았습니다.

  • model/shape.rs: TextFlow enum 신규 추가 (BothSides/LeftOnly/RightOnly/LargestOnly) 및 CommonObjAttr.text_flow 필드 추가
  • parser/control/shape.rs: HWP5 바이너리 attr bit 24-25에서 TextFlow 파싱
  • parser/hwpx/section.rs: HWPX textFlow 속성 파싱 (표/그림/도형/차트/OLE 5개 위치)
  • serializer/hwpx/{shape,picture,table}.rs: 하드코딩 "BOTH_SIDES" → 실제 text_flow 값 출력
  • document_core/converters/common_obj_attr_writer.rs: 비트 패킹에 bit 24-25 추가 및 TextFlow 라운드트립 테스트 4개 추가

관련 이슈

closes #1188

테스트

  • cargo test 통과
  • cargo clippy -- -D warnings 통과
  • 관련 샘플 파일로 SVG 내보내기 확인
  • 웹(WASM) 렌더링 확인 (해당하는 경우)

스크린샷

변경 전후 비교가 필요한 경우 첨부해주세요.

Martinel2 and others added 2 commits June 1, 2026 13:16
- model/shape.rs: TextFlow enum 신규 추가 (BothSides/LeftOnly/RightOnly/LargestOnly)
  및 CommonObjAttr.text_flow 필드 추가
- parser/control/shape.rs: HWP5 바이너리 attr bit 24-25에서 TextFlow 파싱
- parser/hwpx/section.rs: HWPX textFlow 속성 파싱 (표/그림/도형/차트/OLE 5개 위치)
- serializer/hwpx/{shape,picture,table}.rs: 하드코딩 "BOTH_SIDES" → 실제 text_flow 값 출력
- document_core/converters/common_obj_attr_writer.rs: 비트 패킹에 bit 24-25 추가
  및 TextFlow 라운드트립 테스트 4개 추가

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@Martinel2 Martinel2 changed the title feat: CommonObjAttr에 text_flow(TextFlow) 필드 추가 (#1188) Task#1188 그림/표/도형의 textFlow 속성이 roundtrip 시 항상 BOTH_SIDES로 초기화됨 Jun 1, 2026
@Martinel2 Martinel2 changed the title Task#1188 그림/표/도형의 textFlow 속성이 roundtrip 시 항상 BOTH_SIDES로 초기화됨 Task #1188 그림/표/도형의 textFlow 속성이 roundtrip 시 항상 BOTH_SIDES로 초기화됨 Jun 1, 2026
@edwardkim edwardkim self-requested a review June 1, 2026 07:41
@edwardkim edwardkim added the bug Something isn't working label Jun 1, 2026
@edwardkim edwardkim added this to the v1.0.0 milestone Jun 1, 2026
@edwardkim edwardkim added the enhancement New feature or request label Jun 1, 2026
edwardkim added a commit that referenced this pull request Jun 1, 2026
…#1188)

@Martinel2 첫 기여. hwp2hwpx 권위 비트값 검증, 1916 passed, 무회귀(SVG byte 동일).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@edwardkim edwardkim merged commit 31ce33f into edwardkim:devel Jun 1, 2026
@edwardkim

Copy link
Copy Markdown
Owner

머지했습니다(devel 31ce33f0). rhwp 에 첫 기여 주셔서 진심으로 환영하고 감사합니다. 🎉

진단이 정확했고 수정도 견고했습니다 — CommonObjAttr.text_flow 필드 추가, HWP5 attr bit 24-25 파싱과 비트패킹의 정확한 대칭, HWPX 5개 위치 파싱, 그리고 비트 위치/매핑 검증 테스트까지. 한컴 매핑(hwp2hwpx TextHorzArrange: BothSides0/LeftOnly1/RightOnly2/LargestOnly3)과도 정확히 일치함을 확인했습니다.

검증:

  • cargo test --tests 1916 passed (textFlow roundtrip 9건 포함)
  • 실샘플 hwp3-sample19-hwpx.hwpxLARGEST_ONLY 가 IR 에 보존됨(기존엔 BOTH_SIDES 로 소실)
  • 렌더러는 아직 text_flow 를 배치에 쓰지 않아 SVG 출력은 동일(무회귀). 이번 변경은 IR 보존/직렬화 정합이 핵심이며, 좌우 흐름의 실제 렌더 반영은 향후 후속으로 이어갈 수 있습니다.

참고로 이 PR 은 CI 가 실행되지 않은 상태여서 로컬에서 fmt/build/clippy/test 를 직접 검증했습니다. 앞으로도 좋은 기여 기대하겠습니다.

edwardkim added a commit that referenced this pull request Jun 1, 2026
@Mireutale (#1206 분리 재제출) — HWPX 직렬화 시 본문 문단과 표 셀 문단의 <hp:p id>
가 같은 번호 공간을 공유하지 않아 전역 중복 가능. SerializeContext 에 전역
next_para_id() 카운터 추가, 본문·각주·셀 문단이 공유.

#1206 close 사유 ②(fillBrush 혼재)·③(image_fill_mode 비대칭) 해소 — header.rs 제외,
id 충돌 수정만 분리. 충돌 해소: #1213(textFlow) 테스트와 인접 충돌 → 양쪽 보존.

검증: clippy(lib) clean, cargo test --tests 1921 passed. 통합 테스트
para_ids_unique_across_body_and_table(basic-table-01 라운드트립 id 전역 유니크).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@Martinel2

Copy link
Copy Markdown
Contributor Author

검토 및 머지 감사합니다! 도움이 될 수 있어서 기쁘네요!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants