On Wed, Aug 29, 2007 at 11:00:20AM +0200, Jürgen Spitzmüller wrote: > http://bugzilla.lyx.org/show_bug.cgi?id=3961 > > I intend to commit the attached patch (reviewed by Michael and tested by Uwe) > to branch and trunk. > > Objections?
Not in particular, but in general I'd prefer some separate function for that. > Index: src/Text2.cpp > =================================================================== > --- src/Text2.cpp (Revision 19883) > +++ src/Text2.cpp (Arbeitskopie) > @@ -1148,7 +1148,8 @@ > && old.pos() < oldpar.size() > && oldpar.isLineSeparator(old.pos()) > && oldpar.isLineSeparator(old.pos() - 1) > - && !oldpar.isDeleted(old.pos() - 1)) { > + && !oldpar.isDeleted(old.pos() - 1) > + && !oldpar.isDeleted(old.pos())) { > oldpar.eraseChar(old.pos() - 1, > cur.buffer().params().trackChanges); This accesses oldpar five times and old.pos() six times, suggesting that there might be a function void Paragraph::whatever(int pos, bool trackChanges) { if (pos > 0 && pos < size() && isLineSeparator(pos) && isLineSeparator(pos - 1) && !isDeleted(pos - 1)) && !isDeleted(pos)) oldpar.eraseChar(pos - 1, trackChanges); } which would be called like oldpar.whatever(old.pos() cur.buffer().params().trackChanges); This also give us the chance to give the test a meaningful name. Andre'