changeset 5739:881baee7d434

RT-34333: HTMLEditor font size popup is incorrectly sized
author jgiles
date Mon, 18 Nov 2013 13:26:53 +1300
parents 3c6808a1eb1d
children d892fc853b2a
files modules/controls/src/main/java/com/sun/javafx/scene/control/skin/VirtualFlow.java
diffstat 1 files changed, 6 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/modules/controls/src/main/java/com/sun/javafx/scene/control/skin/VirtualFlow.java	Fri Nov 15 10:36:36 2013 +1300
+++ b/modules/controls/src/main/java/com/sun/javafx/scene/control/skin/VirtualFlow.java	Mon Nov 18 13:26:53 2013 +1300
@@ -1678,7 +1678,6 @@
             Callback<VirtualFlow,T> createCell = getCreateCell();
             if (createCell != null) {
                 accumCell = createCell.call(this);
-                accumCell.getProperties().put(NEW_CELL, null);
                 accumCellParent.getChildren().setAll(accumCell);
             }
         }
@@ -1786,10 +1785,13 @@
         assert cell != null;
 
         cell.updateIndex(index);
-        
-        if (cell.isNeedsLayout() && cell.getScene() != null && cell.getProperties().containsKey(NEW_CELL)) {
+
+        // make sure the cell is sized correctly. This is important for both
+        // general layout of cells in a VirtualFlow, but also in cases such as
+        // RT-34333, where the sizes were being reported incorrectly to the
+        // ComboBox popup.
+        if (cell.isNeedsLayout() && cell.getScene() != null) {
             cell.impl_processCSS(false);
-            cell.getProperties().remove(NEW_CELL);
         }
     }
 
@@ -1800,13 +1802,6 @@
      **************************************************************************/
 
     /**
-     * Indicates that this is a newly created cell and we need call impl_processCSS for it.
-     * 
-     * See RT-23616 for more details.
-     */
-    private static final String NEW_CELL = "newcell";
-    
-    /**
      * Get a cell which can be used in the layout. This function will reuse
      * cells from the pile where possible, and will create new cells when
      * necessary.
@@ -1855,7 +1850,6 @@
                 }
             } else {
                 cell = getCreateCell().call(this);
-                cell.getProperties().put(NEW_CELL, null);
             }
         }