Georg Baum
2014-05-20 20:03:45 UTC
commit c5753af50d8568b7f36797ec8bd67586572fce13
Date: Sun May 18 18:03:06 2014 +0200
Fix crash when right-clicking into an inset with more paragraphs than
the main text.
Fixes: #9123.
diff --git a/src/frontends/qt4/Menus.cpp b/src/frontends/qt4/Menus.cpp
index 8e9fd54..7911c16 100644
--- a/src/frontends/qt4/Menus.cpp
+++ b/src/frontends/qt4/Menus.cpp
@@ -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();
This does still crash:Date: Sun May 18 18:03:06 2014 +0200
Fix crash when right-clicking into an inset with more paragraphs than
the main text.
Fixes: #9123.
diff --git a/src/frontends/qt4/Menus.cpp b/src/frontends/qt4/Menus.cpp
index 8e9fd54..7911c16 100644
--- a/src/frontends/qt4/Menus.cpp
+++ b/src/frontends/qt4/Menus.cpp
@@ -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();
- Create new empty document
- Create empty math formula by C-m
- Click edit menu, the cursor should still be in the math formula => crash,
because par is invalid (there are no paragraphs in mathed).
I propose the attached fix. Of course this will break if we ever have real
text insets for \mbox etc, but I guess there are many more places like that.
OK for master and 2.1?
Georg