no reason for them to be members. OK (after removing the "dangerous"
unrelated changes in buffer.C) ?

Also, can I do s/pasteParagraph/mergeParagraph ?

john


Index: sgml.h
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/sgml.h,v
retrieving revision 1.1
diff -u -r1.1 sgml.h
--- sgml.h      9 Aug 2002 00:42:12 -0000       1.1
+++ sgml.h      21 Oct 2002 01:28:02 -0000
@@ -10,21 +10,27 @@
 #ifndef SGML_H
 #define SGML_H
  
-#include <config.h>
-
 #include "LString.h"
  
 #include <algorithm>
+#include <iosfwd>
  
 namespace sgml {
 
 /**
  * Escape the given character if necessary
- * to an SGML entity. The bool return is true
+ * to an SGML entity. Returns true
  * if it was a whitespace character.
  */
 std::pair<bool, string> escapeChar(char c);
 
+/// FIXME
+int openTag(std::ostream & os, Paragraph::depth_type depth,
+           bool mixcont, string const & latexname);
+
+/// FIXME
+int closeTag(std::ostream & os, Paragraph::depth_type depth,
+           bool mixcont, string const & latexname);
 }
 
 #endif // SGML_H
Index: sgml.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/sgml.C,v
retrieving revision 1.1
diff -u -r1.1 sgml.C
--- sgml.C      9 Aug 2002 00:42:12 -0000       1.1
+++ sgml.C      21 Oct 2002 01:28:02 -0000
@@ -7,11 +7,17 @@
  * \author John Levon <[EMAIL PROTECTED]>
  */
 
-#include "sgml.h"
+#include <config.h>
+ 
+#include "support/LOstream.h"
+ 
 #include "paragraph.h"
+#include "sgml.h"
  
 using std::pair;
 using std::make_pair;
+using std::ostream;
+using std::endl;
  
 namespace sgml {
 
@@ -75,6 +81,38 @@
                break;
        }
        return make_pair(false, str);
+}
+
+ 
+int openTag(ostream & os, Paragraph::depth_type depth,
+           bool mixcont, string const & latexname)
+{
+       if (!latexname.empty() && latexname != "!-- --") {
+               if (!mixcont)
+                       os << string(" ", depth);
+               os << "<" << latexname << ">";
+       }
+
+       if (!mixcont)
+               os << endl;
+
+       return !mixcont;
+}
+
+
+int closeTag(ostream & os, Paragraph::depth_type depth,
+            bool mixcont, string const & latexname)
+{
+       if (!latexname.empty() && latexname != "!-- --") {
+               if (!mixcont)
+                       os << endl << string(" ", depth);
+               os << "</" << latexname << ">";
+       }
+
+       if (!mixcont)
+               os << endl;
+
+       return !mixcont;
 }
 
 } // namespace sgml
Index: buffer.h
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/buffer.h,v
retrieving revision 1.115
diff -u -r1.115 buffer.h
--- buffer.h    25 Sep 2002 12:19:13 -0000      1.115
+++ buffer.h    21 Oct 2002 01:28:05 -0000
@@ -177,12 +177,6 @@
        ///
        void makeDocBookFile(string const & filename,
                             bool nice, bool only_body = false);
-       /// Open SGML/XML tag.
-       int sgmlOpenTag(std::ostream & os, Paragraph::depth_type depth, bool mixcont,
-               string const & latexname) const;
-       /// Closes SGML/XML tag.
-       int sgmlCloseTag(std::ostream & os, Paragraph::depth_type depth, bool mixcont,
-               string const & latexname) const;
        ///
        void sgmlError(Paragraph * par, int pos, string const & message) const;
 
Index: buffer.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/buffer.C,v
retrieving revision 1.388
diff -u -r1.388 buffer.C
--- buffer.C    16 Oct 2002 20:27:22 -0000      1.388
+++ buffer.C    21 Oct 2002 01:28:34 -0000
@@ -199,7 +199,7 @@
 }
 
 
