diff --git a/src/insets/ChangeLog b/src/insets/ChangeLog index 7a189d69ca..db9980c9e3 100644 --- a/src/insets/ChangeLog +++ b/src/insets/ChangeLog @@ -1,3 +1,8 @@ +2003-05-26 John Levon + + * insettabular.C: avoid drawing all of a long table + if it's not needed. A big speedup + 2003-05-26 Lars Gullik Bjønnes * remove same_id from function signatures, adjust diff --git a/src/insets/insettabular.C b/src/insets/insettabular.C index 56c204c94b..8342529be1 100644 --- a/src/insets/insettabular.C +++ b/src/insets/insettabular.C @@ -333,6 +333,12 @@ void InsetTabular::draw(BufferView * bv, LyXFont const & font, int baseline, nx += tabular->GetWidthOfColumn(cell); ++cell; } + + // avoiding drawing the rest of a long table is + // a pretty big speedup + if (baseline > bv->workHeight()) + break; + baseline += tabular->GetDescentOfRow(i) + tabular->GetAscentOfRow(i + 1) + tabular->GetAdditionalHeight(i + 1);