From: <gpa...@us...> - 2008-07-16 02:47:12
|
Revision: 3194 http://hugin.svn.sourceforge.net/hugin/?rev=3194&view=rev Author: gpatters1 Date: 2008-07-15 19:47:09 -0700 (Tue, 15 Jul 2008) Log Message: ----------- [2018960] Fix select by distance button in control point window. Modified Paths: -------------- hugin/trunk/src/hugin1/hugin/CPListFrame.cpp Modified: hugin/trunk/src/hugin1/hugin/CPListFrame.cpp =================================================================== --- hugin/trunk/src/hugin1/hugin/CPListFrame.cpp 2008-07-15 00:40:22 UTC (rev 3193) +++ hugin/trunk/src/hugin1/hugin/CPListFrame.cpp 2008-07-16 02:47:09 UTC (rev 3194) @@ -636,39 +636,26 @@ int sortCol = m_sortCol; bool sortAscend = m_sortAscend; - // sort by number, else the selection won't work.. - // it seems that the list is traversed in a different order - // than the items can be set with SetItemState.. really strange - - m_sortCol = 0; - m_sortAscend = true; - SortList(); - - long item = -1; + long row = -1; for(;;) { - item = m_list->GetNextItem(item, + row = m_list->GetNextItem(row, wxLIST_NEXT_ALL); - if (item < 0) { + if (row < 0) { break; } - - unsigned int cpNr = (unsigned int) item; + unsigned int cpNr = (unsigned int) m_list->GetItemData(row); if ( ((cps[cpNr].error > threshold ) && (!invert)) || ((cps[cpNr].error < threshold ) && (invert)) ) { // select control point - DEBUG_DEBUG("selecting item: " << item << " cpNr: " << cpNr); - m_list->SetItemState(item, wxLIST_STATE_SELECTED, wxLIST_STATE_SELECTED); + DEBUG_DEBUG("selecting row: " << row << " cpNr: " << cpNr); + + m_list->SetItemState(row, wxLIST_STATE_SELECTED, wxLIST_STATE_SELECTED); } else { - m_list->SetItemState(item, 0, wxLIST_STATE_SELECTED); + m_list->SetItemState(row, 0, wxLIST_STATE_SELECTED); } - } while (item != -1); + } while (row != -1); - // restore old sort order. - m_sortCol = sortCol; - m_sortAscend = sortAscend; - - SortList(); m_list->Thaw(); m_freeze = false; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |