diff --git a/src/preproc/tbl/table.cpp b/src/preproc/tbl/table.cpp index 39ea5621e..7cf5316fe 100644 --- a/src/preproc/tbl/table.cpp +++ b/src/preproc/tbl/table.cpp @@ -58,16 +58,13 @@ const int DEFAULT_COLUMN_SEPARATION = 3; #define REPEATED_VPT_MACRO PREFIX "rvpt" #define SUPPRESS_BOTTOM_REG PREFIX "supbot" #define SAVED_DN_REG PREFIX "dn" -#define ROW_START_LINE_REG PREFIX "lnst" -#define ROW_SAVE_LINE_REG PREFIX "lnsv" -#define ROW_MAX_LINE_REG PREFIX "lnmx" -#define REPEATED_NM_SET_MACRO PREFIX "rlns" -#define REPEATED_NM_SUS_MACRO PREFIX "rlnx" #define SAVED_HYPHENATION_MODE_REG PREFIX "hyphmode" #define SAVED_HYPHENATION_LANG_NAME PREFIX "hyphlang" #define SAVED_HYPHENATION_MAX_LINES_REG PREFIX "hyphmaxlines" #define SAVED_HYPHENATION_MARGIN_REG PREFIX "hyphmargin" #define SAVED_HYPHENATION_SPACE_REG PREFIX "hyphspace" +#define SAVED_NUMBERING_LINENO PREFIX "linenumber" +#define SAVED_NUMBERING_SUPPRESSION_COUNT PREFIX "linenumbersuppresscnt" // this must be one character #define COMPATIBLE_REG PREFIX "c" @@ -698,7 +695,8 @@ void block_entry::do_divert(int alphabetic, int ncols, const string *mw, return; } printfs(".di %1\n", block_diversion_name(start_row, start_col)); - prints(".if \\n[" SAVED_FILL_REG "] .fi\n" + prints(".nm\n" + ".if \\n[" SAVED_FILL_REG "] .fi\n" ".in 0\n"); prints(".ll "); for (i = start_col; i <= end_col; i++) @@ -1821,31 +1819,6 @@ void table::init_output() ".de " REPEATED_VPT_MACRO "\n" ".vpt \\$1\n" ".if !'\\n(.z'' \\!." REPEATED_VPT_MACRO " \"\\$1\"\n" - "..\n" - ".de " REPEATED_NM_SET_MACRO "\n" - ".ie !'\\n(.z'' \\{.nm\n" - "\\!." REPEATED_NM_SET_MACRO " \"\\$1\"\n" - ".\\}\n" - ".el .if \\n[.nm] .if \\n[ln] \\{\\\n" - ".if '\\$1'd' .nr " ROW_START_LINE_REG " \\n[ln]\n" - ".if '\\$1's' .nm \\n[" ROW_START_LINE_REG "]\n" - ".if '\\$1'm' .nr " ROW_MAX_LINE_REG " \\n[ln]>?\\n[" ROW_MAX_LINE_REG "]\n" - ".\\}\n" - "..\n" - ".de " REPEATED_NM_SUS_MACRO "\n" - ".ie !'\\n(.z'' \\{.nm\n" - "\\!." REPEATED_NM_SUS_MACRO " \"\\$1\"\n" - ".\\}\n" - ".el .if \\n[.nm] .if \\n[ln] \\{\\\n" - ".ie '\\$1's' \\{\\\n" - ".nr " ROW_SAVE_LINE_REG " \\n(ln?\\n[.V]u\n" ".ls 1\n" - "." REPEATED_NM_SUS_MACRO " s\n" "\\v'" BODY_DEPTH "'" "\\s[\\n[" LINESIZE_REG "]]"); if (r > nrows - 1) @@ -2453,8 +2426,7 @@ void table::print_single_hline(int r) } } prints("\\s0\n"); - prints("." REPEATED_NM_SUS_MACRO " r\n" - ".ls\n" + prints(".ls\n" ".vs\n"); } @@ -2463,7 +2435,6 @@ void table::print_double_hline(int r) prints(".vs " LINE_SEP "+" DOUBLE_LINE_SEP ">?\\n[.V]u\n" ".ls 1\n" - "." REPEATED_NM_SUS_MACRO " s\n" "\\v'" BODY_DEPTH "'" "\\s[\\n[" LINESIZE_REG "]]"); if (r > nrows - 1) @@ -2522,7 +2493,6 @@ void table::print_double_hline(int r) } } prints("\\s0\n" - "." REPEATED_NM_SUS_MACRO " r\n" ".ls\n" ".vs\n"); } @@ -2729,8 +2699,7 @@ void table::define_bottom_macro() print_single_hline(0); prints(".\\}\n"); } - prints("." REPEATED_NM_SUS_MACRO " s\n" - ".ls 1\n"); + prints(".ls 1\n"); for (vertical_rule *p = vrule_list; p; p = p->next) p->contribute_to_bottom_macro(this); if (flags & DOUBLEBOX) @@ -2747,8 +2716,7 @@ void table::define_bottom_macro() ".sp -1\n" "\\v'" BODY_DEPTH "'\\h'|\\n[TW]u'\\s[\\n[" LINESIZE_REG "]]" "\\D'l 0 |\\n[" TOP_REG "]u-1v'\\s0\n"); - prints("." REPEATED_NM_SUS_MACRO " r\n" - ".ls\n"); + prints(".ls\n"); prints(".nr " LAST_PASSED_ROW_REG " \\n[" CURRENT_ROW_REG "]\n" ".sp |\\n[" SAVED_VERTICAL_POS_REG "]u\n" "." REPEATED_VPT_MACRO " 1\n" @@ -2824,8 +2792,6 @@ void table::do_row(int r) // we might have had a .TH, for example, since we last tried if (!(flags & NOKEEP) && row_begins_section(r)) prints(".if \\n[" USE_KEEPS_REG "] ." KEEP_MACRO_NAME "\n"); - prints("." REPEATED_NM_SET_MACRO " d\n" - ".nr " ROW_MAX_LINE_REG " \\n[ln]\n"); printfs(".mk %1\n", row_start_reg(r)); prints(".mk " BOTTOM_REG "\n" "." REPEATED_VPT_MACRO " 0\n"); @@ -2922,7 +2888,6 @@ void table::do_row(int r) table_entry *e = entry[r][c]; if (e) { if (e->end_row == r && e->to_simple_entry() == 0) { - prints("." REPEATED_NM_SET_MACRO " s\n"); e->position_vertically(); e->print(); prints(".nr " BOTTOM_REG " \\n[" BOTTOM_REG "]>?\\n[.d]\n"); @@ -2931,8 +2896,7 @@ void table::do_row(int r) c = e->end_col; } } - prints("." REPEATED_NM_SET_MACRO " m\n" - "." REPEATED_VPT_MACRO " 1\n" + prints("." REPEATED_VPT_MACRO " 1\n" ".sp |\\n[" BOTTOM_REG "]u\n" "\\*[" TRANSPARENT_STRING_NAME "].nr " NEED_BOTTOM_RULE_REG " 1\n"); if (r != nrows - 1 && (flags & ALLBOX)) { @@ -2960,7 +2924,6 @@ void table::do_row(int r) if (!(flags & NOKEEP) && row_ends_section(r)) prints(".if \\n[" USE_KEEPS_REG "] ." RELEASE_MACRO_NAME "\n"); } - prints(".if \\n[.nm] .if \\n[ln] .nr ln \\n[" ROW_MAX_LINE_REG "]\n"); } void table::do_top() @@ -2969,8 +2932,7 @@ void table::do_top() if (!(flags & NOKEEP) && (flags & (BOX | DOUBLEBOX | ALLBOX))) prints("." TABLE_KEEP_MACRO_NAME "\n"); if (flags & DOUBLEBOX) { - prints("." REPEATED_NM_SUS_MACRO " s\n" - ".ls 1\n" + prints(".ls 1\n" ".vs " LINE_SEP ">?\\n[.V]u\n" "\\v'" BODY_DEPTH "'\\s[\\n[" LINESIZE_REG "]]\\D'l \\n[TW]u 0'\\s0\n" ".vs\n" @@ -2984,8 +2946,7 @@ void table::do_top() "\n", column_divide_reg(0), column_divide_reg(ncolumns)); - prints("." REPEATED_NM_SUS_MACRO " r\n" - ".ls\n" + prints(".ls\n" ".vs\n"); } else if (flags & (ALLBOX | BOX)) { @@ -3019,10 +2980,6 @@ void table::do_bottom() "..\n"); if (!(flags & NOKEEP) && (flags & (BOX | DOUBLEBOX | ALLBOX))) prints("." TABLE_RELEASE_MACRO_NAME "\n"); - else - prints(".if \\n[.nm] .if \\n[ln] \\{.nm\n" - ".nr ln \\n[" ROW_MAX_LINE_REG "]\n" - ".\\}\n"); if (flags & DOUBLEBOX) prints(".sp " DOUBLE_LINE_SEP "\n"); // Horizontal box lines take up an entire row on nroff devices (maybe @@ -3035,6 +2992,10 @@ void table::do_bottom() if (flags & DOUBLEBOX) prints(".if n .sp\n"); prints("." RESET_MACRO_NAME "\n" + ".nn \\n[" SAVED_NUMBERING_SUPPRESSION_COUNT "]\n" + ".ie \\n[" SAVED_NUMBERING_LINENO "] \\\n" + ". nm \\n[" SAVED_NUMBERING_LINENO "]\n" + ".el .nm\n" ".fc\n" ".cp \\n(" COMPATIBLE_REG "\n"); }