Skip to content

feat(layout): page estimate for a table placed top and bottom in a cell paragraph without caches - #366

Merged
airmang merged 5 commits into
mainfrom
fix/page-estimate-cell-tables-placed-top-and-bottom
Oct 1, 2026
Merged

airmang merged 5 commits into
mainfrom
fix/page-estimate-cell-tables-placed-top-and-bottom

Conversation

@airmang

@airmang airmang commented Oct 1, 2026

Copy link
Copy Markdown
Owner

바뀐 점

쪽 수 추정(실험, estimate_pages)이 줄 캐시 없는 표 칸에서 위아래 배치 표 하나가 든 문단을 따른다.

  • 전에는 칸에 든 표가 글자처럼 두어 문단에 혼자 있을 때만 캐시 없이 쟀다. 문단 위 기준 위아래 배치 표는 캐시가 있어야 했고, 없으면 지원 밖(a nested table)이었다.
  • 글 없이 그런 표만 든 문단:
    • 한/글은 빈 줄을 문단 윗선에 두고, 칸을 표의 아래 끝까지 늘인다. 칸의 다음 줄은 그 아래에서 이어진다. 위로 띄운 표(음수 오프셋)는 문단 윗선에 선다.
    • 이제 _objects_reach가 그림·도형처럼 이런 표도 센다. 표 높이는 행으로 재고(_inline_table_height) 바깥 여백을 더한다.
  • 그런 표 뒤에 글이 오는 문단:
    • 한/글은 표에 닿는 첫 줄과 그 뒤 줄을 표 아래로 보낸다. 표를 띄워 두면 그 위의 줄은 제자리에 남는다.
    • 이제 _Measure.pushed_lines가 그렇게 줄을 놓는다. 줄이 모두 표 위에 있으면 문단이 표 아래 끝까지 닿는다.
  • _Measure.stack_lines는 개체가 닿는 문단 뒤의 줄을 stack처럼 그 아래 끝에서 잇는다. 전에는 줄 간격만큼만 내려가서, 그런 행이 쪽을 넘어 줄 사이에서 나뉠 때 줄 목록이 행보다 짧았다.
  • 한 문단에 위아래 표가 둘이면 한/글은 빈 줄을 아래 표 밑으로 보낸다. 이것은 따르지 않고 전처럼 캐시가 있어야 한다(_table_on_its_own은 표 하나만 받는다). 어울림 표, 글 사이에 둔 표도 그대로다.
  • 변경 로그를 고친다.

테스트

  • 기존 한/글 저장본으로 캐시 없는 추정을 확인한다. 전에는 이 일곱에서 지원 밖이라고만 확인했다.
    • 흐르는 표 칸에 혼자 든 위아래 표, 위로 띄운 표, 글 앞에 둔 표
    • 그런 표를 품은 행이 쪽 끝에서 나뉘는 네 판
    • 캐시가 없어도 줄 위치와 쪽 수가 한/글과 같다.
  • 한/글 저장본 다섯을 더한다.
    • 표 혼자 든 문단 뒤에 한 줄 문단, 1000 띄운 표 혼자, 1000 띄운 표 뒤 세 줄, 위로 띄운 표 뒤 세 줄(HANCOM_PAGES)
    • 한 문단에 표 둘: 캐시가 있으면 한/글과 같고, 없으면 지원 밖이다.
  • 고치기 전 코드에서는 열하나가 실패한다. 새 저장본 넷과 기존 저장본 일곱의 캐시 없는 판이다.
  • stack_lines의 고침만 빼면 행 나눔 두 판이 실패한다.

🤖 Generated with Claude Code

airmang and others added 5 commits October 2, 2026 00:08
…n a cell paragraph without caches

Without layout caches a cell paragraph holding nothing but tables placed top and bottom from its top makes
the cell reach the tables' foot, as tall as their rows (one placed up stands at the paragraph's top), as a
drawing there does; the line after such a paragraph goes on below that foot, also when the row splits
between its lines over a page end. Such a cell was unsupported ("a nested table").

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

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ell paragraph without caches

Hancom sets the empty line of a paragraph holding two such tables below the second, not beside the first: without caches that cell stays unsupported. Fixtures: a line after such a table, a table 1000 down, two tables.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…a cell paragraph's text without caches

Without layout caches a cell paragraph whose text follows a table placed top and bottom from its top now lays
the first line reaching the table, and the lines after it, below the table, as Hancom does (one placed up
stands at the paragraph's top); the paragraph reaches down to the table's foot at least. Rows holding such a
cell split between its lines over a page end as with the caches. Such a cell was unsupported.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…l-tables-placed-top-and-bottom

# Conflicts:
#	CHANGELOG.md
#	src/hwpx/layout/pages.py
@airmang

airmang commented Oct 1, 2026

Copy link
Copy Markdown
Owner Author

main(1c17ad7b, #362·#363·#364 병합)을 합쳤습니다(d78ea9ea). 충돌은 두 곳이었습니다.

  • 변경 로그: main의 [Unreleased] / ### 고침 목록에 이 PR 항목을 그대로 두었습니다.
  • pages.py 모듈 설명: #364와 이 PR이 지원 밖 목록의 같은 문장을 고쳤습니다. 두 변경을 함께 담았습니다(행째 옮기는 표의 쪽보다 긴 묶음, 칸 문단의 위아래 표 하나).

코드는 바뀌지 않았습니다. 쪽 수 추정 테스트와 게이트를 다시 통과했습니다.

@airmang
airmang merged commit 7fc1e51 into main Oct 1, 2026
13 checks passed
@airmang
airmang deleted the fix/page-estimate-cell-tables-placed-top-and-bottom branch October 1, 2026 21:58
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