]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetCommandParams.cpp
Fix bug 3363: mark buffer dirty after middle button paste in plain text and table...
[lyx.git] / src / insets / InsetCommandParams.cpp
index 24f2de9112227e1027ed03999f9379d9982e1a71..7c0807793c2dc0c55e86ee6be61a61b7fae77153 100644 (file)
@@ -15,7 +15,7 @@
 
 #include "debug.h"
 #include "gettext.h"
-#include "lyxlex.h"
+#include "Lexer.h"
 
 #include "support/ExceptionMessage.h"
 #include "support/lstrings.h"
@@ -68,7 +68,7 @@ InsetCommandParams::findInfo(std::string const & name)
 
        // InsetCitation
        // FIXME: Use is_possible_cite_command() in
-       // src/frontends/controllers/biblio.C, see comment in src/factory.C.
+       // src/frontends/controllers/frontend_helpers.cpp, see comment in src/factory.cpp.
        if (name == "cite" || name == "citet" || name == "citep" || name == "citealt" ||
            name == "citealp" || name == "citeauthor" || name == "citeyear" ||
            name == "citeyearpar" || name == "citet*" || name == "citep*" ||
@@ -113,6 +113,13 @@ InsetCommandParams::findInfo(std::string const & name)
                return &info;
        }
 
+       if (name == "lstinputlisting") {
+               static const char * const paramnames[] = {"filename", "lstparams", ""};
+               static const bool isoptional[] = {false, true};
+               static const CommandInfo info = {2, paramnames, isoptional};
+               return &info;
+       }
+
        // InsetIndex, InsetPrintIndex, InsetLabel
        if (name == "index" || name == "printindex" || name == "label") {
                static const char * const paramnames[] = {"name", ""};
@@ -256,7 +263,7 @@ void InsetCommandParams::scanCommand(string const & cmd)
 }
 
 
-void InsetCommandParams::read(LyXLex & lex)
+void InsetCommandParams::read(Lexer & lex)
 {
        if (lex.isOK()) {
                lex.next();
@@ -310,7 +317,7 @@ void InsetCommandParams::write(ostream & os) const
                if (!params_[i].empty())
                        // FIXME UNICODE
                        os << info_->paramnames[i] << ' '
-                          << LyXLex::quoteString(to_utf8(params_[i]))
+                          << Lexer::quoteString(to_utf8(params_[i]))
                           << '\n';
 }
 
@@ -357,7 +364,7 @@ std::string const InsetCommandParams::getOptions() const
                if (info_->optional[i])
                        return to_utf8(params_[i]);
        lyxerr << "Programming error: get nonexisting option in "
-              << name_ << " inset." << endl;; 
+              << name_ << " inset." << endl;;
        return string();
 }
 
@@ -374,7 +381,7 @@ std::string const InsetCommandParams::getSecOptions() const
                }
        // Happens in InsetCitation
        lyxerr << "Programming error: get nonexisting second option in "
-              << name_ << " inset." << endl;; 
+              << name_ << " inset." << endl;;
        return string();
 }
 
@@ -397,7 +404,7 @@ void InsetCommandParams::setOptions(std::string const & o)
                        return;
                }
        lyxerr << "Programming error: set nonexisting option in "
-              << name_ << " inset." << endl;; 
+              << name_ << " inset." << endl;;
 }
 
 
@@ -415,7 +422,7 @@ void InsetCommandParams::setSecOptions(std::string const & s)
                }
        // Happens in InsetCitation
        lyxerr << "Programming error: set nonexisting second option in "
-              << name_ << " inset." << endl;; 
+              << name_ << " inset." << endl;;
 }