-pair<Buffer::LogType, string> const Buffer::getLogName(void) const
+pair<Buffer::LogType, string> const Buffer::getLogName() const
 {
        string const filename = getLatexName(false);
 
@@ -305,11 +305,6 @@
        Paragraph * first_par = 0;
        LyXFont font(LyXFont::ALL_INHERIT, params.language);
 
-#if 0
-       if (file_format < 216 && params.language->lang() == "hebrew")
-               font.setLanguage(default_language);
-#endif
-
        if (!par) {
                par = new Paragraph;
                par->layout(params.getLyXTextClass().defaultLayout());
@@ -406,11 +401,6 @@
                // right values after this tag (Jug 20020420)
                font = LyXFont(LyXFont::ALL_INHERIT, params.language);
 
-#if 0
-               if (file_format < 216 && params.language->lang() == "hebrew")
-                       font.setLanguage(default_language);
-#endif
-
                lex.eatLine();
                string layoutname = lex.getString();
 
@@ -614,11 +604,6 @@
                        params.textclass = 0;
                }
                if (!params.getLyXTextClass().load()) {
-                       // if the textclass wasn't loaded properly
-                       // we need to either substitute another
-                       // or stop loading the file.
-                       // I can substitute but I don't see how I can
-                       // stop loading... ideas??  ARRae980418
                        Alert::alert(_("Textclass Loading Error!"),
                                   string(_("Can't load textclass ")) +
                                   params.getLyXTextClass().name(),
@@ -851,7 +836,7 @@
                        lex.printError("Unknown spacing token: '$$Token'");
                }
                // Small hack so that files written with klyx will be
-               // parsed correctly.
+               // parsed correctly. FIXME: remove !!
                if (first_par) {
                        par->params().spacing(Spacing(tmp_space, tmp_val));
                } else {
@@ -954,6 +939,10 @@
                static_cast<InsetText *>(par->inInset())->getAutoBreakRows();
        for(string::const_iterator cit = str.begin();
            cit != str.end(); ++cit) {
+ 
+               if (!IsPrintable(*cit))
+                       continue;
+ 
                if (*cit == '\n') {
                        if (autobreakrows && (!par->empty() || layout->keepempty)) {
                                breakParagraph(params, par, pos,
@@ -961,39 +950,39 @@
                                par = par->next();
                                pos = 0;
                                space_inserted = true;
-                       } else {
-                               continue;
                        }
-                       // do not insert consecutive spaces if !free_spacing
-               } else if ((*cit == ' ' || *cit == '\t') &&
-                          space_inserted && !layout->free_spacing &&
-                                  !par->isFreeSpacing())
-               {
                        continue;
-               } else if (*cit == '\t') {
-                       if (!layout->free_spacing && !par->isFreeSpacing()) {
+               }
+
+               bool const free_spacing = layout->free_spacing
+                       || par->isFreeSpacing();
+
+               bool const allow_space = free_spacing || !space_inserted;
+
+               // do not insert consecutive spaces if !free_spacing
+               if ((*cit == ' ' || *cit == '\t') && !allow_space)
+                       continue;
+
+               if (*cit == '\t') {
+                       if (!free_spacing) {
                                // tabs are like spaces here
                                par->insertChar(pos, ' ', font);
                                ++pos;
                                space_inserted = true;
                        } else {
-                               const pos_type nb = 8 - pos % 8;
+                               pos_type const nb = 8 - pos % 8;
                                for (pos_type a = 0; a < nb ; ++a) {
                                        par->insertChar(pos, ' ', font);
                                        ++pos;
                                }
                                space_inserted = true;
                        }
-               } else if (!IsPrintable(*cit)) {
-                       // Ignore unprintables
-                       continue;
                } else {
                        // just insert the character
                        par->insertChar(pos, *cit, font);
                        ++pos;
                        space_inserted = (*cit == ' ');
                }
-
        }
 }
 
@@ -2201,38 +2190,6 @@
 }
 
 
-int Buffer::sgmlOpenTag(ostream & os, Paragraph::depth_type depth, bool mixcont,
-                        string const & latexname) const
-{
-       if (!latexname.empty() && latexname != "!-- --") {
-               if (!mixcont)
-                       os << string(" ",depth);
-               os << "<" << latexname << ">";
-       }
-
-       if (!mixcont)
-               os << endl;
-
-       return mixcont?0:1;
-}
-
-
-int Buffer::sgmlCloseTag(ostream & os, Paragraph::depth_type depth, bool mixcont,
-                         string const & latexname) const
-{
-       if (!latexname.empty() && latexname != "!-- --") {
-               if (!mixcont)
-                       os << endl << string(" ",depth);
-               os << "</" << latexname << ">";
-       }
-
-       if (!mixcont)
-               os << endl;
-
-       return mixcont?0:1;
-}
-
-
 void Buffer::makeLinuxDocFile(string const & fname, bool nice, bool body_only)
 {
        ofstream ofs(fname.c_str());
@@ -2269,12 +2226,12 @@
                ofs << ">\n\n";
 
                if (params.options.empty())
-                       sgmlOpenTag(ofs, 0, false, top_element);
+                       sgml::openTag(ofs, 0, false, top_element);
                else {
                        string top = top_element;
                        top += " ";
                        top += params.options;
-                       sgmlOpenTag(ofs, 0, false, top);
+                       sgml::openTag(ofs, 0, false, top);
                }
        }
 
@@ -2295,7 +2252,7 @@
                        Inset::Code lyx_code = inset->lyxCode();
                        if (lyx_code == Inset::TOC_CODE) {
                                string const temp = "toc";
-                               sgmlOpenTag(ofs, depth, false, temp);
+                               sgml::openTag(ofs, depth, false, temp);
 
                                par = par->next();
                                continue;
@@ -2304,7 +2261,7 @@
 
                // environment tag closing
                for (; depth > par->params().depth(); --depth) {
-                       sgmlCloseTag(ofs, depth, false, environment_stack[depth]);
+                       sgml::closeTag(ofs, depth, false, environment_stack[depth]);
                        environment_stack[depth].erase();
                }
 
@@ -2313,14 +2270,14 @@
                case LATEX_PARAGRAPH:
                        if (depth == par->params().depth()
                           && !environment_stack[depth].empty()) {
-                               sgmlCloseTag(ofs, depth, false, 
environment_stack[depth]);
+                               sgml::closeTag(ofs, depth, false, 
+environment_stack[depth]);
                                environment_stack[depth].erase();
                                if (depth)
                                        --depth;
                                else
                                        ofs << "</p>";
                        }
-                       sgmlOpenTag(ofs, depth, false, style->latexname());
+                       sgml::openTag(ofs, depth, false, style->latexname());
                        break;
 
                case LATEX_COMMAND:
@@ -2330,12 +2287,12 @@
                                            " LatexType Command.\n"));
 
                        if (!environment_stack[depth].empty()) {
-                               sgmlCloseTag(ofs, depth, false, 
environment_stack[depth]);
+                               sgml::closeTag(ofs, depth, false, 
+environment_stack[depth]);
                                ofs << "</p>";
                        }
 
                        environment_stack[depth].erase();
-                       sgmlOpenTag(ofs, depth, false, style->latexname());
+                       sgml::openTag(ofs, depth, false, style->latexname());
                        break;
 
                case LATEX_ENVIRONMENT:
@@ -2345,7 +2302,7 @@
 
                        if (depth == par->params().depth()
                            && environment_stack[depth] != latexname) {
-                               sgmlCloseTag(ofs, depth, false,
+                               sgml::closeTag(ofs, depth, false,
                                             environment_stack[depth]);
                                environment_stack[depth].erase();
                        }
@@ -2355,9 +2312,9 @@
                        }
                        if (environment_stack[depth] != latexname) {
                                if (depth == 0) {
-                                       sgmlOpenTag(ofs, depth, false, "p");
+                                       sgml::openTag(ofs, depth, false, "p");
                                }
-                               sgmlOpenTag(ofs, depth, false, latexname);
+                               sgml::openTag(ofs, depth, false, latexname);
 
                                if (environment_stack.size() == depth + 1)
                                        environment_stack.push_back("!-- --");
@@ -2374,12 +2331,12 @@
                        else
                                item_name = "item";
 
-                       sgmlOpenTag(ofs, depth + 1, false, item_name);
+                       sgml::openTag(ofs, depth + 1, false, item_name);
                }
                break;
 
                default:
-                       sgmlOpenTag(ofs, depth, false, style->latexname());
+                       sgml::openTag(ofs, depth, false, style->latexname());
                        break;
                }
 
@@ -2398,18 +2355,18 @@
                                ofs << "]]>";
                        break;
                default:
-                       sgmlCloseTag(ofs, depth, false, style->latexname());
+                       sgml::closeTag(ofs, depth, false, style->latexname());
                        break;
                }
        }
 
        // Close open tags
        for (int i = depth; i >= 0; --i)
