Skip to content

Commit

Permalink
解决“添加字体筛选条件”对话框因为信息文件没有包含字体信息时导致崩溃的问题
Browse files Browse the repository at this point in the history
如果选择的信息文件没有字体信息,如:<文档字体 />
第 100 行的代码 _FontInfoBox.EnsureVisible(0); 会引起崩溃。
  • Loading branch information
kendling authored and wmjordan committed Sep 28, 2022
1 parent 97125bc commit 3be4b55
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions App/Functions/AutoBookmark/FontFilterForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,10 @@ void OnLoad() {
foreach (XmlElement item in _FontInfoBox.Roots) {
_FontInfoBox.Expand(item);
}
_FontInfoBox.EnsureVisible(0);
_FontInfoBox.Sort(_CountColumn, SortOrder.Descending);
if (_FontInfoBox.GetItemCount() > 0) {
_FontInfoBox.EnsureVisible(0);
_FontInfoBox.Sort(_CountColumn, SortOrder.Descending);
}
}

void _OkButton_Click(Object source, EventArgs args) {
Expand Down

0 comments on commit 3be4b55

Please sign in to comment.