From b13f5dee53115f6619c1f0fd5bcfb7ebf031feae Mon Sep 17 00:00:00 2001 From: Juergen Spitzmueller Date: Thu, 6 Feb 2014 11:08:33 +0100 Subject: [PATCH] Fix assertion in editing math (bug #8946) --- src/frontends/qt4/Menus.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/frontends/qt4/Menus.cpp b/src/frontends/qt4/Menus.cpp index bfb0d70039..6816986495 100644 --- a/src/frontends/qt4/Menus.cpp +++ b/src/frontends/qt4/Menus.cpp @@ -1666,13 +1666,13 @@ void MenuDefinition::expandEnvironmentSeparators(BufferView const * bv) if (!bv) return; - Paragraph const par = bv->cursor().paragraph(); + pit_type pit = bv->cursor().pit(); + Paragraph const & par = bv->buffer().text().getPar(pit); docstring const curlayout = par.layout().name(); docstring outerlayout; depth_type current_depth = par.params().depth(); // check if we have an environment in our nesting hierarchy - pit_type pit = bv->cursor().pit(); - Paragraph cpar = bv->buffer().text().getPar(pit); + Paragraph cpar = par; while (true) { if (pit == 0 || cpar.params().depth() == 0) break;