This fixes a problem with GapContent. It was caused by messing up position marks and position mark indices.
2006-06-05 Roman Kennke <[EMAIL PROTECTED]>
PR 27834
* javax/swing/text/GapContent.java
(setPositionsInRange): Compare with startIndex and endIndex
rather than start and end.
(dumpMarks): Only dump real marks.
/Roman
--
“Improvement makes straight roads, but the crooked roads, without
Improvement, are roads of Genius.” - William Blake
Index: javax/swing/text/GapContent.java
===================================================================
RCS file: /cvsroot/classpath/classpath/javax/swing/text/GapContent.java,v
retrieving revision 1.48
diff -u -1 -0 -r1.48 GapContent.java
--- javax/swing/text/GapContent.java 18 May 2006 14:16:08 -0000 1.48
+++ javax/swing/text/GapContent.java 5 Jun 2006 11:43:43 -0000
@@ -723,23 +723,23 @@
positionMarks[startIndex] = end;
}
// Update all affected GapContentPositions to point to the new index
// and all GapContentPositions that come after the interval to
// have their index moved by -removed.
Set positionSet = positions.keySet();
for (Iterator i = positionSet.iterator(); i.hasNext();)
{
GapContentPosition p = (GapContentPosition) i.next();
- if (p.index > start || p.index <= end)
- p.index = start;
- else if (p.index > end)
+ if (p.index > startIndex || p.index <= endIndex)
+ p.index = startIndex;
+ else if (p.index > endIndex)
p.index -= removed;
}
}
}
/**
* Adjusts the mark of all <code>Position</code>s that are in the range
* specified by <code>offset</code> and </code>length</code> within
* the buffer array by <code>increment</code>
*
@@ -839,21 +839,21 @@
}
System.err.println();
}
/**
* Prints out the position marks.
*/
private void dumpMarks()
{
System.err.print("positionMarks: ");
- for (int i = 0; i < positionMarks.length; i++)
+ for (int i = 0; i < numMarks; i++)
System.err.print(positionMarks[i] + ", ");
System.err.println();
}
/**
* Inserts a mark into the positionMarks array. This must update all the
* GapContentPosition instances in positions that come after insertionPoint.
*
* This is package private to avoid synthetic accessor methods.
*
signature.asc
Description: Dies ist ein digital signierter Nachrichtenteil
