From: John Levon Date: Mon, 26 May 2003 11:33:37 +0000 (+0000) Subject: speed hack for long tables X-Git-Tag: 1.6.10~16742 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=50fe44383b368c7fbc2f8cfccb8643485f8bacea;p=features.git speed hack for long tables git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@7047 a592a061-630c-0410-9148-cb99ea01b6c8 --- 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);