]> git.lyx.org Git - features.git/commitdiff
tex2lyx: simplify btUnit parsing
authorJuergen Spitzmueller <spitz@lyx.org>
Tue, 21 Aug 2018 15:33:30 +0000 (17:33 +0200)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Thu, 18 Jun 2020 12:39:47 +0000 (14:39 +0200)
src/tex2lyx/text.cpp

index 1fbc87eaeded4db33125586fc39c29fa0ee49405..c39f928f149cb1110b1452dfc811aad9c19e2675 100644 (file)
@@ -1925,20 +1925,13 @@ void parse_environment(Parser & p, ostream & os, bool outer,
 
        else if (name == "btUnit") {
                string const nt = p.next_next_token().cs();
-               active_environments.push_back("btUnit");
-               if (nt == "part")
-                       preamble.multibib("part");
-               else if (nt == "chapter")
-                       preamble.multibib("chapter");
-               else if (nt == "section")
-                       preamble.multibib("section");
-               else if (nt == "subsection")
-                       preamble.multibib("subsection");
-               else {
+               if (nt == "part" || nt == "chapter"
+                  || nt == "section" || nt == "subsection") {
+                       active_environments.push_back("btUnit");
+                       preamble.multibib(nt);
+               } else
                        parse_unknown_environment(p, name, os, FLAG_END, outer,
                                                  parent_context);
-                       active_environments.pop_back();
-               }
        }
 
        else if (name == "framed" || name == "shaded") {