// remove all affected positions
while (first < category.length) {
TypedPosition p= (TypedPosition) category[first];
if (lastScannedPosition >= p.offset + p.length ||
(p.overlapsWith(start, length) &&
(!d.containsPosition(fPositionCategory, start, length) ||
!contentType.equals(p.getType())))) {
rememberRegion(p.offset, p.length);
d.removePosition(fPositionCategory, p);