banshee r3769 - in trunk/banshee: . src/Libraries/Hyena.Gui/Hyena.Data.Gui/ListView



Author: gburt
Date: Fri Apr 11 19:07:29 2008
New Revision: 3769
URL: http://svn.gnome.org/viewvc/banshee?rev=3769&view=rev

Log:
2008-04-11  Gabriel Burt  <gabriel burt gmail com>

	* src/Libraries/Hyena.Gui/Hyena.Data.Gui/ListView/ListView_Interaction.cs:
	Fix IndexOutOfBounds exception.


Modified:
   trunk/banshee/ChangeLog
   trunk/banshee/src/Libraries/Hyena.Gui/Hyena.Data.Gui/ListView/ListView_Interaction.cs

Modified: trunk/banshee/src/Libraries/Hyena.Gui/Hyena.Data.Gui/ListView/ListView_Interaction.cs
==============================================================================
--- trunk/banshee/src/Libraries/Hyena.Gui/Hyena.Data.Gui/ListView/ListView_Interaction.cs	(original)
+++ trunk/banshee/src/Libraries/Hyena.Gui/Hyena.Data.Gui/ListView/ListView_Interaction.cs	Fri Apr 11 19:07:29 2008
@@ -339,17 +339,21 @@
         
         private bool OnHeaderButtonRelease (Gdk.EventButton evnt)
         {
-            Column column = column_cache[pressed_column_index].Column;
-            if (column != null && Model is ISortable && column is ISortableColumn) {
-                ((ISortable)Model).Sort ((ISortableColumn)column);
-                Model.Reload ();
-                RecalculateColumnSizes ();
-                RegenerateColumnCache ();
-                InvalidateHeader ();
+            if (pressed_column_index > 0 && pressed_column_index < column_cache.Length) {
+                Column column = column_cache[pressed_column_index].Column;
+                if (column != null && Model is ISortable && column is ISortableColumn) {
+                    ((ISortable)Model).Sort ((ISortableColumn)column);
+                    Model.Reload ();
+                    RecalculateColumnSizes ();
+                    RegenerateColumnCache ();
+                    InvalidateHeader ();
+                }
+                
+                pressed_column_index = -1;
+                return true;
+            } else {
+                return false;
             }
-            
-            pressed_column_index = -1;
-            return true;
         }
         
         private bool OnListButtonRelease (Gdk.EventButton evnt)



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]