]> git.lyx.org Git - lyx.git/commit
Fix crash when selecting text with changes
authorScott Kostyshak <skostysh@lyx.org>
Fri, 27 Jul 2018 19:28:22 +0000 (15:28 -0400)
committerScott Kostyshak <skostysh@lyx.org>
Sat, 22 Dec 2018 19:57:40 +0000 (14:57 -0500)
commit0af6a43b6aec8ccc4afe36545a76cd6be727c7b6
tree03af02a24674c428bee431b9bb78d0f45b8e86f1
parent890fb133b1b2349588705d32fe0c9b95eb50503a
Fix crash when selecting text with changes

When selecting text, in some cases a DocIterator could be forwarded
to a (non-existant) paragraph after the end. The critical part of
this fix is to break the loop at the correct place. The following
are additional improvements:

- increase readability by defining a bool named "in_last_par"
- use cur.selectionEnd().pit() instead of cur.selectionEnd().paragraph().id()
- use it.lastpos() instead of it.paragraph().size()

This commit fixes a regression introduced by 23de5e5e, and reported
at #11204.

Thanks to Jürgen and JMarc.

(cherry picked from commit d12798759aeb7bae77bec63098fd81f8cc9e554b)
src/Text3.cpp