From: Asger Ottar Alstrup Date: Sat, 26 Jul 2003 20:51:52 +0000 (+0000) Subject: Change a brain-dead algorithm to a smarter one. X-Git-Tag: 1.6.10~16462 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=b52b324d64026316a058cbfa2954f19a9520af3f;p=features.git Change a brain-dead algorithm to a smarter one. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@7369 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/ChangeLog b/src/ChangeLog index 38447aae55..f9f1514f91 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2003-07-26 Asger Alstrup + + * 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 * buffer.C (openFileWrite): factorize some code diff --git a/src/rowpainter.C b/src/rowpainter.C index d61471fb26..4077d6ee0b 100644 --- a/src/rowpainter.C +++ b/src/rowpainter.C @@ -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