This fixes a small mistake that I introduced in my last patch.
2006-12-05 Roman Kennke <[EMAIL PROTECTED]>
* javax/swing/text/html/ImageView.java
(ImageView): Initialize spans array here.
(setPropertiesFromAttributes): Moved init of spans array to
constructor.
/Roman
Index: javax/swing/text/html/ImageView.java
===================================================================
RCS file: /cvsroot/classpath/classpath/javax/swing/text/html/ImageView.java,v
retrieving revision 1.6
diff -u -1 -5 -r1.6 ImageView.java
--- javax/swing/text/html/ImageView.java 5 Dec 2006 11:20:40 -0000 1.6
+++ javax/swing/text/html/ImageView.java 5 Dec 2006 13:03:04 -0000
@@ -118,30 +118,31 @@
Length[] spans;
/**
* The cached attributes.
*/
private AttributeSet attributes;
/**
* Creates the image view that represents the given element.
*
* @param element the element, represented by this image view.
*/
public ImageView(Element element)
{
super(element);
+ spans = new Length[2];
observer = new Observer();
reloadProperties = true;
reloadImage = true;
loadOnDemand = false;
}
/**
* Load or reload the image. This method initiates the image reloading. After
* the image is ready, the repaint event will be scheduled. The current image,
* if it already exists, will be discarded.
*/
private void reloadImage()
{
loading = true;
reloadImage = false;
@@ -407,31 +408,30 @@
public void setLoadsSynchronously(boolean load_on_demand)
{
loadOnDemand = load_on_demand;
}
/**
* Update all cached properties from the attribute set, returned by the
* [EMAIL PROTECTED] #getAttributes}.
*/
protected void setPropertiesFromAttributes()
{
AttributeSet atts = getAttributes();
StyleSheet ss = getStyleSheet();
float emBase = ss.getEMBase(atts);
float exBase = ss.getEXBase(atts);
- spans = new Length[2];
spans[X_AXIS] = (Length) atts.getAttribute(CSS.Attribute.WIDTH);
if (spans[X_AXIS] != null)
{
spans[X_AXIS].setFontBases(emBase, exBase);
}
spans[Y_AXIS] = (Length) atts.getAttribute(CSS.Attribute.HEIGHT);
if (spans[Y_AXIS] != null)
{
spans[Y_AXIS].setFontBases(emBase, exBase);
}
}
/**
* Maps the picture co-ordinates into the image position in the model. As the
* image is not divideable, this is currently implemented always to return the