-               sgmlCloseTag(ofs, depth, false, environment_stack[i]);
+               sgml::closeTag(ofs, depth, false, environment_stack[i]);
 
        if (!body_only) {
                ofs << "\n\n";
-               sgmlCloseTag(ofs, 0, false, top_element);
+               sgml::closeTag(ofs, 0, false, top_element);
        }
 
        ofs.close();
@@ -2735,7 +2692,7 @@
                top += " ";
                top += params.options;
        }
-       sgmlOpenTag(ofs, 0, false, top);
+       sgml::openTag(ofs, 0, false, top);
 
        ofs << "<!-- DocBook file was created by " << lyx_docversion
            << "\n  See http://www.lyx.org/ for more information -->\n";
@@ -2765,11 +2722,11 @@
                for (; depth > par->params().depth(); --depth) {
                        if (environment_inner[depth] != "!-- --") {
                                item_name = "listitem";
-                               sgmlCloseTag(ofs, command_depth + depth, false, 
item_name);
+                               sgml::closeTag(ofs, command_depth + depth, false, 
+item_name);
                                if (environment_inner[depth] == "varlistentry")
-                                       sgmlCloseTag(ofs, depth+command_depth, false, 
environment_inner[depth]);
+                                       sgml::closeTag(ofs, depth+command_depth, 
+false, environment_inner[depth]);
                        }
-                       sgmlCloseTag(ofs, depth + command_depth, false, 
environment_stack[depth]);
+                       sgml::closeTag(ofs, depth + command_depth, false, 
+environment_stack[depth]);
                        environment_stack[depth].erase();
                        environment_inner[depth].erase();
                }
