summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2002-01-25 17:25:26 +0000
committerTom Tromey <tromey@gcc.gnu.org>2002-01-25 17:25:26 +0000
commit2fb4e07f24a248effea30f2fd56173d56d612088 (patch)
tree85b7efd7458539c32b0b0f84cabc914c4b6e789d
parentfd29f6eae8e6109ca0b141a249482ef2e986535a (diff)
downloadgcc-2fb4e07f24a248effea30f2fd56173d56d612088.tar.gz
FlowLayout.java (layoutContainer): Correctly compute loop termination condition.
* java/awt/FlowLayout.java (layoutContainer): Correctly compute loop termination condition. * java/awt/GridLayout.java (getSize): Use `real_cols' to compute width. From-SVN: r49216
-rw-r--r--libjava/ChangeLog7
-rw-r--r--libjava/java/awt/FlowLayout.java8
-rw-r--r--libjava/java/awt/GridLayout.java4
3 files changed, 13 insertions, 6 deletions
diff --git a/libjava/ChangeLog b/libjava/ChangeLog
index e8ab774e63a..66eac2dd6f0 100644
--- a/libjava/ChangeLog
+++ b/libjava/ChangeLog
@@ -1,3 +1,10 @@
+2002-01-25 Tom Tromey <tromey@redhat.com>
+
+ * java/awt/FlowLayout.java (layoutContainer): Correctly compute
+ loop termination condition.
+ * java/awt/GridLayout.java (getSize): Use `real_cols' to compute
+ width.
+
2002-01-24 Tom Tromey <tromey@redhat.com>
* java/awt/Shape.java: Merged with Classpath.
diff --git a/libjava/java/awt/FlowLayout.java b/libjava/java/awt/FlowLayout.java
index 90c178ac979..a432a51a5c0 100644
--- a/libjava/java/awt/FlowLayout.java
+++ b/libjava/java/awt/FlowLayout.java
@@ -207,12 +207,12 @@ public class FlowLayout implements LayoutManager, Serializable
else
x = d.width - new_w;
- for (int k = i; i < j; ++k)
+ for (int k = i; k < j; ++k)
{
- if (comps[i].visible)
+ if (comps[k].visible)
{
- Dimension c = comps[i].getPreferredSize ();
- comps[i].setLocation (x, y);
+ Dimension c = comps[k].getPreferredSize ();
+ comps[k].setLocation (x, y);
x += c.width + vgap;
}
}
diff --git a/libjava/java/awt/GridLayout.java b/libjava/java/awt/GridLayout.java
index d887f3eaa7d..e6cf1ec19bf 100644
--- a/libjava/java/awt/GridLayout.java
+++ b/libjava/java/awt/GridLayout.java
@@ -320,8 +320,8 @@ public class GridLayout implements LayoutManager, Serializable
Insets ins = parent.getInsets ();
// We subtract out an extra gap here because the gaps are only
// between cells.
- w = ins.left + ins.right + real_rows * (w + hgap) - hgap;
- h = ins.top + ins.bottom + real_cols * (h + vgap) - vgap;
+ w = ins.left + ins.right + real_cols * (w + hgap) - hgap;
+ h = ins.top + ins.bottom + real_rows * (h + vgap) - vgap;
return new Dimension (w, h);
}