]> git.lyx.org Git - features.git/commitdiff
Fix assertion in editing math (bug #8946)
authorJuergen Spitzmueller <spitz@lyx.org>
Thu, 6 Feb 2014 10:08:33 +0000 (11:08 +0100)
committerJuergen Spitzmueller <spitz@lyx.org>
Thu, 6 Feb 2014 10:09:02 +0000 (11:09 +0100)
src/frontends/qt4/Menus.cpp

index bfb0d700391d02a2c2c8446d10c15a018dab1e73..68169864950768613d75688e4f41352d3b4c1cae 100644 (file)
@@ -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;