This is just Dekel's HEAD patch adapted for 1.1.6. I have tested it. Together with the previous line number patch, my entire thesis is now processed with the correct line count at the end. This includes math, figures, tables, figure and table floats, and probably a few other things too.
--- lyx-1.1.6fix3-orig/src/paragraph.C Fri Jun 29 23:31:28 2001 +++ lyx-1.1.6fix3/src/paragraph.C Tue Nov 27 11:37:28 2001 @@ -2893,13 +2893,14 @@ os << "}"; if (tmp) { + for( int j = 0; j < tmp; ++j ) { + texrow.newline(); + } + texrow.start(this, i+1); column = 0; } else { column += int(os.tellp()) - len; } - for (; tmp--;) { - texrow.newline(); - } } } break;