[Widelands-cvs] SF.net SVN: widelands: [1711] trunk/src/ui/ui_basic/ui_listselect.cc
Status: Beta
Brought to you by:
sirver
From: <de...@us...> - 2006-10-28 06:07:07
|
Revision: 1711 http://svn.sourceforge.net/widelands/?rev=1711&view=rev Author: dertron Date: 2006-10-27 23:06:58 -0700 (Fri, 27 Oct 2006) Log Message: ----------- Turn complicated data flow into simple control flow Modified Paths: -------------- trunk/src/ui/ui_basic/ui_listselect.cc Modified: trunk/src/ui/ui_basic/ui_listselect.cc =================================================================== --- trunk/src/ui/ui_basic/ui_listselect.cc 2006-10-28 06:04:55 UTC (rev 1710) +++ trunk/src/ui/ui_basic/ui_listselect.cc 2006-10-28 06:06:58 UTC (rev 1711) @@ -145,12 +145,13 @@ std::swap(m_entries[m], m_entries[n]); - int selection = m_selection; - const int sm = m, sn = n; - const bool selected_m = selection == sm, selected_n = selection == sn; - if (selected_m) selection = sn; - else if (selected_n) selection = sm; - if (selected_m or selected_n) selected.call(m_selection = selection); + if (m_selection == (int)m) { + m_selection = n; + selected.call(n); + } else if (m_selection == (int)n) { + m_selection = m; + selected.call(m); + } } /* This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |