Skip to content

fix(layout): read a column gap as a signed 32-bit number - #482

Merged
airmang merged 3 commits into
mainfrom
fix/page-estimate-signed-column-gap
Oct 16, 2026
Merged

airmang merged 3 commits into
mainfrom
fix/page-estimate-signed-column-gap

Conversation

@airmang

@airmang airmang commented Oct 16, 2026

Copy link
Copy Markdown
Owner

Summary

  • sameGap on hp:colPr is stored as an unsigned number, but Hancom reads it as a signed 32-bit value. A gap written as 4294934528 (2^32 − 2^15) is laid out as −32768, so the columns overlap instead of collapsing to almost no width.
  • The page estimate now converts values at or above 2^31 to their signed form before computing the column width.
  • The columns_gap_wrapped fixture is now the Hancom Office 2024 desktop save of the same document, and its Hancom page count is pinned in the page-estimate tests.

Test plan

  • The new page-count check fails before the fix and passes after it
  • Lint, format, type checks and the other repository gates
  • Full test suite: no new failures

🤖 Generated with Claude Code

The page estimate reads hp:colPr@sameGap as a signed 32-bit number: a value of 2**31 or more is a negative gap, and Hancom Office widens the columns by it so that they overlap. Before, such a gap was read as a huge one, leaving the columns next to no width. The columns_gap_wrapped fixture is re-saved by Hancom Office 2024.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@airmang
airmang force-pushed the fix/page-estimate-signed-column-gap branch from d85ef79 to e8290ca Compare October 16, 2026 06:19

@airmang airmang left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

e8290ca 검토 완료. 단 간격의 signed 32-bit 변환과 다단 폭 계산을 검토했습니다. 독립 체크아웃의 다단 관련 테스트 74개가 통과했습니다. 해당 최신 head의 CI 전체 성공과 실제 Python 3.12 로그(6759 passed, 18 skipped, 1 xfailed; coverage 기준 및 Ruff·mypy·Pyright·공개 저장소 게이트 통과)를 확인했습니다. 검토 범위에서 재현된 코드 결함은 찾지 못했습니다. 다만 #475/#468/#472 병합 후 최신 main 0193c010218cb5c0abeed891be2aab4ec9de2f80과 CHANGELOG.md 내용 충돌이 발생함을 git merge-tree로 확인해 병합을 보류합니다. main의 변경 기록을 함께 보존하여 충돌을 해결한 뒤 새 head의 검사와 통합 결과를 다시 검증해야 합니다.

@airmang airmang left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unsigned로 저장된 단 간격의 signed 32비트 변환과 겹치는 다단 폭 계산을 검토했습니다. 충돌은 양쪽 기록과 테스트를 보존해 해결했고, 재배치 전후 함수·데코레이터·데이터의 의미가 같음을 대조했습니다. Python 3.10–3.14 전체 CI, CodeQL, 의존성 검사가 모두 성공했습니다. 같은 커밋의 중복 PR 테스트 실행은 취소하고 push 매트릭스 성공을 확인했습니다. 최종 통합본의 관련 테스트 1,692개도 통과했습니다. 검토한 head를 지정하여 squash 병합합니다.

@airmang
airmang merged commit f6843f9 into main Oct 16, 2026
8 of 13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant