diff options
author | Mark Wielaard <mark@klomp.org> | 2005-12-18 01:27:43 +0000 |
---|---|---|
committer | Mark Wielaard <mark@klomp.org> | 2005-12-18 01:27:43 +0000 |
commit | d2f8b5b4cc7ece796d7806a90df14556637bcb79 (patch) | |
tree | ddd80b1aef307d5ba110b12a8d8cff5b9cc2b8e5 /javax/swing/text/html/HTMLDocument.java | |
parent | 6a09237a5aafef79c467c51e65ddcadbf2ed2cb3 (diff) | |
download | classpath-d2f8b5b4cc7ece796d7806a90df14556637bcb79.tar.gz |
* javax/swing/text/html/HTMLDocument.java (BlockElementgetName):
Qualify NameAttribute as comming from StyleConstants.
(RunElement.getName): Likewise.
(getElement): Check whether grandChild element is null before
returning it.
Diffstat (limited to 'javax/swing/text/html/HTMLDocument.java')
-rw-r--r-- | javax/swing/text/html/HTMLDocument.java | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/javax/swing/text/html/HTMLDocument.java b/javax/swing/text/html/HTMLDocument.java index ab55052c3..0e4e279c5 100644 --- a/javax/swing/text/html/HTMLDocument.java +++ b/javax/swing/text/html/HTMLDocument.java @@ -57,6 +57,7 @@ import javax.swing.text.ElementIterator; import javax.swing.text.GapContent; import javax.swing.text.MutableAttributeSet; import javax.swing.text.SimpleAttributeSet; +import javax.swing.text.StyleConstants; import javax.swing.text.html.HTML.Tag; /** @@ -467,7 +468,7 @@ public class HTMLDocument extends DefaultStyledDocument */ public String getName() { - return (String) getAttribute(NameAttribute); + return (String) getAttribute(StyleConstants.NameAttribute); } } @@ -499,7 +500,7 @@ public class HTMLDocument extends DefaultStyledDocument */ public String getName() { - return (String) getAttribute(NameAttribute); + return (String) getAttribute(StyleConstants.NameAttribute); } /** @@ -1399,7 +1400,9 @@ public class HTMLDocument extends DefaultStyledDocument if (child.getAttributes().containsAttribute(attribute, value)) return child; - return getElement(child, attribute, value); + Element grandChild = getElement(child, attribute, value); + if (grandChild != null) + return grandChild; } } return null; |