-void LyXTabular::setHeaderFooterRows(int hr, int fhr, int fr, int lfr)
-{
- // set header info
- while (hr > 0) {
- row_info[--hr].endhead = true;
- }
- // set firstheader info
- if (fhr && fhr < rows_) {
- if (row_info[fhr].endhead) {
- while (fhr > 0) {
- row_info[--fhr].endfirsthead = true;
- row_info[fhr].endhead = false;
- }
- } else if (row_info[fhr - 1].endhead) {
- endfirsthead.empty = true;
- } else {
- while (fhr > 0 && !row_info[--fhr].endhead) {
- row_info[fhr].endfirsthead = true;
- }
- }
- }
- // set footer info
- if (fr && fr < rows_) {
- if (row_info[fr].endhead && row_info[fr-1].endhead) {
- while (fr > 0 && !row_info[--fr].endhead) {
- row_info[fr].endfoot = true;
- row_info[fr].endhead = false;
- }
- } else if (row_info[fr].endfirsthead && row_info[fr-1].endfirsthead) {
- while (fr > 0 && !row_info[--fr].endfirsthead) {
- row_info[fr].endfoot = true;
- row_info[fr].endfirsthead = false;
- }
- } else if (!row_info[fr - 1].endhead && !row_info[fr - 1].endfirsthead) {
- while (fr > 0 && !row_info[--fr].endhead &&
- !row_info[fr].endfirsthead)
- {
- row_info[fr].endfoot = true;
- }
- }
- }
- // set lastfooter info
- if (lfr && lfr < rows_) {
- if (row_info[lfr].endhead && row_info[lfr - 1].endhead) {
- while (lfr > 0 && !row_info[--lfr].endhead) {
- row_info[lfr].endlastfoot = true;
- row_info[lfr].endhead = false;
- }
- } else if (row_info[lfr].endfirsthead &&
- row_info[lfr - 1].endfirsthead)
- {
- while (lfr > 0 && !row_info[--lfr].endfirsthead) {
- row_info[lfr].endlastfoot = true;
- row_info[lfr].endfirsthead = false;
- }
- } else if (row_info[lfr].endfoot
- && row_info[lfr - 1].endfoot) {
- while (lfr > 0 && !row_info[--lfr].endfoot) {
- row_info[lfr].endlastfoot = true;
- row_info[lfr].endfoot = false;
- }
- } else if (!row_info[fr - 1].endhead
- && !row_info[fr - 1].endfirsthead &&
- !row_info[fr - 1].endfoot)
- {
- while (lfr > 0 &&
- !row_info[--lfr].endhead && !row_info[lfr].endfirsthead &&
- !row_info[lfr].endfoot)
- {
- row_info[lfr].endlastfoot = true;
- }
- } else if (haveLTFoot()) {
- endlastfoot.empty = true;
- }
- }
-}
-
-