fixed #83, 'InsertString' issue on local variable feature .

This commit is contained in:
Zero Fanker 2024-07-04 19:47:48 -04:00
parent 22fa8291be
commit 50f57e1675

View file

@ -107,7 +107,7 @@ void CGlobalsDlg::UpdateDialog()
added += " No name";
}
m_Global.InsertString(i, added);
m_Global.SetItemData(m_Global.AddString(added), i);
if (bFailFind) {
break;
@ -123,17 +123,19 @@ void CGlobalsDlg::OnChangeDescription()
CIniFile& ini = Map->GetIniFile();
int cursel = m_Global.GetCurSel();
if (cursel < 0) return;
if (cursel < 0) {
return;
}
int curglob = m_Global.GetItemData(cursel);
char c[50];
itoa(curglob, c, 10);
UpdateData(TRUE);
if (m_Description.Find(",") >= 0) m_Description.SetAt(m_Description.Find(","), 0);
if (m_Description.Find(",") >= 0) {
m_Description.SetAt(m_Description.Find(","), 0);
}
if (ini.GetString("VariableNames", c).IsEmpty()) {
ini.SetString("VariableNames", c, "text,0");
@ -153,7 +155,9 @@ void CGlobalsDlg::OnSelchangeGlobal()
CIniFile& ini = Map->GetIniFile();
int cursel = m_Global.GetCurSel();
if (cursel < 0) return;
if (cursel < 0) {
return;
}
int curglob = m_Global.GetItemData(cursel);
char c[50];