X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Ftex2lyx%2Ftext.cpp;h=ce330a2b9ffe97a21a1c0da1ac0093632469fdd6;hb=37d30288af89e760f642e823fe8c7e9d78e5045d;hp=ecf6bf211055a19e8456a8cbe4fd3ccb015896d9;hpb=bfc749eb237ad1db8aa899279ecf32bb4847f07a;p=lyx.git diff --git a/src/tex2lyx/text.cpp b/src/tex2lyx/text.cpp index ecf6bf2110..ce330a2b9f 100644 --- a/src/tex2lyx/text.cpp +++ b/src/tex2lyx/text.cpp @@ -521,8 +521,8 @@ docstring convert_unicodesymbols(docstring s) bool termination; docstring rem; set req; - docstring parsed = encodings.fromLaTeXCommand(s, - Encodings::TEXT_CMD, termination, rem, &req); + docstring parsed = normalize_c(encodings.fromLaTeXCommand(s, + Encodings::TEXT_CMD, termination, rem, &req)); set::const_iterator it = req.begin(); set::const_iterator en = req.end(); for (; it != en; ++it) @@ -1555,25 +1555,17 @@ void parse_environment(Parser & p, ostream & os, bool outer, preamble.registerAutomaticallyLoadedPackage("verbatim"); } - else if (unstarred_name == "verbatim" || name == "verbatim*") { + else if (unstarred_name == "verbatim") { // FIXME: this should go in the generic code that // handles environments defined in layout file that // have "PassThru 1". However, the code over there is // already too complicated for my taste. - string ascii_name; - string env_name; - if (unstarred_name == "verbatim") { - ascii_name = "Verbatim"; - env_name = "verbatim"; - } - if (name == "verbatim*") { - ascii_name = "Verbatim*"; - env_name = name; - } + string const ascii_name = + (name == "verbatim*") ? "Verbatim*" : "Verbatim"; parent_context.new_paragraph(os); Context context(true, parent_context.textclass, &parent_context.textclass[from_ascii(ascii_name)]); - string s = p.verbatimEnvironment(env_name); + string s = p.verbatimEnvironment(name); output_ert(os, s, context); p.skip_spaces(); } @@ -4832,8 +4824,8 @@ void parse_text(Parser & p, ostream & os, unsigned flags, bool outer, bool termination; docstring rem; set req; - docstring s = encodings.fromLaTeXCommand(from_utf8(name), - Encodings::TEXT_CMD, termination, rem, &req); + docstring s = normalize_c(encodings.fromLaTeXCommand(from_utf8(name), + Encodings::TEXT_CMD, termination, rem, &req)); if (!s.empty()) { context.check_layout(os); os << to_utf8(s);