OSDN Git Service

* java/awt/FlowLayout.java (layoutContainer): Correctly compute
authortromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 25 Jan 2002 17:25:26 +0000 (17:25 +0000)
committertromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 25 Jan 2002 17:25:26 +0000 (17:25 +0000)
loop termination condition.
* java/awt/GridLayout.java (getSize): Use `real_cols' to compute
width.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@49216 138bc75d-0d04-0410-961f-82ee72b054a4

libjava/ChangeLog
libjava/java/awt/FlowLayout.java
libjava/java/awt/GridLayout.java

index e8ab774..66eac2d 100644 (file)
@@ -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.
index 90c178a..a432a51 100644 (file)
@@ -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;
              }
          }
index d887f3e..e6cf1ec 100644 (file)
@@ -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);
   }