@@ -2779,12 +2736,12 @@
                   && !environment_stack[depth].empty()) {
                        if (environment_inner[depth] != "!-- --") {
                                item_name= "listitem";
-                               sgmlCloseTag(ofs, command_depth+depth, false, 
item_name);
+                               sgml::closeTag(ofs, command_depth+depth, false, 
+item_name);
                                if (environment_inner[depth] == "varlistentry")
-                                       sgmlCloseTag(ofs, depth + command_depth, 
false, environment_inner[depth]);
+                                       sgml::closeTag(ofs, depth + command_depth, 
+false, environment_inner[depth]);
                        }
 
-                       sgmlCloseTag(ofs, depth + command_depth, false, 
environment_stack[depth]);
+                       sgml::closeTag(ofs, depth + command_depth, false, 
+environment_stack[depth]);
 
                        environment_stack[depth].erase();
                        environment_inner[depth].erase();
@@ -2793,7 +2750,7 @@
                // Write opening SGML tags.
                switch (style->latextype) {
                case LATEX_PARAGRAPH:
-                       sgmlOpenTag(ofs, depth + command_depth,
+                       sgml::openTag(ofs, depth + command_depth,
                                    false, style->latexname());
                        break;
 
@@ -2814,14 +2771,14 @@
                                if (cmd_depth < command_base) {
                                        for (Paragraph::depth_type j = command_depth;
                                             j >= command_base; --j) {
-                                               sgmlCloseTag(ofs, j, false, 
command_stack[j]);
+                                               sgml::closeTag(ofs, j, false, 
+command_stack[j]);
                                                ofs << endl;
                                        }
                                        command_depth = command_base = cmd_depth;
                                } else if (cmd_depth <= command_depth) {
                                        for (int j = command_depth;
                                             j >= int(cmd_depth); --j) {
-                                               sgmlCloseTag(ofs, j, false, 
command_stack[j]);
+                                               sgml::closeTag(ofs, j, false, 
+command_stack[j]);
                                                ofs << endl;
                                        }
                                        command_depth = cmd_depth;
@@ -2850,10 +2807,10 @@
                                }
                        }
 
-                       sgmlOpenTag(ofs, depth + command_depth, false, command_name);
+                       sgml::openTag(ofs, depth + command_depth, false, command_name);
 
                        item_name = c_params.empty()?"title":c_params;
-                       sgmlOpenTag(ofs, depth + 1 + command_depth, false, item_name);
+                       sgml::openTag(ofs, depth + 1 + command_depth, false, 
+item_name);
                        break;
 
                case LATEX_ENVIRONMENT:
@@ -2870,13 +2827,13 @@
                                }
                                environment_stack[depth] = style->latexname();
                                environment_inner[depth] = "!-- --";
-                               sgmlOpenTag(ofs, depth + command_depth, false, 
environment_stack[depth]);
+                               sgml::openTag(ofs, depth + command_depth, false, 
+environment_stack[depth]);
                        } else {
                                if (environment_inner[depth] != "!-- --") {
                                        item_name= "listitem";
-                                       sgmlCloseTag(ofs, command_depth + depth, 
false, item_name);
+                                       sgml::closeTag(ofs, command_depth + depth, 
+false, item_name);
                                        if (environment_inner[depth] == "varlistentry")
-                                               sgmlCloseTag(ofs, depth + 
command_depth, false, environment_inner[depth]);
+                                               sgml::closeTag(ofs, depth + 
+command_depth, false, environment_inner[depth]);
                                }
                        }
 
