]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetListings.cpp
Revert http://www.lyx.org/trac/changeset/25553 and try better fix for bug
[lyx.git] / src / insets / InsetListings.cpp
index 348e620b355441f838d52fa9acc0cfe75a05bc86..a2cb9851a40148092aa1b67baa144682e04a0c6a 100644 (file)
@@ -100,7 +100,7 @@ void InsetListings::read(Lexer & lex)
 {
        while (lex.isOK()) {
                lex.next();
-               string const token = lex.getString();
+               string token = lex.getString();
                if (token == "lstparams") {
                        lex.next();
                        string const value = lex.getString();
@@ -228,13 +228,13 @@ void InsetListings::doDispatch(Cursor & cur, FuncRequest & cmd)
 bool InsetListings::getStatus(Cursor & cur, FuncRequest const & cmd,
        FuncStatus & status) const
 {
-       LYXERR0("CURSOR SIZE: " << cur.depth());
        switch (cmd.action) {
+               case LFUN_INSET_MODIFY:
                case LFUN_INSET_DIALOG_UPDATE:
-                       status.enabled(true);
+                       status.setEnabled(true);
                        return true;
                case LFUN_CAPTION_INSERT:
-                       status.enabled(!params().isInline());
+                       status.setEnabled(!params().isInline());
                        return true;
                default:
                        return InsetCollapsable::getStatus(cur, cmd, status);
@@ -313,7 +313,7 @@ void InsetListings::string2params(string const & in,
        if (in.empty())
                return;
        istringstream data(in);
-       Lexer lex(0, 0);
+       Lexer lex;
        lex.setStream(data);
        // discard "listings", which is only used to determine inset
        lex.next();