Merge pull request 'fix: selectEqu 的 pszSearch 判空条件写反' (#51) from company-desktop-computer/fix/equlibdlg-search into main

Reviewed-on: #51
This commit was merged in pull request #51.
This commit is contained in:
gjm committed 2026-10-25 11:07:18 +08:00
commit 44f53dede4
1 file changed
+5 -2
@@ -718,7 +718,9 @@ AecDbEwEquipment * CEquLibDlg::selectEqu(LPCTSTR pszSearch
dlg.m_bCheck2DFlag = bUseFangle;
dlg.m_bUseFangle = b2DCheck;
dlg.m_bSearch = TRUE;
if (!pszSearch)
//pszSearch 为空表示"插入设备"这类不需要预填搜索词的入口,
//此时对话框照常打开,只是搜索框留空;不能早退,也不能把 NULL 赋给 CString
if (pszSearch)
dlg.m_sSearch = pszSearch;
else
dlg.m_sSearch = _T("");
@@ -733,7 +735,8 @@ AecDbEwEquipment * CEquLibDlg::selectEqu(LPCTSTR pszSearch
//设置子类型,后续可增加类型
extern AecEqui::VlvType g_vlvType[];
CString sText(pszSearch);
//按调用者传入的关键字判断设备子类型,pszSearch 可能为 NULL
CString sText(pszSearch == NULL ? _T("") : pszSearch);
if (sText.Find(_T("阀")) != -1)
{
pEqu->GetSpecialtyData()->SetAt(KEY_SUBRUNTIME, eValve);