MCPcopy Create free account
hub / github.com/WinMerge/winmerge / LoadState

Method LoadState

Src/Common/SuperComboBox.cpp:216–247  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

214}
215
216void CSuperComboBox::LoadState(LPCTSTR szRegSubKey)
217{
218 ResetContent();
219
220 int cnt = AfxGetApp()->GetProfileInt(szRegSubKey, _T("Count"), 0);
221 int idx = 0;
222 for (int i=0; i < cnt && idx < m_nMaxItems; i++)
223 {
224 CString s,s2;
225 s2.Format(_T("Item_%d"), i);
226 s = AfxGetApp()->GetProfileString(szRegSubKey, s2);
227 if (FindStringExact(-1, s) == CB_ERR && !s.IsEmpty())
228 {
229 AddString(s);
230 idx++;
231 }
232 }
233 if (idx > 0)
234 {
235 bool bIsEmpty = (m_bCanBeEmpty ? (AfxGetApp()->GetProfileInt(szRegSubKey, _T("Empty"), FALSE) == TRUE) : false);
236 if (bIsEmpty)
237 {
238 SetCurSel(-1);
239 }
240 else
241 {
242 SetCurSel(0);
243 if (m_bExtendedFileNames)
244 GetEditCtrl()->SetWindowText(m_sFullStateText[0]);
245 }
246 }
247}
248
249void CSuperComboBox::GetLBText(int nIndex, CString &rString) const
250{

Callers

nothing calls this directly

Calls 4

GetProfileIntMethod · 0.80
GetProfileStringMethod · 0.80
IsEmptyMethod · 0.80
FormatMethod · 0.45

Tested by

no test coverage detected