Hi,

I came across a nasty possible bug today so I thought I would write in and see if anyone else has experienced it. Am using SVG12DOMImplementation namespace, and FlowText tags. I create this structure fine:

<flowText>
<flowRegion>
<rect x=... y=... height=... width=...
</flowRegion>
<flowDiv>
<flowPara/>
</flowDiv>
</flowText

So far so good. But when I change either the width or the height then the setValue function fires on Line 145 of AbstractParentNode.java calling fireDOMSubtreeModifiedEvent() which goes to buildRegion in BatikFlowTextElementBridge which has checks for whether the width and height exist. Once of the first things that AbstractAttr::setNodeValue does is to remove the child node to be changed so consequently there are circumstances where the width and the height can be empty but the property change should not fire.

Not sure how clear this is so feel free to ask questions. I am not sure what to do, is it likely that there should be a condition around the firing of fireDOMSubtreeModifiedEvent or should setValue not be removing all the children or should the exceptions be relaxed in BatikFlowTextElementBridge::buildRegion. My guess is that the exceptions should not really be there and are meant really as warnings but someone who was nearer to the author may know better.

I have pointed out the offending lines below.

Best

Tom


protected RegionInfo buildRegion(UnitProcessor.Context uctx,
                                     Element e,
                                     float verticalAlignment) {
        ...

        // 'width' attribute - required
        s = e.getAttribute(BATIK_EXT_WIDTH_ATTRIBUTE);
        float w;
        if (s.length() != 0) {
            w = UnitProcessor.svgHorizontalLengthToUserSpace
                (s, BATIK_EXT_WIDTH_ATTRIBUTE, uctx);
        } else {
-->            throw new BridgeException
                     (ctx, e, ERR_ATTRIBUTE_MISSING,
                         new Object[] {BATIK_EXT_WIDTH_ATTRIBUTE, s});
        }
        // A value of zero disables rendering of the element
        if (w == 0) {
            return null;
        }

        // 'height' attribute - required
        s = e.getAttribute(BATIK_EXT_HEIGHT_ATTRIBUTE);
        float h;
        if (s.length() != 0) {
            h = UnitProcessor.svgVerticalLengthToUserSpace
                (s, BATIK_EXT_HEIGHT_ATTRIBUTE, uctx);
        } else {
-->            throw new BridgeException
                (ctx, e, ERR_ATTRIBUTE_MISSING,
                 new Object[] {BATIK_EXT_HEIGHT_ATTRIBUTE, s});
        }
        // A value of zero disables rendering of the element
        if (h == 0) {
            return null;
        }

        return new RegionInfo(x,y,w,h,verticalAlignment);
    }

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to