fix(layout): split rows joined by merged cells again at every page end - #364
Merged
Merged
Conversation
In a flowing table split between cell lines, rows joined by a cell merged over them that stayed taller than a page after one split were refused. Hancom splits them again at each page end: every cell keeps the lines that fit on the page and the rest goes on below the next page's header rows, and a merged cell longer than its rows goes on alone after they end. The room a cell is declared beyond its text is cut at each page end like a row's, also once its text is all placed. _split_block now does that page after page; _block_rest returns what goes on (each row's height and each cell with the lines it has left) and _cell_rest measures one cell's rest. Only a cell no line of which fits a page is still refused. Five Hancom-saved fixtures: 100 one-line rows joined by a cell merged down all of them (three pages), 60 rows with a merged cell of 150 lines (four pages, the cell going on alone), rows of one and three lines (a row split between its lines), and eight rows joined by a cell declared 80000 tall, and by an empty one declared 75000 tall. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… tall as they are When rows joined by a merged cell split between their lines and a cell declared taller than its text breaks at the page end, the part going on was its declared rest alone, and a rest no taller than a line was dropped even with lines still to go. Hancom makes that part as tall as the larger of the declared rest and the lines going on with the cell's margins, as it already does for a row of its own. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…om's saved layout The test of a cell merged over four rows and declared 150000 tall built its document and checked only the page count. It now reads the same document laid out and saved by Hancom, with and without its line caches: four pages, the cell's room cut at each page end, and the lines where Hancom put them. The table ends the document, so no line is on its last page and the HANCOM_PAGES helper does not apply. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
바뀐 점
쪽 수 추정(실험,
estimate_pages)이 칸 단위로 나누는 흐르는 표(pageBreak="CELL")에서, 병합 칸으로 이어진 행들이 한 번 나눈 뒤에도 한 쪽보다 길면 쪽 끝마다 다시 나눈다.rows merged together taller than a page)으로 두었다._split_block이 이것을 쪽마다 되풀이한다._block_rest는 다음 쪽으로 가는 것(행마다 높이, 남은 줄을 가진 칸)을 돌려준다._cell_rest가 칸 하나의 나머지를 잰다.테스트
tests/test_layout_page_estimate.py에 한/글 저장본 열을 더한다. 아홉은HANCOM_PAGES에 넣는다.pages_joined_rows_over_pages_declared_150000)을 읽는다.HANCOM_PAGES가 아니라 따로 된 테스트로 둔다.🤖 Generated with Claude Code