PLEASE DO NOT REPLY TO THIS MESSAGE. TO FURTHER COMMENT ON THE STATUS OF THIS BUG PLEASE FOLLOW THE LINK BELOW AND USE THE ON-LINE APPLICATION. REPLYING TO THIS MESSAGE DOES NOT UPDATE THE DATABASE, AND SO YOUR COMMENT WILL BE LOST SOMEWHERE. http://nagoya.apache.org/bugzilla/show_bug.cgi?id=3221 *** shadow/3221 Wed Aug 22 01:52:54 2001 --- shadow/3221.tmp.13033 Wed Aug 22 01:52:54 2001 *************** *** 0 **** --- 1,35 ---- + +============================================================================+ + | Range.deleteContents on range enclosing single text node causes range offs | + +----------------------------------------------------------------------------+ + | Bug #: 3221 Product: Xerces-J | + | Status: NEW Version: 1.4.2 | + | Resolution: Platform: All | + | Severity: Major OS/Version: All | + | Priority: Other Component: DOM | + +----------------------------------------------------------------------------+ + | Assigned To: [EMAIL PROTECTED] | + | Reported By: [EMAIL PROTECTED] | + | CC list: Cc: | + +----------------------------------------------------------------------------+ + | URL: | + +============================================================================+ + | DESCRIPTION | + In xerces-j upto and including version 1.4.3, calling deleteContents causes the + range to have its start and end offsets set to zero, when they should be set to + the ranges original start offset. + + Problem appears to be in RangeImpl.traverseSameContainer where the text is + removed by a call to setNodeValue: + + fStartContainer.setNodeValue( + s.substring(0, fStartOffset ) + + s.substring(fEndOffset) + + This in turn causes Range.receiveReplacedText to be called which sets the + offsets to 0. + + Changing the setNodeValue call to + + ((TextImpl)fStartContainer).deleteData(fStartOffset, fEndOffset-fStartOffset) ; + + Seems to correctly fix the offsets --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
