mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-29 13:04:58 +00:00
Fix crash when right-clicking into an inset with more paragraphs than the main text.
Fixes: #9123.
This commit is contained in:
parent
0616c8fe32
commit
c5753af50d
@ -1667,7 +1667,7 @@ void MenuDefinition::expandEnvironmentSeparators(BufferView const * bv)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
pit_type pit = bv->cursor().selBegin().pit();
|
pit_type pit = bv->cursor().selBegin().pit();
|
||||||
Paragraph const & par = bv->buffer().text().getPar(pit);
|
Paragraph const & par = bv->cursor().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 +1677,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->buffer().text().getPar(pit);
|
cpar = bv->cursor().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