Skip to content

fix(table-patch): keep the saved height of a table split across pages - #672

Merged
airmang merged 1 commit into
mainfrom
fix/table-height-split-across-pages
Nov 6, 2026
Merged

airmang merged 1 commit into
mainfrom
fix/table-height-split-across-pages

Conversation

@airmang

@airmang airmang commented Nov 6, 2026

Copy link
Copy Markdown
Owner

요약

#539(fe546d1)의 표 높이 보정이, 쪽을 넘어 나뉜 표의 저장 높이(hp:sz@height)를 0으로 만듭니다. 이번 PR은 그런 표의 높이를 그대로 둡니다.

  • 한/글은 쪽에서 나뉜 표에 첫 쪽 조각의 높이만 저장합니다. 평가계획 양식 tests/fixtures/m105_evalplan/blank_form_3hak.hwpx(한/글 저장본)를 보면, 15행이 같은 표 19·20·21이 각각 30463·17551·5865로 저장돼 있습니다.
  • 그런 표에 "편집 전후 행 높이 차이"를 더할 근거는 없습니다. 표 8번(행 합 28762, 저장 13222)에서 9행을 지우면 13222 + (9001 − 28762) = 음수가 되고, 0으로 잘립니다.
  • 수정 내용: _grow_height에서 저장 높이가 측정한 행 높이보다 작으면 높이를 바꾸지 않습니다. #539가 정한 "모델이 따라가지 못하는 표는 추측으로 고치지 않는다"는 정책과 같습니다. 객체 경로와 apply_table_ops가 같은 함수를 쓰므로 둘 다 적용됩니다.
  • 행 높이만큼 저장된 표(한 쪽에 들어가는 표)는 전처럼 증감만큼 움직입니다. 기존 한/글 저장본 대조 테스트도 그대로 통과합니다.

python-hwpx-automation의 evalplan 바이트 parity 테스트 4개가 10-30부터 모든 PR에서 실패한 원인 중 하나가 이것입니다. core 커밋을 하나씩 바꿔 가며 확인했고, fe546d1^1에서 통과, fe546d1c에서 실패합니다. automation 쪽 갱신은 airmang/python-hwpx-automation 쪽 PR에서 다룹니다.

관련 이슈

Refs #539 (fe546d1 후속)

변경 종류

  • 버그 수정

체크리스트

  • 새 테스트 2개를 넣었습니다: 쪽에서 나뉜 표는 높이 유지(수정 전에는 0 == 13222로 실패), 한 쪽 표는 계속 증감.
  • 표 구조 테스트(test_table_structure_edits·test_insert_row_sides·test_split_cell·test_insert_column_by_clone) 122개 통과.
  • 로컬(Windows) 전체: 7701 passed, 6 failed. 실패 6개는 symlink 권한·설치 wheel 환경 문제로 이 변경과 무관합니다. Linux CI에서 확인합니다.
  • CHANGELOG.md [Unreleased] 고침 항목 추가.
  • 데스크톱 한/글에서 열어 본 확인은 하지 않았습니다. 이 변경은 table_patch: 구조 편집 후 표 전체 높이를 객체 경로와 일관되게 갱신 (#534 후속) #539 이전 동작(높이 유지)으로 돌아가는 것이라 새 위험은 없다고 판단했습니다.

🤖 Generated with Claude Code

A table Hancom split across pages saves the height of its part on the
first page, not its rows' height (tables 19-21 of the evaluation-plan
form have the same 15 rows and save 30463, 17551 and 5865). Moving that
height by the rows' delta has no basis and took table 8 of the form
(rows 28762, saved 13222) to 0 when the evaluation-plan fill deleted nine
of its rows. Structural edits now leave such a table's height as it was,
as they already do for rows the estimate does not follow; a table saved
as tall as its rows still moves by their delta.

Follow-up to #539 (fe546d1). This is what broke the frozen evalplan byte
parity in python-hwpx-automation since 2026-10-30.

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

@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.

검토 완료: _grow_height의 기존 측정 실패 처리와 객체/바이트 편집 호출 경로를 함께 확인했습니다. 저장 높이가 편집 전 행 높이보다 작을 때만 기존 높이를 보존하므로, 전체 행 증감으로 첫 조각 높이가 0이 되던 경로를 막습니다. 독립적으로 표8의 일부 행 삭제/추가에서 13222 보존, 표9 삭제에서 25961→24212 및 객체/바이트 경로 일치를 확인했습니다. 관련 구조 편집 로컬 151개 통과. 정확한 head의 CI 13개 성공: Python3.12 로그 7667 passed,18 skipped,1 xfailed 및 Ruff/mypy/Pyright 통과. 최신 main 40a04fe6와 통합 tree c6555beb도 head와 동일함을 확인했습니다. 변경 범위에서 추가 결함을 발견하지 못했습니다. 데스크톱 한/글 시각 검증을 주장하지 않습니다. 자기 PR이므로 COMMENT로 기록합니다.

@airmang
airmang merged commit d3b6efc into main Nov 6, 2026
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