]> git.sesse.net Git - vlc/commitdiff
Same as previous commit
authorRémi Denis-Courmont <rem@videolan.org>
Tue, 31 May 2005 08:35:18 +0000 (08:35 +0000)
committerRémi Denis-Courmont <rem@videolan.org>
Tue, 31 May 2005 08:35:18 +0000 (08:35 +0000)
(should close #87)

modules/gui/wxwindows/playlist.cpp

index 26f04c7b364a54a433aadafdb4b006999b9a60d0..b34080ca068b7bc34ebf0499af6e7d9f3c3ac09c 100644 (file)
@@ -1001,22 +1001,19 @@ void Playlist::OnSearch( wxCommandEvent& WXUNUSED(event) )
      FindItemByName( treectrl->GetRootItem(), search_string,
                      search_current, &pb_found );
 
-    if( found.IsOk() )
-    {
-        search_current = found;
-        treectrl->SelectItem( found, true );
-    }
-    else
+    if( !found.IsOk() )
     {
         wxTreeItemId dummy;
         search_current = dummy;
         found =  FindItemByName( treectrl->GetRootItem(), search_string,
                                  search_current, &pb_found );
-        if( found.IsOk() )
-        {
-            search_current = found;
-            treectrl->SelectItem( found, true );
-        }
+    }
+
+    if( found.IsOk() )
+    {
+        search_current = found;
+        treectrl->EnsureVisible( found );
+        treectrl->SelectItem( found, true );
     }
 }