Index: select.c =================================================================== --- select.c (revision 9320) +++ select.c (revision 9321) @@ -218,6 +218,7 @@ * returns a list of object IDs matched the search and loads len with the * length of the list. Returns NULL on no match. */ +#warning TODO: should be rewritten with generic ops and rtree static long int *ListBlock_(pcb_board_t *pcb, pcb_box_t *Box, pcb_bool Flag, int *len) { int changed = 0; @@ -364,6 +365,29 @@ } PCB_END_LOOP; + PCB_SUBC_LOOP(pcb->Data); + { + if (PCB_POLYGON_NEAR_BOX(subc, Box) + && !PCB_FLAG_TEST(PCB_FLAG_LOCK, subc) + && PCB_FLAG_TEST(PCB_FLAG_SELECTED, subc) != Flag) { + + if (len == NULL) { + pcb_select_subc(PCB, subc, Flag, 1); + } + else { + if (used >= alloced) { + alloced += 64; + list = realloc(list, sizeof(*list) * alloced); + } + list[used] = subc->ID; + used++; + } + changed = 1; + DrawSubc(subc); + } + } + PCB_END_LOOP; + /* elements */ PCB_ELEMENT_LOOP(pcb->Data); {