harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a...@apache.org
Subject svn commit: r599840 - /harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/BorderLayout.java
Date Fri, 30 Nov 2007 15:10:32 GMT
Author: ayza
Date: Fri Nov 30 07:10:19 2007
New Revision: 599840

URL: http://svn.apache.org/viewvc?rev=599840&view=rev
Log:
Committing patch from HARMONY-5051 ([classlib][swing][EIOffice] popmenu's method getPreferredSize()
returned 0,0 before show)

Modified:
    harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/BorderLayout.java

Modified: harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/BorderLayout.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/BorderLayout.java?rev=599840&r1=599839&r2=599840&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/BorderLayout.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/BorderLayout.java
Fri Nov 30 07:10:19 2007
@@ -291,10 +291,6 @@
             validate(target);
             valid = wasValid;
 
-            if (visibleComponentsNumber == 0) {
-                return target.addInsets(new Dimension(0, 0));
-            }
-
             return target.addInsets(calculateLayoutSize(prefCompSizes));
         } finally {
             toolkit.unlockAWT();
@@ -429,16 +425,19 @@
         visibleComponentsNumber = 0;
 
         for (Component comp : components) {
-            if (comp.isVisible()) {
-                int index = constraints2Index(components2Constraints.get(comp),
-                        target.getComponentOrientation());
+            int index = constraints2Index(components2Constraints.get(comp),
+                    target.getComponentOrientation());
 
+            if (comp.isVisible()) {
                 if (visibleComponents[index] == null) {
                     visibleComponents[index] = comp;
                     visibleComponentsNumber++;
                     minCompSizes[index] = comp.getMinimumSize();
                     prefCompSizes[index] = comp.getPreferredSize();
                 }
+            } else if (visibleComponents[index] == null){
+                 minCompSizes[index] = comp.getMinimumSize();
+                 prefCompSizes[index] = comp.getPreferredSize();
             }
         }
     }



Mime
View raw message