@@ -2885,7 +2842,7 @@
                                        if (style->latexparam() == "CDATA")
                                                ofs << "<![CDATA[";
                                        else
-                                               sgmlOpenTag(ofs, depth + 
command_depth, false, style->latexparam());
+                                               sgml::openTag(ofs, depth + 
+command_depth, false, style->latexparam());
                                }
                                break;
                        }
@@ -2893,15 +2850,15 @@
                        desc_on = (style->labeltype == LABEL_MANUAL);
 
                        environment_inner[depth] = desc_on ? "varlistentry" : 
"listitem";
-                       sgmlOpenTag(ofs, depth + 1 + command_depth,
+                       sgml::openTag(ofs, depth + 1 + command_depth,
                                    false, environment_inner[depth]);
 
                        item_name = desc_on ? "term" : "para";
-                       sgmlOpenTag(ofs, depth + 1 + command_depth,
+                       sgml::openTag(ofs, depth + 1 + command_depth,
                                    false, item_name);
                        break;
                default:
-                       sgmlOpenTag(ofs, depth + command_depth,
+                       sgml::openTag(ofs, depth + command_depth,
                                    false, style->latexname());
                        break;
                }
@@ -2915,7 +2872,7 @@
                switch (style->latextype) {
                case LATEX_COMMAND:
                        end_tag = c_params.empty() ? "title" : c_params;
-                       sgmlCloseTag(ofs, depth + command_depth,
+                       sgml::closeTag(ofs, depth + command_depth,
                                     false, end_tag);
                        break;
                case LATEX_ENVIRONMENT:
@@ -2923,19 +2880,19 @@
                                if (style->latexparam() == "CDATA")
                                        ofs << "]]>";
                                else
-                                       sgmlCloseTag(ofs, depth + command_depth, 
false, style->latexparam());
+                                       sgml::closeTag(ofs, depth + command_depth, 
+false, style->latexparam());
                        }
                        break;
                case LATEX_ITEM_ENVIRONMENT:
                        if (desc_on == 1) break;
                        end_tag= "para";
-                       sgmlCloseTag(ofs, depth + 1 + command_depth, false, end_tag);
+                       sgml::closeTag(ofs, depth + 1 + command_depth, false, end_tag);
                        break;
                case LATEX_PARAGRAPH:
-                       sgmlCloseTag(ofs, depth + command_depth, false, 
style->latexname());
+                       sgml::closeTag(ofs, depth + command_depth, false, 
+style->latexname());
                        break;
                default:
-                       sgmlCloseTag(ofs, depth + command_depth, false, 
style->latexname());
+                       sgml::closeTag(ofs, depth + command_depth, false, 
+style->latexname());
                        break;
                }
        }
@@ -2945,23 +2902,23 @@
                if (!environment_stack[depth].empty()) {
                        if (environment_inner[depth] != "!-- --") {
                                item_name = "listitem";
-                               sgmlCloseTag(ofs, command_depth + depth, false, 
item_name);
+                               sgml::closeTag(ofs, command_depth + depth, false, 
+item_name);
                               if (environment_inner[depth] == "varlistentry")
-                                      sgmlCloseTag(ofs, depth + command_depth, false, 
environment_inner[depth]);
+                                      sgml::closeTag(ofs, depth + command_depth, 
+false, environment_inner[depth]);
                        }
 
-                       sgmlCloseTag(ofs, depth + command_depth, false, 
environment_stack[depth]);
+                       sgml::closeTag(ofs, depth + command_depth, false, 
+environment_stack[depth]);
                }
        }
 
        for (int j = command_depth; j >= 0 ; --j)
                if (!command_stack[j].empty()) {
-                       sgmlCloseTag(ofs, j, false, command_stack[j]);
+                       sgml::closeTag(ofs, j, false, command_stack[j]);
                        ofs << endl;
                }
 
        ofs << "\n\n";
