[0641] 修复移动光标时相邻表格边框颜色被覆写的问题#3693
Open
JackYansongLi wants to merge 7 commits into
Open
Conversation
d27e997 to
4f1d086
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.
任务描述
修复当光标移动时,表格中共享边框的颜色发生非预期改变(从绿色变为黑色,再变为绿色)的bug。
修复思路
当单元格被局部重排版(例如光标进入或编辑)时,它的
bcolor_precedence会临时丢失(重置为默认值-1)。在table_rep::merge_borders中,我们为bcolor_precedence == -1但bcolor显式非空(含有自定义颜色)的单元格指定其有效优先级为0。这就保证了即使局部重排版导致bcolor_precedence回滚,该单元格依然拥有高于默认未指定颜色单元格(-1)的优先级,防止共享边框被覆写为黑色。测试验证
已经在
tests/Edit/Modify/edit_table_test.cpp中新增回归单元测试test_border_color_precedence_robustness()进行了全面验证。