Fixed a few things that differed from what the API stated.

2005-12-16  Lillian Angel  <[EMAIL PROTECTED]>

        * javax/swing/text/StyledEditorKit.java
        (createInputAttributes): This should copy the element
        attributes into the set, not clear out the set. Fixed
        to match the API spec.
        * javax/swing/text/html/HTMLEditorKit.java
        (getInputAttributes): Added API documentation. Fixed
        implementation. Combining all input attributes should
        not be done here.

Index: javax/swing/text/StyledEditorKit.java
===================================================================
RCS file: /cvsroot/classpath/classpath/javax/swing/text/StyledEditorKit.java,v
retrieving revision 1.17
diff -u -r1.17 StyledEditorKit.java
--- javax/swing/text/StyledEditorKit.java	13 Dec 2005 22:15:16 -0000	1.17
+++ javax/swing/text/StyledEditorKit.java	16 Dec 2005 21:46:06 -0000
@@ -714,9 +714,7 @@
   protected void createInputAttributes(Element element,
 				       MutableAttributeSet set)
   {
-    AttributeSet atts = element.getAttributes();
-    set.removeAttributes(set);
     // FIXME: Filter out component, icon and element name attributes.
-    set.addAttributes(atts);
+    set.addAttributes(element.getAttributes());
   }
 }
Index: javax/swing/text/html/HTMLEditorKit.java
===================================================================
RCS file: /cvsroot/classpath/classpath/javax/swing/text/html/HTMLEditorKit.java,v
retrieving revision 1.20
diff -u -r1.20 HTMLEditorKit.java
--- javax/swing/text/html/HTMLEditorKit.java	16 Dec 2005 21:35:06 -0000	1.20
+++ javax/swing/text/html/HTMLEditorKit.java	16 Dec 2005 21:46:06 -0000
@@ -1131,12 +1131,13 @@
     defaultCursor = cursor;
   }
   
+  /**
+   * Gets the input attributes used for the styled editing actions.
+   * 
+   * @return the attribute set
+   */
   public MutableAttributeSet getInputAttributes()
   {
-    if (inputAttributes != null)
-      inputAttributes.addAttributes(super.getInputAttributes());
-    else
-      inputAttributes = super.getInputAttributes();
     return inputAttributes;
   }
   
_______________________________________________
Classpath-patches mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/classpath-patches

Reply via email to