]> git.lyx.org Git - lyx.git/blobdiff - src/sgml.C
fix mathed crash
[lyx.git] / src / sgml.C
index db91894847e2a061ccf60edacadefff47811cd64..7ebaf187a694782a4d7f21052c1fc83b7372b79a 100644 (file)
@@ -21,6 +21,7 @@ using std::make_pair;
 
 using std::ostream;
 using std::pair;
+using std::string;
 
 
 namespace sgml {
@@ -84,12 +85,16 @@ pair<bool, string> escapeChar(char c)
 
 
 int openTag(ostream & os, Paragraph::depth_type depth,
-           bool mixcont, string const & latexname)
+           bool mixcont, string const & latexname,
+               string const & latexparam)
 {
        if (!latexname.empty() && latexname != "!-- --") {
                if (!mixcont)
                        os << string(depth, ' ');
-               os << '<' << latexname << '>';
+               os << '<' << latexname;
+               if (!latexparam.empty())
+                       os << " " << latexparam;
+               os << '>';
        }
 
        if (!mixcont)
@@ -114,4 +119,21 @@ int closeTag(ostream & os, Paragraph::depth_type depth,
        return !mixcont;
 }
 
+
+unsigned int closeEnvTags(ostream & os, bool mixcont,
+                       string const & environment_inner_depth,
+                       string const & itemtag,
+                       lyx::depth_type total_depth)
+{
+       unsigned int lines = 0;
+       if (environment_inner_depth != "!-- --") {
+               lines += closeTag(os, total_depth, mixcont, itemtag);
+               if (!environment_inner_depth.empty())
+                       lines += closeTag(os, total_depth, mixcont,
+                               environment_inner_depth);
+       }
+       return lines;
+}
+
+
 } // namespace sgml