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()) {
JMarc
--
lyx-devel mailing list
[email protected]
http://lists.lyx.org/mailman/listinfo/lyx-devel