--- a/HierarchicalItem.st Thu Dec 07 06:48:04 2000 +0100
+++ b/HierarchicalItem.st Thu Dec 07 07:23:00 2000 +0100
@@ -517,12 +517,26 @@
^ aList
!
+removeFromIndex:startIndex
+ "remove the children from startIndex up to end of children
+ "
+ ^ self removeFromIndex:startIndex toIndex:(children size)
+!
+
removeFromIndex:startIndex toIndex:stopIndex
"remove the children from startIndex up to and including
the child under stopIndex.
"
- self criticalDo:[
- self basicRemoveFromIndex:startIndex toIndex:stopIndex
+ |noChildren stop|
+
+ noChildren := children size.
+
+ (startIndex <= stopIndex and:[startIndex <= noChildren]) ifTrue:[
+ stop := stopIndex min:noChildren.
+
+ self criticalDo:[
+ self basicRemoveFromIndex:startIndex toIndex:stop
+ ]
].
!
@@ -1597,5 +1611,5 @@
!HierarchicalItem class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libwidg2/HierarchicalItem.st,v 1.27 2000-11-16 13:18:12 tm Exp $'
+ ^ '$Header: /cvs/stx/stx/libwidg2/HierarchicalItem.st,v 1.28 2000-12-07 06:23:00 ca Exp $'
! !