]> git.lyx.org Git - lyx.git/blobdiff - src/sgml.cpp
adjust
[lyx.git] / src / sgml.cpp
index 87c5d18a7571ea7bf9b3dafd592105741c98c6bd..e1709a9a8da4337e013c2024e8651780b75f74ac 100644 (file)
@@ -16,7 +16,8 @@
 #include "Buffer.h"
 #include "BufferParams.h"
 #include "Counters.h"
-#include "LyXText.h"
+#include "Text.h"
+#include "Layout.h"
 #include "OutputParams.h"
 #include "Paragraph.h"
 
@@ -124,9 +125,9 @@ docstring sgml::cleanID(Buffer const & buf, OutputParams const & runparams,
        // and adds a number for uniqueness.
        // If you know what you are doing, you can set allowed==""
        // to disable this mangling.
-       LyXTextClass const & tclass = buf.params().getLyXTextClass();
-       string const allowed =
-               runparams.flavor == OutputParams::XML? ".-_:":tclass.options();
+       TextClass const & tclass = buf.params().getTextClass();
+       docstring const allowed = from_ascii(
+               runparams.flavor == OutputParams::XML? ".-_:":tclass.options());
 
        if (allowed.empty())
                return orig;
@@ -150,7 +151,7 @@ docstring sgml::cleanID(Buffer const & buf, OutputParams const & runparams,
 
        bool mangle = false;
        for (; it != end; ++it) {
-               char c = *it;
+               char_type c = *it;
                if (isAlphaASCII(c) || isDigitASCII(c) || c == '-' || c == '.'
                      || allowed.find(c) < allowed.size())
                        content += c;
@@ -181,7 +182,7 @@ docstring sgml::cleanID(Buffer const & buf, OutputParams const & runparams,
 
 void sgml::openTag(odocstream & os, string const & name, string const & attribute)
 {
-        // FIXME UNICODE
+       // FIXME UNICODE
        // This should be fixed in layout files later.
        string param = subst(attribute, "<", "\"");
        param = subst(param, ">", "\"");
@@ -205,10 +206,10 @@ void sgml::closeTag(odocstream & os, string const & name)
 void sgml::openTag(Buffer const & buf, odocstream & os,
        OutputParams const & runparams, Paragraph const & par)
 {
-       Layout_ptr const & style = par.layout();
+       LayoutPtr const & style = par.layout();
        string const & name = style->latexname();
        string param = style->latexparam();
-       Counters & counters = buf.params().getLyXTextClass().counters();
+       Counters & counters = buf.params().getTextClass().counters();
 
        string id = par.getID(buf, runparams);
 
@@ -240,7 +241,7 @@ void sgml::openTag(Buffer const & buf, odocstream & os,
 
 void sgml::closeTag(odocstream & os, Paragraph const & par)
 {
-       Layout_ptr const & style = par.layout();
+       LayoutPtr const & style = par.layout();
        closeTag(os, style->latexname());
 }