On Sat, Jul 22, 2023 at 01:42:37PM +0200, Jean-Marc Lasgouttes wrote: > Le 21/07/2023 ?? 16:27, Pavel Sanda a écrit : > >Clearly the idea was to iterate over all paragraphs in the range of > >[cur.selectionBegin();cur.selectionEnd()]. However ++c.pit() increases only > >paragraph number (c.slices_[0].pit_) and let the relative cursor position > >within paragraph c.slices_[0].pos_) unchanged. So if in the selectionBegin() > >paragraph you have the cursor pos_ beyond the selectionEnd () pos_ the while > >condition > > c <= cur.selectionEnd() > >for the last paragraph fails. > > This makes sense. An alternative solution would be to test only the pit: > pit_type const last_pit = cur.selectionEnd().pit(); > for ( ; c.pit() <= last_pit ; ++c.pit()) {
Thanks, this is better. Committed the fix :) Pavel -- lyx-devel mailing list lyx-devel@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-devel