summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Schuster <theBohemian@gmx.net>2006-05-03 19:23:25 +0000
committerRobert Schuster <theBohemian@gmx.net>2006-05-03 19:23:25 +0000
commitcaadf15c1007cc40bcee332871592a358e284deb (patch)
tree62a39d29032bfc02318d6b70bab0c93286a5da15
parente5d30b58c24d0a372635fca11959f72cc84169fc (diff)
downloadclasspath-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--ChangeLog8
-rw-r--r--javax/swing/text/FieldView.java4
-rw-r--r--javax/swing/text/PlainView.java5
3 files changed, 17 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index e2c8a5a09..461440802 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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();