-       sgmlCloseTag(ofs, 0, false, top_element);
+       sgml::closeTag(ofs, 0, false, top_element);
 
        ofs.close();
        // How to check for successful close
Index: insets/insettext.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insettext.C,v
retrieving revision 1.334
diff -u -r1.334 insettext.C
--- insets/insettext.C  14 Oct 2002 14:59:50 -0000      1.334
+++ insets/insettext.C  21 Oct 2002 01:28:56 -0000
@@ -38,6 +38,7 @@
 #include "undo_funcs.h"
 #include "WordLangTuple.h"
 #include "paragraph_funcs.h"
+#include "sgml.h"
 
 #include "frontends/Alert.h"
 #include "frontends/Dialogs.h"
@@ -1631,11 +1632,11 @@
                for (; depth > p->params().depth(); --depth) {
                        if (environment_inner[depth] != "!-- --") {
                                item_name = "listitem";
-                               lines += buf->sgmlCloseTag(os, command_depth + depth, 
mixcont, item_name);
+                               lines += sgml::closeTag(os, command_depth + depth, 
+mixcont, item_name);
                                if (environment_inner[depth] == "varlistentry")
-                                       lines += buf->sgmlCloseTag(os, 
depth+command_depth, mixcont, environment_inner[depth]);
+                                       lines += sgml::closeTag(os, 
+depth+command_depth, mixcont, environment_inner[depth]);
                        }
-                       lines += buf->sgmlCloseTag(os, depth + command_depth, mixcont, 
environment_stack[depth]);
+                       lines += sgml::closeTag(os, depth + command_depth, mixcont, 
+environment_stack[depth]);
                        environment_stack[depth].erase();
                        environment_inner[depth].erase();
                }
@@ -1645,12 +1646,12 @@
                   && !environment_stack[depth].empty()) {
                        if (environment_inner[depth] != "!-- --") {
                                item_name= "listitem";
-                               lines += buf->sgmlCloseTag(os, command_depth+depth, 
mixcont, item_name);
+                               lines += sgml::closeTag(os, command_depth+depth, 
+mixcont, item_name);
                                if (environment_inner[depth] == "varlistentry")
-                                       lines += buf->sgmlCloseTag(os, depth + 
command_depth, mixcont, environment_inner[depth]);
+                                       lines += sgml::closeTag(os, depth + 
+command_depth, mixcont, environment_inner[depth]);
                        }
 
-                       lines += buf->sgmlCloseTag(os, depth + command_depth, mixcont, 
environment_stack[depth]);
+                       lines += sgml::closeTag(os, depth + command_depth, mixcont, 
+environment_stack[depth]);
 
                        environment_stack[depth].erase();
                        environment_inner[depth].erase();
@@ -1659,7 +1660,7 @@
                // Write opening SGML tags.
                switch (style->latextype) {
                case LATEX_PARAGRAPH:
-                       lines += buf->sgmlOpenTag(os, depth + command_depth, mixcont, 
style->latexname());
+                       lines += sgml::openTag(os, depth + command_depth, mixcont, 
+style->latexname());
                        break;
 
                case LATEX_COMMAND:
@@ -1681,13 +1682,13 @@
                                }
                                environment_stack[depth] = style->latexname();
                                environment_inner[depth] = "!-- --";
-                               lines += buf->sgmlOpenTag(os, depth + command_depth, 
mixcont, environment_stack[depth]);
+                               lines += sgml::openTag(os, depth + command_depth, 
+mixcont, environment_stack[depth]);
                        } else {
                                if (environment_inner[depth] != "!-- --") {
                                        item_name= "listitem";
-                                       lines += buf->sgmlCloseTag(os, command_depth + 
depth, mixcont, item_name);
+                                       lines += sgml::closeTag(os, command_depth + 
+depth, mixcont, item_name);
                                        if (environment_inner[depth] == "varlistentry")
-                                               lines += buf->sgmlCloseTag(os, depth + 
command_depth, mixcont, environment_inner[depth]);
+                                               lines += sgml::closeTag(os, depth + 
+command_depth, mixcont, environment_inner[depth]);
                                }
                        }
 
