classpath-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[cp-patches] FYI: minor fixes for AbstractDocument


From: Roman Kennke
Subject: [cp-patches] FYI: minor fixes for AbstractDocument
Date: Tue, 02 Aug 2005 17:33:52 +0200
User-agent: Mozilla Thunderbird 1.0.2 (X11/20050317)

2005-08-02  Roman Kennke  <address@hidden>

        * javax/swing/text/AbstractDocument.java
        (AbstractElement.AbstractElement): Create an empty AttributeSet
        if the argument s == null.
        (AbstractElement.getAttribute): Return the element itself instead
        of the wrapped attributes.

/Roman
Index: javax/swing/text/AbstractDocument.java
===================================================================
RCS file: /cvsroot/classpath/classpath/javax/swing/text/AbstractDocument.java,v
retrieving revision 1.21
diff -u -r1.21 AbstractDocument.java
--- javax/swing/text/AbstractDocument.java      1 Aug 2005 12:02:41 -0000       
1.21
+++ javax/swing/text/AbstractDocument.java      2 Aug 2005 15:31:05 -0000
@@ -1002,7 +1002,10 @@
     public AbstractElement(Element p, AttributeSet s)
     {
       element_parent = p;
-      attributes = s;
+      AttributeContext ctx = getAttributeContext();
+      attributes = ctx.getEmptySet();
+      if (s != null)
+        attributes = ctx.addAttributes(attributes, s);
     }
 
     /**
@@ -1275,7 +1278,7 @@
      */
     public AttributeSet getAttributes()
     {
-      return attributes;
+      return this;
     }
 
     /**

reply via email to

[Prev in Thread] Current Thread [Next in Thread]