diff options
author | Ash Wolf <ninji@wuffs.org> | 2023-07-01 02:43:29 +0100 |
---|---|---|
committer | Ash Wolf <ninji@wuffs.org> | 2023-07-01 02:43:29 +0100 |
commit | 5c6a48b2ff362a70416a6a00fda7d06e0f276f2d (patch) | |
tree | 62cf542c68d91aa6f7a4e3bfa9eddca4ab352970 /src/T2DLL/TenantSearchDlg.cpp | |
parent | c0c336500955a23e344651e5412c9d9d441ef4ee (diff) | |
download | t2win-5c6a48b2ff362a70416a6a00fda7d06e0f276f2d.tar.gz t2win-5c6a48b2ff362a70416a6a00fda7d06e0f276f2d.zip |
i am in hell
Diffstat (limited to 'src/T2DLL/TenantSearchDlg.cpp')
-rw-r--r-- | src/T2DLL/TenantSearchDlg.cpp | 70 |
1 files changed, 38 insertions, 32 deletions
diff --git a/src/T2DLL/TenantSearchDlg.cpp b/src/T2DLL/TenantSearchDlg.cpp index 5ff4c03..b0845c0 100644 --- a/src/T2DLL/TenantSearchDlg.cpp +++ b/src/T2DLL/TenantSearchDlg.cpp @@ -9,6 +9,12 @@ #include "TenantSearchDlg.h" #include "UT2Utils.h" +#ifdef _DEBUG +#define new DEBUG_NEW +#undef THIS_FILE +static char THIS_FILE[] = __FILE__; +#endif + TenantSearchDlg::TenantSearchDlg() { mDeleteOnClose = true; } @@ -29,71 +35,71 @@ void TenantSearchDlg::Create(T2TowerDoc *inDoc, HINSTANCE inInstance, CWnd *inPa } void TenantSearchDlg::DoFind() { - T2DlgItemListBox *theListBox = (T2DlgItemListBox *) GetDlgItem(1000); - if (!theListBox) + T2DlgItemListBox *listBox = (T2DlgItemListBox *) GetDlgItem(1000); + if (!listBox) return; - int curSel = theListBox->GetCurSel(); - if (curSel == -1) + int sel = listBox->GetCurSel(); + if (sel == -1) return; - T2Name *theName = (T2Name *) theListBox->GetItemDataPtr(curSel); + T2Name *theName = (T2Name *) listBox->GetItemDataPtr(sel); mDocument->towerDoc_vf238(theName); } void TenantSearchDlg::DoDelete() { - T2DlgItemListBox *theListBox = (T2DlgItemListBox *) GetDlgItem(1000); - if (!theListBox) + T2DlgItemListBox *listBox = (T2DlgItemListBox *) GetDlgItem(1000); + if (!listBox) return; - int curSel = theListBox->GetCurSel(); - if (curSel == -1) + int sel = listBox->GetCurSel(); + if (sel == -1) return; - T2Name *theName = (T2Name *) theListBox->GetItemDataPtr(curSel); + T2Name *theName = (T2Name *) listBox->GetItemDataPtr(sel); mDocument->mNameDB->RemoveName(theName); - theListBox->DeleteString(curSel); + listBox->DeleteString(sel); } /*virtual*/ void TenantSearchDlg::OnT2Create() { - T2DlgItemListBox *theListBox = (T2DlgItemListBox *) GetDlgItem(1000); - T2TenantArrayList *theList = mDocument->mFloorInfo->GetTenantArrayList(); + T2DlgItemListBox *listBox = (T2DlgItemListBox *) GetDlgItem(1000); + T2TenantArrayList *theTenantArrayList = mDocument->mFloorInfo->GetTenantArrayList(); - if (!theListBox) + if (!listBox) return; - if (!theList) + if (!theTenantArrayList) return; HFONT theFont = GetFont(); if (theFont) - theListBox->SetFont(theFont); + listBox->SetFont(theFont); - theListBox->ResetContent(); + listBox->ResetContent(); - T2NameList *theNameDB = mDocument->mNameDB; + T2NameList *theNameList = mDocument->mNameDB; T2Name *theName; - LArrayIterator iterator(*theNameDB); + LArrayIterator iter(*theNameList); - while (iterator.Next(&theName)) { + while (iter.Next(&theName)) { int type = theName->GetType(); if (type == kTenantNameType) { - CString nameStr; - unsigned int tenantID; - theName->GetName(nameStr, tenantID); + CString name; + unsigned int id; + theName->GetName(name, id); - CString str; - CString roomNumberStr; + CString text; + CString roomNum; - T2Tenant *theTenant = theList->GetTenantByID(tenantID); + T2Tenant *theTenant = theTenantArrayList->GetTenantByID(id); if (theTenant) - UT2Utils::GetRoomNumberString(theTenant->GetRoomNumber(mDocument->mFloorInfo), roomNumberStr); + UT2Utils::GetRoomNumberString(theTenant->GetRoomNumber(mDocument->mFloorInfo), roomNum); - roomNumberStr += " "; - str = roomNumberStr.Left(7); - str += nameStr; + roomNum += " "; + text = roomNum.Left(7); + text += name; - int theIndex = theListBox->AddString(str); - theListBox->SetItemDataPtr(theIndex, theName); + int ind = listBox->AddString(text); + listBox->SetItemDataPtr(ind, theName); } } } |