first= d.computeIndexInCategory(fPositionCategory, lastScannedPosition);
TypedPosition p;
while (first < category.length) {
p= (TypedPosition) category[first++];
d.removePosition(fPositionCategory, p);
rememberRegion(p.offset, p.length);
}
} catch (BadPositionCategoryException x) {
// should never happen on connected documents