]> git.lyx.org Git - lyx.git/commit
Sanitize cursors after a buffer has been reloaded
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Tue, 16 Apr 2024 09:45:09 +0000 (11:45 +0200)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Tue, 16 Apr 2024 21:48:01 +0000 (23:48 +0200)
commitc1fd622c51752d790576600f5911813ff8dac3fa
treeaab6b74cfa4ef7e8004c38c858c99b6ca33e7694
parent2f6b24297f97ea2a765705fbf21e1214a7ba38ba
Sanitize cursors after a buffer has been reloaded

When a buffer is reloaded, its content may remain the same, but the
memory allocation is new, so that the inset pointers in cursors are
now wrong. This requires to sanitize the cursors held by the buffer
views.

Before the biginset branch, some full metrics computation call that is
now removed probably did that as a side effect. Now we have to be more
precise.

To this effect, introduce WorkAreaManager::sanitizeCursors() and use
it in Buffer::reload().
src/Buffer.cpp
src/frontends/WorkArea.h
src/frontends/WorkAreaManager.cpp
src/frontends/WorkAreaManager.h
src/frontends/qt/GuiWorkArea.h