commit 5c97424a72d9d1ad3f6e76112a5f152b813d5be7
Author: Juergen Spitzmueller <[email protected]>
Date:   Tue Aug 21 17:33:30 2018 +0200

    tex2lyx: simplify btUnit parsing
---
 src/tex2lyx/text.cpp |   17 +++++------------
 1 files changed, 5 insertions(+), 12 deletions(-)

diff --git a/src/tex2lyx/text.cpp b/src/tex2lyx/text.cpp
index 1fbc87e..c39f928 100644
--- a/src/tex2lyx/text.cpp
+++ b/src/tex2lyx/text.cpp
@@ -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") {

Reply via email to