Repository navigation
[6036] 修复渐进式排版冻结连续空白页边界时未裁剪 doc_l 导致标题重复的缺陷 - #4797
Merged
Merged
Conversation
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.
问题描述
打开
book样式长文档(如xiyouji.stem)并向下滚动时,封面标题「西游记 吴承恩」在后续页面重复出现。根因分析
book样式在doc-data与chapter*之间由new-page/new-dpage生成多个ins为空的连续空白页;首轮渐进排版扣除缓冲页后to_freeze恰好落在连续空白页边界(last_sk[to_freeze - 1]与last_sk[to_freeze]均为空白页)。typesetter_rep::typeset()仅检查紧邻边界的两页,导致end_in_unfrozen == 0、doc_l未被裁剪,下一分块重排时把「西游记」及后续空白页再次生成并冻结到frozen_page_boxes。pager_rep::pages_make()调用break_pages时未将N (frozen_pages)计入起始页码,导致已冻结页数为奇数时后续NEW_DPAGE奇偶页判定与全量排版不一致。修复内容
src/Typeset/Bridge/typesetter.cpp:非最终分块若冻结边界为空白页则将to_freeze向前收缩至最后一个非空页,并向前兜底扫描所有已冻结页计算end_in_unfrozen,确保doc_l正确裁剪。src/Typeset/Page/make_pages.cpp:pages_make()向break_pages传入env->first_page + N (frozen_pages)保持奇偶页偏移一致。tests/Typeset/progressive_typeset_test.cpp:新增test_blank_pages_at_freeze_boundary回归用例。验证情况
xmake b progressive_typeset_test && xmake r progressive_typeset_test:9 passed, 0 failed。python3 tests/mogan/python/6036.py --verify:通过(「西游记」仅在首页出现 1 次)。