ecere/gui/ListBox: Fix for deleting sub-rows on a DeleteRow()
authorJerome St-Louis <jerome@ecere.com>
Fri, 25 Nov 2011 22:50:49 +0000 (17:50 -0500)
committerJerome St-Louis <jerome@ecere.com>
Fri, 25 Nov 2011 22:52:12 +0000 (17:52 -0500)
ecere/src/gui/controls/ListBox.ec

index 98ae103..f3c7030 100644 (file)
@@ -1381,9 +1381,17 @@ public:
       if(!row) row = currentRow;
       if(row)
       {
-         DataRow search;
+         DataRow sub, next, search;
          // Trying to move this here (Messed up deleting watches)
          //HideEditBox(false, false, true);
+
+         // Delete Sub Rows
+         for(sub = row.subRows.first; sub; sub = next)
+         {
+            next = sub.next;
+            DeleteRow(sub);
+         }
+
          if(row.parent.IsExpanded())
          {
             // TODO: FIX row indices