[OpenSTA-devel] [ opensta-Bugs-1507652 ] CFilterDlg::OnGetdispinfoUserIdList bug
Brought to you by:
dansut
|
From: SourceForge.net <no...@so...> - 2006-12-12 13:49:55
|
Bugs item #1507652, was opened at 2006-06-17 03:14 Message generated for change (Comment added) made by dansut You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=110857&aid=1507652&group_id=10857 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: GUI Issue Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: denis-0 (denis-0) Assigned to: Nobody/Anonymous (nobody) Summary: CFilterDlg::OnGetdispinfoUserIdList bug Initial Comment: Hello This following code from the FilterDlg.cpp file probably has a bug. void CFilterDlg::OnGetdispinfoUserIdList(NMHDR* pNMHDR, LRESULT* pResult) { LV_DISPINFO* pDispInfo = (LV_DISPINFO*)pNMHDR; LV_ITEM &lv = pDispInfo->item; if(lv.mask | LVIF_TEXT ) { lv.pszText = m_arstrUserIds[lv.iItem].GetBuffer(0); } *pResult = 0; } lv.mask & LVIF_TEXT was probably meant instead of lv.mask | LVIF_TEXT Best regards Denis Linine ---------------------------------------------------------------------- >Comment By: Daniel Sutcliffe (dansut) Date: 2006-12-12 08:49 Message: Logged In: YES user_id=19748 Originator: NO I don't doubt that the code is obviously wrong, etc. All I wanted was a small clue as to what control(s) this code affects so that once I've made the change I can go in and sanity check that they still work as intended. If I don't get this type information then it means that I have to do the investigation which increases the length of time I have to spend on this bug report, which in turn reduces the chance of me ever getting to it ... thanks. ---------------------------------------------------------------------- Comment By: denis-0 (denis-0) Date: 2006-12-12 04:20 Message: Logged In: YES user_id=1541449 Originator: YES Hi, The point is that the code is obviously wrong (a typo, most probably). The if(lv.mask | LVIF_TEXT ) statement is always true, no matter what the lv.mask is. This makes the behavior of the list control undefined - instead of setting relevant fields of the passed LV_ITEM to proper values (zeroing them) it always sets its lv.pszText, no matter what kind of information was really requested. In practice: I tried such code in another application and the control worked nearly OK, except sporadically crashing the application because of access violations after returning from the OnGetdispinfoUserIdList call on a Win 9x machine (and not on XP). The if(lv.mask | LVIF_TEXT ) statement makes absolutely no sense and I do not think it makes sense to discuss why - it's a typo, most probably, and (lv.mask & LVIF_TEXT ) was meant instead. Best regards Denis Linine ---------------------------------------------------------------------- Comment By: Daniel Sutcliffe (dansut) Date: 2006-12-11 19:22 Message: Logged In: YES user_id=19748 Originator: NO Could you please describe the user symptom of this problem and where it occurs - also what your code change does/improves? Otherwise I feel like I'm just going to keep glancing over and ignoring it as it involves me doing some work just to find out what the point is ... ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=110857&aid=1507652&group_id=10857 |