mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-02 05:55:38 +00:00
Fix another crash similar to #9030
This one occured after the fix for bug #9030 if the cursor is in a math inset and the edit menu is opened.
This commit is contained in:
parent
956f503401
commit
5df89e5006
@ -1665,9 +1665,13 @@ void MenuDefinition::expandEnvironmentSeparators(BufferView const * bv)
|
|||||||
{
|
{
|
||||||
if (!bv)
|
if (!bv)
|
||||||
return;
|
return;
|
||||||
|
Text const * text = bv->cursor().text();
|
||||||
|
// no paragraphs and no separators exist in math
|
||||||
|
if (!text)
|
||||||
|
return;
|
||||||
|
|
||||||
pit_type pit = bv->cursor().selBegin().pit();
|
pit_type pit = bv->cursor().selBegin().pit();
|
||||||
Paragraph const & par = bv->cursor().text()->getPar(pit);
|
Paragraph const & par = text->getPar(pit);
|
||||||
docstring const curlayout = par.layout().name();
|
docstring const curlayout = par.layout().name();
|
||||||
docstring outerlayout;
|
docstring outerlayout;
|
||||||
depth_type current_depth = par.params().depth();
|
depth_type current_depth = par.params().depth();
|
||||||
@ -1677,7 +1681,7 @@ void MenuDefinition::expandEnvironmentSeparators(BufferView const * bv)
|
|||||||
if (pit == 0 || cpar.params().depth() == 0)
|
if (pit == 0 || cpar.params().depth() == 0)
|
||||||
break;
|
break;
|
||||||
--pit;
|
--pit;
|
||||||
cpar = bv->cursor().text()->getPar(pit);
|
cpar = text->getPar(pit);
|
||||||
if (cpar.params().depth() < current_depth
|
if (cpar.params().depth() < current_depth
|
||||||
&& cpar.layout().isEnvironment()) {
|
&& cpar.layout().isEnvironment()) {
|
||||||
outerlayout = cpar.layout().name();
|
outerlayout = cpar.layout().name();
|
||||||
|
Loading…
Reference in New Issue
Block a user