removeAttributes(AttributeSet) should only remove attributes if their
keys AND values are found in the given set. This is fixed now, and I'll
commit a Mauve test soon.
2005-09-27 Anthony Balkissoon <[EMAIL PROTECTED]>
* javax/swing/text/SimpleAttributeSet.java:
(removeAttributes(AttributeSet)): Only remove attributes from the
current set if their keys AND values are found in the given set.
--Tony
Index: javax/swing/text/SimpleAttributeSet.java
===================================================================
RCS file: /cvsroot/classpath/classpath/javax/swing/text/SimpleAttributeSet.java,v
retrieving revision 1.10
diff -u -r1.10 SimpleAttributeSet.java
--- javax/swing/text/SimpleAttributeSet.java 13 Sep 2005 23:44:50 -0000 1.10
+++ javax/swing/text/SimpleAttributeSet.java 27 Sep 2005 19:34:36 -0000
@@ -173,9 +173,21 @@
tab.remove(name);
}
+ /**
+ * Removes attributes from this set if they are found in the
+ * given set. Only attributes whose key AND value are removed.
+ * Removes attributes only from this set, not from the resolving parent.
+ */
public void removeAttributes(AttributeSet attributes)
{
- removeAttributes(attributes.getAttributeNames());
+ Enumeration e = attributes.getAttributeNames();
+ while (e.hasMoreElements())
+ {
+ Object name = e.nextElement();
+ Object val = attributes.getAttribute(name);
+ if (containsAttribute(name, val))
+ removeAttribute(name);
+ }
}
public void removeAttributes(Enumeration names)
_______________________________________________
Classpath-patches mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/classpath-patches