diff options
author | Robert Schuster <theBohemian@gmx.net> | 2006-05-03 19:23:25 +0000 |
---|---|---|
committer | Robert Schuster <theBohemian@gmx.net> | 2006-05-03 19:23:25 +0000 |
commit | caadf15c1007cc40bcee332871592a358e284deb (patch) | |
tree | 62a39d29032bfc02318d6b70bab0c93286a5da15 | |
parent | e5d30b58c24d0a372635fca11959f72cc84169fc (diff) | |
download | classpath-caadf15c1007cc40bcee332871592a358e284deb.tar.gz |
2006-05-03 Robert Schuster <robertschuster@fsfe.org>
* javax/swing/text/FieldView.java:
(adjustAllocation): Added if-block to return null when shape argument
is null.
* javax/swing/text/PlainView.java:
(updateDamage): Added if-block to return early if a is null.
-rw-r--r-- | ChangeLog | 8 | ||||
-rw-r--r-- | javax/swing/text/FieldView.java | 4 | ||||
-rw-r--r-- | javax/swing/text/PlainView.java | 5 |
3 files changed, 17 insertions, 0 deletions
@@ -1,5 +1,13 @@ 2006-05-03 Robert Schuster <robertschuster@fsfe.org> + * javax/swing/text/FieldView.java: + (adjustAllocation): Added if-block to return null when shape argument + is null. + * javax/swing/text/PlainView.java: + (updateDamage): Added if-block to return early if a is null. + +2006-05-03 Robert Schuster <robertschuster@fsfe.org> + * javax/swing/plaf/basic/BasicTextUI.java: (changeUpdate): Added note. (removeUpdate): Dito. diff --git a/javax/swing/text/FieldView.java b/javax/swing/text/FieldView.java index 127f32f53..0c2f0fef1 100644 --- a/javax/swing/text/FieldView.java +++ b/javax/swing/text/FieldView.java @@ -138,6 +138,10 @@ public class FieldView extends PlainView */ protected Shape adjustAllocation(Shape shape) { + // Return null when the original allocation is null (like the RI). + if (shape == null) + return null; + Rectangle rectIn = shape.getBounds(); // vertical adjustment int height = (int) getPreferredSpan(Y_AXIS); diff --git a/javax/swing/text/PlainView.java b/javax/swing/text/PlainView.java index 5f2f57705..18818c0ba 100644 --- a/javax/swing/text/PlainView.java +++ b/javax/swing/text/PlainView.java @@ -437,6 +437,11 @@ public class PlainView extends View implements TabExpander */ protected void updateDamage(DocumentEvent changes, Shape a, ViewFactory f) { + // Return early and do no updates if the allocation area is null + // (like the RI). + if (a == null) + return; + float oldMaxLineLength = maxLineLength; Rectangle alloc = a.getBounds(); Element el = getElement(); |