]> git.lyx.org Git - features.git/commitdiff
Fix crash when right-clicking into an inset with more paragraphs than the main text.
authorJuergen Spitzmueller <spitz@lyx.org>
Sun, 18 May 2014 16:08:43 +0000 (18:08 +0200)
committerJuergen Spitzmueller <spitz@lyx.org>
Sun, 18 May 2014 16:08:43 +0000 (18:08 +0200)
Fixes: #9123.
src/frontends/qt4/Menus.cpp
status.21x

index 8e9fd54b6e99b5d1a2182b64432aebc022e4ebee..7911c162a1672998cc8c05d62a7d8923914e2666 100644 (file)
@@ -1667,7 +1667,7 @@ void MenuDefinition::expandEnvironmentSeparators(BufferView const * bv)
                return;
 
        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 outerlayout;
        depth_type current_depth = par.params().depth();
@@ -1677,7 +1677,7 @@ void MenuDefinition::expandEnvironmentSeparators(BufferView const * bv)
                if (pit == 0 || cpar.params().depth() == 0)
                        break;
                --pit;
-               cpar = bv->buffer().text().getPar(pit);
+               cpar = bv->cursor().text()->getPar(pit);
                if (cpar.params().depth() < current_depth
                    && cpar.layout().isEnvironment()) {
                                outerlayout = cpar.layout().name();
index bfa64845d918c4b0f710c24fb4cab31ee322d9ca..d7e92a25378f4d5af854c523247d9934e155f5d3 100644 (file)
@@ -87,6 +87,9 @@ What's new
 
 * USER INTERFACE
 
+- Fix crash when right-clicking into an insets with more paragraphs than the
+  main text (bug 9123).
+
 - Fix crash when entering math in change-tracking mode while merge changes
   dialog is open (bug 7685).