xerces-j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 18744] New: - HTMLTableElementImpl.deleteRow will only delete the zeroth row.
Date Sun, 06 Apr 2003 23:53:13 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=18744>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=18744

HTMLTableElementImpl.deleteRow will only delete the zeroth row.

           Summary: HTMLTableElementImpl.deleteRow will only delete the
                    zeroth row.
           Product: Xerces2-J
           Version: 2.4.0
          Platform: All
        OS/Version: Other
            Status: NEW
          Severity: Major
          Priority: Other
         Component: DOM
        AssignedTo: xerces-j-dev@xml.apache.org
        ReportedBy: bsutton@noojee.com.au


The implementation of TableElementImpl seems to have lost a single line which 
is responsible for decrementing the passed index until the correct row has 
been found. The result is that only the first (index = 0) row can be deleted.
Attempts to delete any other row silently fail.

The suggested fix is:
source: org.apache.html.dom.HTMLTableElementImpl

    public synchronized void deleteRow( int index )
    {
        Node    child;
        
        child = getFirstChild();
        while ( child != null )
        {
            if ( child instanceof HTMLTableRowElement )
            {
                if ( index == 0 )
                {
                    removeChild ( child );
                    return;
                }
                // This is the bug fix. Existing version has omitted this line.
		index--;
            }
            else
            if ( child instanceof HTMLTableSectionElementImpl )
            {
                index = ( (HTMLTableSectionElementImpl) child ).deleteRowX( 
index );
                if ( index < 0 )
                    return;
            }
            child = child.getNextSibling();
        }
    }

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-dev-help@xml.apache.org


Mime
View raw message