Repository navigation
[6033] 修复渐进式排版跨块清空 local_aux 导致更新目录消失的缺陷 - #4794
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.
变更说明
基于已合入的 #4791(6034 统一只读模式与气泡提示)与 #4793(6035 渐进排版页码刷新与完成通知),聚焦修复渐进式分块排版下点击「文档 → 更新 → 目录」导致目录消失或前序章节丢失的缺陷:
env->local_aux:src/Typeset/Bridge/bridge_document.cpp中移除my_typeset_will_be_complete()对progressive_cur_child < N(st)的拦截。src/Typeset/Bridge/impl_typesetter.hpp与src/Typeset/Bridge/typesetter.cpp中新增progressive_complete_pass标记,确保整轮渐进排版仅在chunk_start == 0时重置env->local_aux,跨分块持续收集全部目录条目,并在末块完成时执行determine_page_references;同时在notify_assign(ttt, path(), u)替换根桥时调用progressive_reset()。src/Edit/Process/edit_process.cpp的generate_aux()入口增加is_read_only()判断并触发show_readonly_tip_for_reason(),避免渐进排版未完成时进入generate_aux_recursively()清空既有目录树。tests/Typeset/progressive_typeset_test.cpp中修复create_test_env()局部hashmap悬空引用问题,并新增test_progressive_preserves_local_aux_across_chunks验证跨分块保留local_aux。测试验证
gf fmt --changed-since=main通过xmake b progressive_typeset_test && xmake r progressive_typeset_test(8 passed, 0 failed)python3 tests/mogan/python/6033.py --verify端到端验收通过,目录完整保留并刷新页码