--------------------------------------------------------------------------- | Facility : libnform | Function : static void Perform_Justification( | FIELD * field, | WINDOW * win) | | Description : Output field with requested justification | | Return Values : - +-----------------------------
| 741 | | Description : Output field with requested justification |
| 742 | | |
| 743 | | Return Values : - |
| 744 | +--------------------------------------------------------------------------*/ |
| 745 | static void Perform_Justification(FIELD * field, WINDOW * win) |
| 746 | { |
| 747 | char *bp; |
| 748 | int len; |
| 749 | int col = 0; |
| 750 | |
| 751 | bp = Get_Start_Of_Data(field->buf,Buffer_Length(field)); |
| 752 | len = (int)(After_End_Of_Data(field->buf,Buffer_Length(field)) - bp); |
| 753 | |
| 754 | if (len>0) |
| 755 | { |
| 756 | assert(win && (field->drows == 1) && (field->dcols == field->cols)); |
| 757 | |
| 758 | switch(field->just) |
| 759 | { |
| 760 | case JUSTIFY_LEFT: |
| 761 | break; |
| 762 | case JUSTIFY_CENTER: |
| 763 | col = (field->cols - len)/2; |
| 764 | break; |
| 765 | case JUSTIFY_RIGHT: |
| 766 | col = field->cols - len; |
| 767 | break; |
| 768 | default: |
| 769 | break; |
| 770 | } |
| 771 | |
| 772 | wmove(win,0,col); |
| 773 | waddnstr(win,bp,len); |
| 774 | } |
| 775 | } |
| 776 |
no test coverage detected
searching dependent graphs…