harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hinde...@apache.org
Subject svn commit: r495977 - in /harmony/enhanced/classlib/trunk/modules/swing/src: main/java/common/javax/swing/JTextField.java test/api/java/common/javax/swing/JTextFieldTest.java
Date Sat, 13 Jan 2007 21:46:44 GMT
Author: hindessm
Date: Sat Jan 13 13:46:43 2007
New Revision: 495977

URL: http://svn.apache.org/viewvc?view=rev&rev=495977
Log:
Applying patch from "[#HARMONY-2627] [classlib][swing]
JTextField.getScrollOffset() returns 5 while RI returns 0".

Modified:
    harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/JTextField.java
    harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/JTextFieldTest.java

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/JTextField.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/JTextField.java?view=diff&rev=495977&r1=495976&r2=495977
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/JTextField.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/JTextField.java
Sat Jan 13 13:46:43 2007
@@ -342,7 +342,7 @@
     }
 
     public int getScrollOffset() {
-        return (scrollOffsetWasSet) ? scrollOffset : getMaxScrollOffset();
+        return scrollOffset;
     }
 
     public String getUIClassID() {

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/JTextFieldTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/JTextFieldTest.java?view=diff&rev=495977&r1=495976&r2=495977
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/JTextFieldTest.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/JTextFieldTest.java
Sat Jan 13 13:46:43 2007
@@ -45,6 +45,7 @@
 import javax.swing.text.DefaultEditorKit;
 import javax.swing.text.Document;
 import javax.swing.text.PlainDocument;
+import javax.swing.text.View;
 
 public class JTextFieldTest extends SwingTestCase {
     String sLTR = "abcd";
@@ -718,6 +719,17 @@
             brmTest(brmBidi, brmBidi_min, jtfBidi.getScrollOffset(), brmBidi_extent,
                     brmBidi_max);
         }
+    }
+
+    // Regression for HARMONY-2627
+    public void testGetScrollOffset() {
+        jtf = new ExtJTextField("abc");
+        final int viewWidth = (int)jtf.getUI().getRootView(jtf)
+                                   .getPreferredSpan(View.X_AXIS);
+
+        assertEquals(viewWidth + 4, jtf.getPreferredSize().width);
+        assertEquals(0, jtf.getScrollOffset());
+        assertEquals(viewWidth + 4 + 1, getInitialScrollOffest(jtf));
     }
 
     public void testSerialization() {



Mime
View raw message