[hyena] Fix infinite recursion bug in ScrollTo



commit c0554b1eff2b2796e44c7770f34a7e08e02ec627
Author: Gabriel Burt <gabriel burt gmail com>
Date:   Wed Mar 10 16:41:44 2010 -0800

    Fix infinite recursion bug in ScrollTo
    
    Disambiguate methods by renaming one to ScrollToY (double).

 .../ListView/ListView_DragAndDrop.cs               |    4 ++--
 .../ListView/ListView_Interaction.cs               |   16 ++++++++--------
 .../Hyena.Data.Gui/ListView/ListView_Model.cs      |    6 +++---
 3 files changed, 13 insertions(+), 13 deletions(-)
---
diff --git a/src/Hyena.Gui/Hyena.Data.Gui/ListView/ListView_DragAndDrop.cs b/src/Hyena.Gui/Hyena.Data.Gui/ListView/ListView_DragAndDrop.cs
index ccbddeb..2cdaea4 100644
--- a/src/Hyena.Gui/Hyena.Data.Gui/ListView/ListView_DragAndDrop.cs
+++ b/src/Hyena.Gui/Hyena.Data.Gui/ListView/ListView_DragAndDrop.cs
@@ -180,7 +180,7 @@ namespace Hyena.Data.Gui
 
         private bool OnDragVScrollTimeout ()
         {
-            ScrollTo (VadjustmentValue + (drag_scroll_velocity * drag_scroll_velocity_max));
+            ScrollToY (VadjustmentValue + (drag_scroll_velocity * drag_scroll_velocity_max));
             DragReorderUpdateRow ();
             return true;
         }
@@ -210,4 +210,4 @@ namespace Hyena.Data.Gui
             return row;
         }
     }
-}
\ No newline at end of file
+}
diff --git a/src/Hyena.Gui/Hyena.Data.Gui/ListView/ListView_Interaction.cs b/src/Hyena.Gui/Hyena.Data.Gui/ListView/ListView_Interaction.cs
index ca0b51a..917f2aa 100644
--- a/src/Hyena.Gui/Hyena.Data.Gui/ListView/ListView_Interaction.cs
+++ b/src/Hyena.Gui/Hyena.Data.Gui/ListView/ListView_Interaction.cs
@@ -145,12 +145,12 @@ namespace Hyena.Data.Gui
             double y_at_row = GetViewPointForModelRow (row_index).Y;
             if (align_y) {
                 if (y_at_row < VadjustmentValue) {
-                    ScrollTo (y_at_row);
+                    ScrollToY (y_at_row);
                 } else if (vadjustment != null && (y_at_row + ChildSize.Height) > (vadjustment.Value + vadjustment.PageSize)) {
-                    ScrollTo (y_at_row + ChildSize.Height - (vadjustment.PageSize));
+                    ScrollToY (y_at_row + ChildSize.Height - (vadjustment.PageSize));
                 }
             } else if (vadjustment != null) {
-                ScrollTo (vadjustment.Value + y_at_row - GetViewPointForModelRow (Selection.FocusedIndex).Y);
+                ScrollToY (vadjustment.Value + y_at_row - GetViewPointForModelRow (Selection.FocusedIndex).Y);
             }
 
             Selection.FocusedIndex = row_index;
@@ -790,7 +790,7 @@ namespace Hyena.Data.Gui
 
         private bool OnDragHScrollTimeout ()
         {
-            ScrollTo (hadjustment, HadjustmentValue + (drag_scroll_velocity * drag_scroll_velocity_max));
+            ScrollToY (hadjustment, HadjustmentValue + (drag_scroll_velocity * drag_scroll_velocity_max));
             OnMotionNotifyEvent (pressed_column_x);
             return true;
         }
@@ -963,12 +963,12 @@ namespace Hyena.Data.Gui
             }
         }
 
-        public void ScrollTo (double val)
+        public void ScrollToY (double val)
         {
-            ScrollTo (vadjustment, val);
+            ScrollToY (vadjustment, val);
         }
 
-        private void ScrollTo (Adjustment adjustment, double val)
+        private void ScrollToY (Adjustment adjustment, double val)
         {
             if (adjustment != null) {
                 adjustment.Value = Math.Max (0.0, Math.Min (val, adjustment.Upper - adjustment.PageSize));
@@ -977,7 +977,7 @@ namespace Hyena.Data.Gui
 
         public void ScrollTo (int index)
         {
-            ScrollTo (GetViewPointForModelRow (index).Y);
+            ScrollToY (GetViewPointForModelRow (index).Y);
         }
 
         public void CenterOn (int index)
diff --git a/src/Hyena.Gui/Hyena.Data.Gui/ListView/ListView_Model.cs b/src/Hyena.Gui/Hyena.Data.Gui/ListView/ListView_Model.cs
index 62c7382..715eac8 100644
--- a/src/Hyena.Gui/Hyena.Data.Gui/ListView/ListView_Model.cs
+++ b/src/Hyena.Gui/Hyena.Data.Gui/ListView/ListView_Model.cs
@@ -101,12 +101,12 @@ namespace Hyena.Data.Gui
             UpdateAdjustments ();
 
             if (vpos != null) {
-                ScrollTo ((double) vpos);
+                ScrollToY ((double) vpos);
             } else if (Model.Count <= RowsInView) {
                 // If our view fits all rows at once, make sure we're scrolled to the top
-                ScrollTo (0.0);
+                ScrollToY (0.0);
             } else if (vadjustment != null) {
-                ScrollTo (vadjustment.Value);
+                ScrollToY (vadjustment.Value);
             }
 
             if (Model != null && Selection != null) {



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