diff options
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | javax/swing/text/html/StyleSheet.java | 9 |
2 files changed, 11 insertions, 3 deletions
@@ -12,6 +12,11 @@ 2006-11-25 Mark Wielaard <mark@klomp.org> + * javax/swing/text/html/StyleSheet.java (paint): Guard against + getChildAllocation() returning null. + +2006-11-25 Mark Wielaard <mark@klomp.org> + * gnu/javax/swing/text/html/css/Selector.java (calculateSpecificity): Use clazzIndex for id substring. diff --git a/javax/swing/text/html/StyleSheet.java b/javax/swing/text/html/StyleSheet.java index 58f1b9341..27d69bf4b 100644 --- a/javax/swing/text/html/StyleSheet.java +++ b/javax/swing/text/html/StyleSheet.java @@ -1324,9 +1324,12 @@ public class StyleSheet extends StyleContext : a1.getBounds(); ParagraphView par = (ParagraphView) v1; Shape a = par.getChildAllocation(0, r1); - Rectangle r = a instanceof Rectangle ? (Rectangle) a - : a.getBounds(); - centerY = (int) (r.height / 2 + r.y); + if (a != null) + { + Rectangle r = a instanceof Rectangle ? (Rectangle) a + : a.getBounds(); + centerY = (int) (r.height / 2 + r.y); + } } } if (centerY == -1) |