changeset 4847:c661253e25cf

RT-32559: TableView: replaced columns disappear
author jgiles
date Fri, 30 Aug 2013 13:56:25 +1200
parents 9b8894841264
children b2d31f6fb68d
files modules/controls/src/main/java/com/sun/javafx/scene/control/skin/NestedTableColumnHeader.java
diffstat 1 files changed, 8 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/modules/controls/src/main/java/com/sun/javafx/scene/control/skin/NestedTableColumnHeader.java	Thu Aug 29 15:58:24 2013 +1200
+++ b/modules/controls/src/main/java/com/sun/javafx/scene/control/skin/NestedTableColumnHeader.java	Fri Aug 30 13:56:25 2013 +1200
@@ -339,8 +339,9 @@
 
         // children columns need to share the total available width
         double x = snappedLeftInset();
-        int i = 0;
-        for (TableColumnHeader n : getColumnHeaders()) {
+        int pos = 0;
+        for (int i = 0, max = getColumnHeaders().size(); i < max; i++) {
+            TableColumnHeader n = getColumnHeaders().get(i);
             if (! n.isVisible()) continue;
 
             double prefWidth = snapSize(n.prefWidth(-1));
@@ -364,7 +365,7 @@
 
             // position drag overlay to intercept column resize requests
             if (dragRects != null && i < dragRects.size()) {
-                Rectangle dragRect = dragRects.get(i++);
+                Rectangle dragRect = dragRects.get(pos++);
                 dragRect.setHeight(getHeight() - label.getHeight());
                 dragRect.relocate(x - DRAG_RECT_WIDTH / 2, snappedTopInset() + labelHeight);
             }
@@ -498,7 +499,10 @@
         if (updateColumns) {
             updateTableColumnHeaders();
             updateColumns = false;
-            getParent().requestLayout();
+
+            // Added to resolve RT-32559, where reordering columns resulted in
+            // their disappearance
+            impl_processCSS(false);
         }
     }