X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Fsgml.C;h=7ebaf187a694782a4d7f21052c1fc83b7372b79a;hb=67f9c9fdae42211aa3ff8d0c6f62485bd721d8eb;hp=9104cda839cb7b3f2eb7ca913a951f7e7f3b7dbf;hpb=47432f0259d981d61922ee0f451183dc949aca3f;p=lyx.git diff --git a/src/sgml.C b/src/sgml.C index 9104cda839..7ebaf187a6 100644 --- a/src/sgml.C +++ b/src/sgml.C @@ -1,23 +1,28 @@ /** * \file sgml.C - * Copyright 2002 the LyX Team - * Read the file COPYING + * This file is part of LyX, the document processor. + * Licence details can be found in the file COPYING. * * \author José Matos - * \author John Levon + * \author John Levon + * + * Full author contact details are available in file CREDITS. */ #include -#include "support/LOstream.h" +#include "support/std_ostream.h" #include "paragraph.h" #include "sgml.h" -using std::pair; +using std::endl; using std::make_pair; + using std::ostream; -using std::endl; +using std::pair; +using std::string; + namespace sgml { @@ -80,12 +85,16 @@ pair 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) @@ -110,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