From 2d8cf20d0d5ca6b1fbdefc22229d4b7cf1497ede Mon Sep 17 00:00:00 2001 From: mark Date: Tue, 17 Jan 2006 18:09:40 +0000 Subject: Imported GNU Classpath 0.20 * Makefile.am (AM_CPPFLAGS): Add classpath/include. * java/nio/charset/spi/CharsetProvider.java: New override file. * java/security/Security.java: Likewise. * sources.am: Regenerated. * Makefile.in: Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@109831 138bc75d-0d04-0410-961f-82ee72b054a4 --- libjava/classpath/java/awt/GridBagLayout.java | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) (limited to 'libjava/classpath/java/awt/GridBagLayout.java') diff --git a/libjava/classpath/java/awt/GridBagLayout.java b/libjava/classpath/java/awt/GridBagLayout.java index 083c0b7a7a3..714e080d7b2 100644 --- a/libjava/classpath/java/awt/GridBagLayout.java +++ b/libjava/classpath/java/awt/GridBagLayout.java @@ -341,11 +341,14 @@ public class GridBagLayout GridBagLayoutInfo info = getLayoutInfo (parent, PREFERREDSIZE); if (info.cols == 0 && info.rows == 0) return; - layoutInfo = info; // DEBUG - //dumpLayoutInfo (layoutInfo); - + //dumpLayoutInfo (info); + + // Calling setBounds on these components causes this layout to + // be invalidated, clearing the layout information cache, + // layoutInfo. So we wait until after this for loop to set + // layoutInfo. for(int i = 0; i < components.length; i++) { Component component = components [i]; @@ -357,11 +360,11 @@ public class GridBagLayout GridBagConstraints constraints = lookupInternalConstraints(component); - int cellx = sumIntArray(layoutInfo.colWidths, constraints.gridx); - int celly = sumIntArray(layoutInfo.rowHeights, constraints.gridy); - int cellw = sumIntArray(layoutInfo.colWidths, + int cellx = sumIntArray(info.colWidths, constraints.gridx); + int celly = sumIntArray(info.rowHeights, constraints.gridy); + int cellw = sumIntArray(info.colWidths, constraints.gridx + constraints.gridwidth) - cellx; - int cellh = sumIntArray(layoutInfo.rowHeights, + int cellh = sumIntArray(info.rowHeights, constraints.gridy + constraints.gridheight) - celly; Insets insets = constraints.insets; @@ -438,11 +441,14 @@ public class GridBagLayout break; } - component.setBounds(layoutInfo.pos_x + x, layoutInfo.pos_y + y, dim.width, dim.height); + component.setBounds(info.pos_x + x, info.pos_y + y, dim.width, dim.height); } // DEBUG - //dumpLayoutInfo (layoutInfo); + //dumpLayoutInfo (info); + + // Cache layout information. + layoutInfo = getLayoutInfo (parent, PREFERREDSIZE); } /** -- cgit v1.2.3