--------------------------------------------------------------------------- | Facility : libnform | Function : FIELD* _nc_First_Active_Field(FORM * form) | | Description : Get the first active field on the current page, | if there are such. If there are none, get the first | visible field on the page. If there are also none, |
| 2816 | if (Field_Is_Selectable(*field_on_page)) |
| 2817 | break; |
| 2818 | } while(field!=(*field_on_page)); |
| 2819 | return(*field_on_page); |
| 2820 | } |
| 2821 | |
| 2822 | /*--------------------------------------------------------------------------- |
| 2823 | | Facility : libnform |
| 2824 | | Function : FIELD* _nc_First_Active_Field(FORM * form) |
| 2825 | | |
| 2826 | | Description : Get the first active field on the current page, |
| 2827 | | if there are such. If there are none, get the first |
| 2828 | | visible field on the page. If there are also none, |
| 2829 | | we return the first field on page and hope the best. |
| 2830 | | |
| 2831 | | Return Values : Pointer to calculated field. |
| 2832 | +--------------------------------------------------------------------------*/ |
| 2833 | FIELD* |
| 2834 | _nc_First_Active_Field(FORM * form) |
| 2835 | { |
| 2836 | FIELD **last_on_page = &form->field[form->page[form->curpage].pmax]; |
| 2837 | FIELD *proposed = Next_Field_On_Page(*last_on_page); |
| 2838 | |
| 2839 | if (proposed == *last_on_page) |
| 2840 | { /* there might be the special situation, where there is no |
| 2841 | active and visible field on the current page. We then select |
| 2842 | the first visible field on this readonly page |
| 2843 | */ |
| 2844 | if (Field_Is_Not_Selectable(proposed)) |
| 2845 | { |
| 2846 | FIELD **field = &form->field[proposed->index]; |
| 2847 | FIELD **first = &form->field[form->page[form->curpage].pmin]; |
| 2848 | |
| 2849 | do |
| 2850 | { |
| 2851 | field = (field==last_on_page) ? first : field + 1; |
| 2852 | if (((*field)->opts & O_VISIBLE)) |
| 2853 | break; |
| 2854 | } while(proposed!=(*field)); |
| 2855 | |
| 2856 | proposed = *field; |
| 2857 |
no test coverage detected
searching dependent graphs…