]> git.lyx.org Git - lyx.git/commit
Avoid crash when inserting macro template in tabular inset
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Tue, 27 Feb 2024 17:09:42 +0000 (18:09 +0100)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Tue, 27 Feb 2024 17:21:57 +0000 (18:21 +0100)
commit97cf2b6aef1e0d7bc88e863b5d1d9e2920be0dd2
treec98589277dcc033c17d5949a7ea949f199b2ee05
parent8742f77f3a65e09985d9337edb47a859663e6225
Avoid crash when inserting macro template in tabular inset

The issue here is that macro templates are forbidden in InsetTabular
(why? I do not know) and Text::getStatus does not enforce that
properly. Text::insertInset is called and does nothing (because
insertion is forbidden) and yet the cursor is changed to point into
this non existent inset.

Solution:

1/ block insertion of macro templates when not allowed

2/ (additional safety) when insertion of a math macro inset failed, do
   not try to set cursor inside the non-existing inset.

Additionally clarify comments.
src/Text.cpp
src/Text.h