]> git.lyx.org Git - features.git/commitdiff
Change a brain-dead algorithm to a smarter one.
authorAsger Ottar Alstrup <alstrup@lyx.org>
Sat, 26 Jul 2003 20:51:52 +0000 (20:51 +0000)
committerAsger Ottar Alstrup <alstrup@lyx.org>
Sat, 26 Jul 2003 20:51:52 +0000 (20:51 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@7369 a592a061-630c-0410-9148-cb99ea01b6c8

src/ChangeLog
src/rowpainter.C

index 38447aae55cb78b1073d321c7be9c8a424a2c673..f9f1514f911b821f96466dfd1b2e019ae57b9c00 100644 (file)
@@ -1,3 +1,9 @@
+2003-07-26  Asger Alstrup  <alstrup@local>
+
+       * rowpainter.C (paintRows): Change algorithm to work directly on
+       the insets rather than asking every character in the document
+       whether its an inset.
+
 2003-07.26  Alfredo Braunstein  <abraunst@libero.it>
 
        * buffer.C (openFileWrite): factorize some code 
index d61471fb2684d30adbb093ad2f942a8b7061bd4a..4077d6ee0b04f0c7490f89c93437dfdc382eda60 100644 (file)
@@ -1083,13 +1083,14 @@ void paintRows(BufferView const & bv, LyXText const & text,
 
                // compute inset metrics
                for (; pit != end; ++pit) {
-                       for (int pos = 0; pos != pit->size(); ++pos) {
-                               if (pit->isInset(pos)) {
-                                       Dimension dim;
-                                       LyXFont font;
-                                       MetricsInfo mi(perv(bv), font, text.workWidth());
-                                       pit->getInset(pos)->metrics(mi, dim);
-                               }
+                       InsetList & insetList = pit->insetlist;
+                       InsetList::iterator ii = insetList.begin();
+                       InsetList::iterator iend = insetList.end();
+                       for (; ii != iend; ++ii) {
+                               Dimension dim;
+                               LyXFont font;
+                               MetricsInfo mi(perv(bv), font, text.workWidth());
+                               ii->inset->metrics(mi, dim);
                        }
                }
 #else