Repository navigation
fix(oxml): move a table's height with the rows a structure edit adds or drops - #534
Merged
Merged
Conversation
…or drops Hancom saves a table's height (hp:sz) as the height of the rows it lays out. Row and column insertion and deletion and cell splits on the table object kept the height the table had before the edit, so a table with merged rows -- whose saved height the page estimate takes while its cells keep their line caches -- had the paragraphs under it as far up as the rows inserted. The edit now moves the saved height by what its rows gained or lost as the page estimate measures them, the rows left as they were keeping the height Hancom gave them. Hancom-saved fixtures: seven tables (flat, merged over rows, a cell of three lines, one placed top and bottom) before and after a row inserted below and above row 1; the existing row, column and split fixtures now also match Hancom's table height. The same edits of apply_table_ops still keep the height. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
airmang
force-pushed
the
fix/table-structure-edits-keep-table-height
branch
from
October 20, 2026 08:09
2b7250c to
87dd686
Compare
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.
무엇을 고쳤나
한/글은 표 높이(
hp:tbl/hp:sz@height)를 배치한 행 높이의 합으로 저장한다. 그런데 표 객체의 구조 편집(doc.tables.insert_rows·delete_rows·insert_columns·delete_columns·split_cell)은 편집 전 높이를 그대로 남겼다. 행 병합 칸이 있는 표는 칸 문단의 줄 배치 정보가 모두 남아 있으면 쪽 수 추정이 그 저장된 높이를 쓰므로(_inline_table_height), 행을 넣은 표 아래 문단을 넣은 행 높이만큼 위에 두었다.TableStructureEdits._restructure)이 편집 전후 행 높이(쪽 수 추정의 행 모형_rows_height)의 차이만큼hp:sz높이를 옮긴다. 건드리지 않은 행은 한/글이 준 높이를 그대로 둔다(저장된 높이에 차이만 더한다).hwpx.table_patch.apply_table_ops(바이트 경로)의 같은 편집은 아직 높이를 옮기지 않는다. 후속으로 남긴다.시험
test_object_edits_make_what_hancom_makes: 한/글이 직접 행·열을 넣고 셀을 나눈 기존 픽스처와 표 높이(hp:sz@height)도 같은지 본다.test_a_row_edit_leaves_the_table_as_tall_as_hancom_lays_it_out: 한/글 저장 픽스처table_structure_merged_rows_base(합성: 평평한 표, 행 병합 표, 기준 행을 가로지르는 병합, 석 줄 칸, 위아래 배치 표 등 7개)의 표마다 1행 아래(위)에 행을 넣고, 한/글이 같은 편집본을 저장한table_structure_merged_rows_below1(above1)과 표 높이·본문 줄 위치(쪽 수 추정)가 같은지 본다.CHANGELOG.md[Unreleased]/고침 맨 위에 항목 하나.🤖 Generated with Claude Code