@@ -1696,7 +1697,7 @@
                                        if (style->latexparam() == "CDATA")
                                                os << "<![CDATA[";
                                        else
-                                         lines += buf->sgmlOpenTag(os, depth + 
command_depth, mixcont, style->latexparam());
+                                         lines += sgml::openTag(os, depth + 
+command_depth, mixcont, style->latexparam());
                                }
                                break;
                        }
@@ -1704,14 +1705,14 @@
                        desc_on = (style->labeltype == LABEL_MANUAL);
 
                        environment_inner[depth] = desc_on?"varlistentry":"listitem";
-                       lines += buf->sgmlOpenTag(os, depth + 1 + command_depth, 
mixcont, environment_inner[depth]);
+                       lines += sgml::openTag(os, depth + 1 + command_depth, mixcont, 
+environment_inner[depth]);
 
                        item_name = desc_on?"term":"para";
-                       lines += buf->sgmlOpenTag(os, depth + 1 + command_depth, 
mixcont, item_name);
+                       lines += sgml::openTag(os, depth + 1 + command_depth, mixcont, 
+item_name);
 
                        break;
                default:
-                       lines += buf->sgmlOpenTag(os, depth + command_depth, mixcont, 
style->latexname());
+                       lines += sgml::openTag(os, depth + command_depth, mixcont, 
+style->latexname());
                        break;
                }
 
@@ -1726,19 +1727,19 @@
                                if (style->latexparam() == "CDATA")
                                        os << "]]>";
                                else
-                                       lines += buf->sgmlCloseTag(os, depth + 
command_depth, mixcont, style->latexparam());
+                                       lines += sgml::closeTag(os, depth + 
+command_depth, mixcont, style->latexparam());
                        }
                        break;
                case LATEX_ITEM_ENVIRONMENT:
                        if (desc_on == 1) break;
                        end_tag= "para";
-                       lines += buf->sgmlCloseTag(os, depth + 1 + command_depth, 
mixcont, end_tag);
+                       lines += sgml::closeTag(os, depth + 1 + command_depth, 
+mixcont, end_tag);
                        break;
                case LATEX_PARAGRAPH:
-                       lines += buf->sgmlCloseTag(os, depth + command_depth, mixcont, 
style->latexname());
+                       lines += sgml::closeTag(os, depth + command_depth, mixcont, 
+style->latexname());
                        break;
                default:
-                       lines += buf->sgmlCloseTag(os, depth + command_depth, mixcont, 
style->latexname());
+                       lines += sgml::closeTag(os, depth + command_depth, mixcont, 
+style->latexname());
                        break;
                }
        }
@@ -1748,12 +1749,12 @@
                if (!environment_stack[depth].empty()) {
                        if (environment_inner[depth] != "!-- --") {
                                item_name = "listitem";
-                               lines += buf->sgmlCloseTag(os, command_depth + depth, 
mixcont, item_name);
+                               lines += sgml::closeTag(os, command_depth + depth, 
+mixcont, item_name);
                               if (environment_inner[depth] == "varlistentry")
-                                      lines += buf->sgmlCloseTag(os, depth + 
command_depth, mixcont, environment_inner[depth]);
+                                      lines += sgml::closeTag(os, depth + 
+command_depth, mixcont, environment_inner[depth]);
                        }
 
-                       lines += buf->sgmlCloseTag(os, depth + command_depth, mixcont, 
environment_stack[depth]);
+                       lines += sgml::closeTag(os, depth + command_depth, mixcont, 
+environment_stack[depth]);
                }
        }
 
@@ -2763,7 +2764,7 @@
                                        llt->selection.end.pos() + 
paragraphs.begin()->size());
                        }
                }
-               pasteParagraph(bparams, &*paragraphs.begin());
+               mergeParagraph(bparams, &*paragraphs.begin());
        }
        reinitLyXText();
 }
@@ -2805,7 +2806,7 @@
        // paste it!
        lastbuffer->next(buf);
        buf->previous(lastbuffer);
-       pasteParagraph(bparams, lastbuffer);
+       mergeParagraph(bparams, lastbuffer);
 
        reinitLyXText();
 }

-- 
"It's a cardboard universe ... and if you lean too hard against it, you fall
 through." 
        - Philip K. Dick 

Reply via email to