修复默认值设置BUG

This commit is contained in:
gb 2022-09-16 09:01:38 +08:00
parent de84c1437b
commit de962deae5
2 changed files with 9 additions and 0 deletions

View File

@ -7527,9 +7527,18 @@ void ChgjsonDlg::OnListmenuSetdefault()
{
// TODO: Add your command handler code here
int sel = get_cur_sel(&constraint_list_);
std::wstring text(get_tree_selected_item_text(&tree_, tree_.GetSelectedItem()));
int item = find_config_item(text.c_str());
if (item == -1)
return;
if (sel >= 0 && sel < constraint_list_.GetItemCount())
{
wchar_t cur[128] = { 0 };
constraint_list_.GetItemText(sel, 0, cur, _countof(cur) - 1);
hg_items_[item].init_val = cur;
for (int i = 0; i < constraint_list_.GetItemCount(); ++i)
{
if (constraint_list_.GetItemData(i))

Binary file not shown.