]> git.lyx.org Git - lyx.git/blobdiff - src/Paragraph.cpp
fix MSVC warning.
[lyx.git] / src / Paragraph.cpp
index 9e8483432d0a6905924f4c62d55b1c18a23929fe..70dfc40617959a4faf97cbbce2ab7a3e42c9f102 100644 (file)
@@ -186,10 +186,10 @@ struct special_phrase {
 };
 
 special_phrase const special_phrases[] = {
-       { "LyX", from_ascii("\\LyX{}"), false },
-       { "TeX", from_ascii("\\TeX{}"), true },
-       { "LaTeX2e", from_ascii("\\LaTeXe{}"), true },
-       { "LaTeX", from_ascii("\\LaTeX{}"), true },
+       { "LyX", from_ascii("\\protect\\LyX{}"), false },
+       { "TeX", from_ascii("\\protect\\TeX{}"), true },
+       { "LaTeX2e", from_ascii("\\protect\\LaTeXe{}"), true },
+       { "LaTeX", from_ascii("\\protect\\LaTeX{}"), true },
 };
 
 size_t const phrases_nr = sizeof(special_phrases)/sizeof(special_phrase);
@@ -775,6 +775,11 @@ void Paragraph::Private::simpleTeXSpecialChar(
                                             unsigned int & column,
                                             value_type const c)
 {
+       if (runparams.verbatim) {
+               os.put(c);
+               return;
+       }
+
        switch (c) {
        case '\\':
                os << "\\textbackslash{}";
@@ -2499,4 +2504,18 @@ Inset const * Paragraph::getInset(pos_type pos) const
        return d->insetlist_.get(pos);
 }
 
+
+int Paragraph::numberOfOptArgs() const
+{
+       int num = 0;
+       InsetList::const_iterator it = insetList().begin();
+       InsetList::const_iterator end = insetList().end();
+       for (; it != end ; ++it) {
+               if (it->inset->lyxCode() == OPTARG_CODE)
+                       ++num;
+       }
+       return num;
+}
+
+
 } // namespace lyx