static void vPopulateMainSubList(CMainEntryList& DestList, const SFILTERAPPLIED_CAN* psFilterConfigured, const SFILTERAPPLIED_CAN* psFilterApplied) { ASSERT(psFilterConfigured != NULL); DestList.RemoveAll(); SMAINENTRY sMainEntry; sMainEntry.m_omMainEntryName = _T("CAN"); if (psFilterApplied == NULL) { SMAINENTRY sMainEntry; sMainEntry.m_omMainEntryName = _T("FILTER_SELECTION_CAN"); for (INT i = 0; i < psFilterConfigured->m_ushTotal; i++) { SSUBENTRY sSubEntry; sSubEntry.m_omSubEntryName.Format("%s", psFilterConfigured->m_psFilters[i].m_sFilterName.m_acFilterName); sMainEntry.m_odUnSelEntryList.AddTail(sSubEntry); } } else { for (INT i = 0; i < psFilterConfigured->m_ushTotal; i++) { SSUBENTRY sSubEntry; sSubEntry.m_omSubEntryName.Format("%s", psFilterConfigured->m_psFilters[i].m_sFilterName.m_acFilterName); if (SFILTERSET::psGetFilterSetPointer(psFilterApplied->m_psFilters, psFilterApplied->m_ushTotal, sSubEntry.m_omSubEntryName.GetBuffer(MAX_PATH)) != NULL) { sMainEntry.m_odSelEntryList.AddTail(sSubEntry); } else { sMainEntry.m_odUnSelEntryList.AddTail(sSubEntry); } } } DestList.AddTail(sMainEntry); }
void CMsgFilterConfigPage::populateFilterConfiguration(CMainEntryList& DestList) { DestList.RemoveAll(); SMAINENTRY sMainEntry; sMainEntry.m_omMainEntryName = mCaption.c_str(); for (auto filter : mFilterDetails->mFiltersConfigured) { SSUBENTRY sSubEntry; sSubEntry.m_omSubEntryName.Format("%s", filter.c_str()); if (mFilterDetails->mFitersApplied.find(filter) != mFilterDetails->mFitersApplied.end()) { sMainEntry.m_odSelEntryList.AddTail(sSubEntry); } else { sMainEntry.m_odUnSelEntryList.AddTail(sSubEntry); } } DestList.AddTail(sMainEntry); }