Author: alink
Date: Mon Jul  7 00:23:12 2008
New Revision: 27800

URL: http://svn.gna.org/viewcvs/wesnoth?rev=27800&view=rev
Log:
- clear the unit preview panel when filter return no unit
(fix a bug causing the last unit to stay visible there) 
- fix bad use of a size_t

Modified:
    trunk/src/dialogs.cpp

Modified: trunk/src/dialogs.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/dialogs.cpp?rev=27800&r1=27799&r2=27800&view=diff
==============================================================================
--- trunk/src/dialogs.cpp (original)
+++ trunk/src/dialogs.cpp Mon Jul  7 00:23:12 2008
@@ -762,14 +762,14 @@
 
 void unit_preview_pane::set_selection(int index)
 {
-       index = minimum<int>(int(size()-1),index);
+       index = minimum<int>(static_cast<int>(size())-1,index);
        if (filter_) {
                index = filter_->get_index(index);
        }
-       if(index != index_ && index >= 0) {
+       if(index != index_) {
                index_ = index;
                set_dirty();
-               if(map_ != NULL) {
+               if(map_ != NULL && index >= 0) {
                        details_button_.set_dirty();
                }
        }


_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits

Reply via email to