]> git.lyx.org Git - features.git/commitdiff
speed hack for long tables
authorJohn Levon <levon@movementarian.org>
Mon, 26 May 2003 11:33:37 +0000 (11:33 +0000)
committerJohn Levon <levon@movementarian.org>
Mon, 26 May 2003 11:33:37 +0000 (11:33 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@7047 a592a061-630c-0410-9148-cb99ea01b6c8

src/insets/ChangeLog
src/insets/insettabular.C

index 7a189d69ca1cdd1f714a93a75498fa79946ab19e..db9980c9e3cc879d3e64fa95ea8f6370e8233311 100644 (file)
@@ -1,3 +1,8 @@
+2003-05-26  John Levon  <levon@movementarian.org>
+
+       * insettabular.C: avoid drawing all of a long table
+       if it's not needed. A big speedup
+
 2003-05-26  Lars Gullik Bjønnes  <larsbj@gullik.net>
 
        * remove same_id from function signatures, adjust
index 56c204c94beb240515c80983568b7cdd835c8229..8342529be117bd773a5156af5fa3b36467a1766a 100644 (file)
@@ -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);