Having just read the spec a little closer, I think the attached patch is
better. (text elements need default values of "0" for x and y
attributes, but the other text positioning elements don't.)
Cameron
--
Cameron McCormack
| Web: http://mcc.id.au/
| ICQ: 26955922
Index: sources/org/apache/batik/dom/svg/AbstractSVGList.java
===================================================================
RCS file:
/home/cvspublic/xml-batik/sources/org/apache/batik/dom/svg/AbstractSVGList.java,v
retrieving revision 1.4
diff -r1.4 AbstractSVGList.java
268c268
< if ( index < 0 || index >= itemList.size() ){
---
> if ( index < 0 || itemList == null || index >= itemList.size() ){
Index: sources/org/apache/batik/dom/svg/SVGOMTextElement.java
===================================================================
RCS file:
/home/cvspublic/xml-batik/sources/org/apache/batik/dom/svg/SVGOMTextElement.java,v
retrieving revision 1.11
diff -r1.11 SVGOMTextElement.java
53a54
> import org.apache.batik.util.SVGConstants;
54a56
> import org.w3c.dom.svg.SVGAnimatedLengthList;
71a74,77
> // Default values for attributes on a text element
> public static final String X_DEFAULT_VALUE = "0";
> public static final String Y_DEFAULT_VALUE = "0";
>
157a164,201
> }
>
> // SVGTextPositioningElement support ////////////////////////////////////
>
> /**
> * <b>DOM</b>: Implements [EMAIL PROTECTED]
> * org.w3c.dom.svg.SVGTextPositioningElement#getX()}.
> */
> public SVGAnimatedLengthList getX() {
> SVGOMAnimatedLengthList result = (SVGOMAnimatedLengthList)
> getLiveAttributeValue(null, SVGConstants.SVG_X_ATTRIBUTE);
> if (result == null) {
> result = new SVGOMAnimatedLengthList(this, null,
> SVGConstants.SVG_X_ATTRIBUTE,
> X_DEFAULT_VALUE,
>
> AbstractSVGLength.HORIZONTAL_LENGTH);
> putLiveAttributeValue(null,
> SVGConstants.SVG_X_ATTRIBUTE, result);
> }
> return result;
> }
>
> /**
> * <b>DOM</b>: Implements [EMAIL PROTECTED]
> * org.w3c.dom.svg.SVGTextPositioningElement#getY()}.
> */
> public SVGAnimatedLengthList getY() {
> SVGOMAnimatedLengthList result = (SVGOMAnimatedLengthList)
> getLiveAttributeValue(null, SVGConstants.SVG_Y_ATTRIBUTE);
> if (result == null) {
> result = new SVGOMAnimatedLengthList(this, null,
> SVGConstants.SVG_Y_ATTRIBUTE,
> Y_DEFAULT_VALUE,
> AbstractSVGLength.VERTICAL_LENGTH);
> putLiveAttributeValue(null,
> SVGConstants.SVG_Y_ATTRIBUTE, result);
> }
> return result;
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]