]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/Menus.cpp
On Linux show in crash message box the backtrace
[lyx.git] / src / frontends / qt4 / Menus.cpp
index 8e9fd54b6e99b5d1a2182b64432aebc022e4ebee..707251dfbb27749c9d092b7cf6fcfd035f44abc0 100644 (file)
@@ -1554,9 +1554,10 @@ void MenuDefinition::expandCiteStyles(BufferView const * bv)
        vector<docstring> const keys = getVectorFromString(key);
 
        vector<CitationStyle> const citeStyleList = buf->params().citeStyles();
+       static const size_t max_length = 40;
        vector<docstring> citeStrings =
                buf->masterBibInfo().getCiteStrings(keys, citeStyleList, bv->buffer(),
-               false, before, after, from_utf8("dialog"));
+               before, after, from_utf8("dialog"), max_length);
 
        vector<docstring>::const_iterator cit = citeStrings.begin();
        vector<docstring>::const_iterator end = citeStrings.end();
@@ -1665,9 +1666,13 @@ void MenuDefinition::expandEnvironmentSeparators(BufferView const * bv)
 {
        if (!bv)
                return;
+       Text const * text = bv->cursor().text();
+       // no paragraphs and no separators exist in math
+       if (!text)
+               return;
 
        pit_type pit = bv->cursor().selBegin().pit();
-       Paragraph const & par = bv->buffer().text().getPar(pit);
+       Paragraph const & par = text->getPar(pit);
        docstring const curlayout = par.layout().name();
        docstring outerlayout;
        depth_type current_depth = par.params().depth();
@@ -1677,7 +1682,7 @@ void MenuDefinition::expandEnvironmentSeparators(BufferView const * bv)
                if (pit == 0 || cpar.params().depth() == 0)
                        break;
                --pit;
-               cpar = bv->buffer().text().getPar(pit);
+               cpar = text->getPar(pit);
                if (cpar.params().depth() < current_depth
                    && cpar.layout().isEnvironment()) {
                                outerlayout = cpar.layout().name();