linuxdeepin / deepin-editor

Text editor for DDE
GNU General Public License v3.0
104 stars 64 forks source link

fix: onPressedLineNumber() may cause process hangs. #259

Closed rb-union closed 1 year ago

rb-union commented 1 year ago

点击序号列空白处,可能导致程序阻塞,这是由于循环判断 没有检查 QTextBlock 是否有效。

  1. 修改 onPressedLineNumber() 函数,改为使用 cursorForPosition() 接口取得块位置,而非循环比对块区域范围。
  2. 补充 onPressedLineNumber() 的单元测试。

Log: 修复一次点击序号可能导致程序阻塞的问题 Bug: https://pms.uniontech.com/bug-view-215591.html Influence: LineNumber

rb-union commented 1 year ago

/reivew @starhcq

starhcq commented 1 year ago

/+1

deepin-ci-robot commented 1 year ago

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: rb-union, starhcq

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files: - **[debian/deepin/OWNERS](https://github.com/linuxdeepin/deepin-editor/blob/master/debian/deepin/OWNERS)** Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment