]> git.lyx.org Git - lyx.git/blobdiff - src/sgml.C
Add margin to paragraph dialog.
[lyx.git] / src / sgml.C
index 990ad6e81ca1eb3185614d7138bbdcd3105c6884..e5fb7fc2aff1b67eef6b8fe4eba43bd17a78f664 100644 (file)
@@ -24,6 +24,7 @@
 #include "support/lstrings.h"
 #include "support/std_ostream.h"
 #include "support/convert.h"
+#include "support/textutils.h"
 
 #include <map>
 #include <sstream>
@@ -144,13 +145,14 @@ docstring sgml::cleanID(Buffer const & buf, OutputParams const & runparams,
                return (*known).second;
 
        // make sure it starts with a letter
-       if (!isalpha(*it) && allowed.find(*it) >= allowed.size())
+       if (!isAlphaASCII(*it) && allowed.find(*it) >= allowed.size())
                content += "x";
 
        bool mangle = false;
        for (; it != end; ++it) {
                char c = *it;
-               if (isalpha(c) || isdigit(c) || c == '-' || c == '.' || allowed.find(c) < allowed.size())
+               if (isAlphaASCII(c) || isDigitASCII(c) || c == '-' || c == '.'
+                     || allowed.find(c) < allowed.size())
                        content += c;
                else if (c == '_' || c == ' ') {
                        mangle = true;
@@ -167,7 +169,7 @@ docstring sgml::cleanID(Buffer const & buf, OutputParams const & runparams,
        if (mangle) {
                content += "-" + convert<docstring>(mangleID++);
        }
-       else if (isdigit(content[content.size() - 1])) {
+       else if (isDigitASCII(content[content.size() - 1])) {
                content += ".";
        }
 
@@ -185,9 +187,9 @@ void sgml::openTag(odocstream & os, string const & name, string const & attribut
        param = subst(param, ">", "\"");
 
        if (!name.empty() && name != "!-- --") {
-                os << '<' << from_ascii(name);
+               os << '<' << from_ascii(name);
                if (!param.empty())
-                    os << ' ' << from_ascii(param);
+                       os << ' ' << from_ascii(param);
                os << '>';
        }
 }
@@ -195,13 +197,13 @@ void sgml::openTag(odocstream & os, string const & name, string const & attribut
 
 void sgml::closeTag(odocstream & os, string const & name)
 {
-        // FIXME UNICODE
        if (!name.empty() && name != "!-- --")
-                os << "</" << from_ascii(name) << '>';
+               os << "</" << from_ascii(name) << '>';
 }
 
 
-void sgml::openTag(Buffer const & buf, odocstream & os, OutputParams const & runparams, Paragraph const & par)
+void sgml::openTag(Buffer const & buf, odocstream & os,
+       OutputParams const & runparams, Paragraph const & par)
 {
        LyXLayout_ptr const & style = par.layout();
        string const & name = style->latexname();