From 50fe44383b368c7fbc2f8cfccb8643485f8bacea Mon Sep 17 00:00:00 2001 From: John Levon Date: Mon, 26 May 2003 11:33:37 +0000 Subject: [PATCH] speed hack for long tables git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@7047 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/insets/ChangeLog | 5 +++++ src/insets/insettabular.C | 6 ++++++ 2 files changed, 11 insertions(+) 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); -- 2.39.2