]> git.lyx.org Git - lyx.git/blobdiff - src/Layout.cpp
Leftover.
[lyx.git] / src / Layout.cpp
index 6861b5b2b24a1f8c17ac9fad8f429f3a6928a1dc..97594b706e0991c594450251e2ae58be061db2b5 100644 (file)
@@ -24,7 +24,6 @@
 #include "support/lassert.h"
 #include "support/lstrings.h"
 #include "support/Messages.h"
-#include "support/regex.h"
 #include "support/textutils.h"
 
 
@@ -859,63 +858,6 @@ void Layout::readSpacing(Lexer & lex)
 }
 
 
-namespace {
-
-docstring const i18npreamble(Language const * lang, Encoding const & enc,
-                            docstring const & templ, bool const polyglossia)
-{
-       if (templ.empty())
-               return templ;
-
-       string preamble = polyglossia ?
-               subst(to_utf8(templ), "$$lang", lang->polyglossia()) :
-               subst(to_utf8(templ), "$$lang", lang->babel());
-
-#ifdef TEX2LYX
-       // tex2lyx does not have getMessages()
-       LASSERT(false, /**/);
-#else
-       string const langenc = lang->encoding()->iconvName();
-       string const texenc = lang->encoding()->latexName();
-       string const bufenc = enc.iconvName();
-       // First and second character of plane 15 (Private Use Area)
-       char const s1[5] = {0xf3, 0xb0, 0x80, 0x80, 0x00}; // U+F0000
-       char const s2[5] = {0xf3, 0xb0, 0x80, 0x81, 0x00}; // U+F0001
-       // FIXME UNICODE
-       // lyx::regex is not unicode-safe.
-       // Should use QRegExp or (boost::u32regex, but that requires ICU)
-       static regex const reg("_\\(([^\\)]+)\\)");
-       smatch sub;
-       while (regex_search(preamble, sub, reg)) {
-               string const key = sub.str(1);
-               string translated = to_utf8(lang->translateLayout(key));
-               if (langenc != bufenc)
-                       translated = "\\inputencoding{" + texenc + "}"
-                               + string(s1) + langenc + string(s2) + translated
-                               + string(s1) + bufenc + string(s2);
-               preamble = subst(preamble, sub.str(), translated);
-       }
-#endif
-       return from_utf8(preamble);
-}
-
-}
-
-
-docstring const Layout::langpreamble(Language const * lang,
-                       Encoding const & enc, bool const polyglossia) const
-{
-       return i18npreamble(lang, enc, langpreamble_, polyglossia);
-}
-
-
-docstring const Layout::babelpreamble(Language const * lang,
-                       Encoding const & enc, bool const polyglossia) const
-{
-       return i18npreamble(lang, enc, babelpreamble_, polyglossia);
-}
-
-
 string const & Layout::htmltag() const 
 { 
        if (htmltag_.empty())
@@ -969,7 +911,8 @@ string const & Layout::htmllabelattr() const
 }
 
 
-docstring Layout::htmlstyle() const {
+docstring Layout::htmlstyle() const
+{
        if (!htmlstyle_.empty() && !htmlforcecss_)
                return htmlstyle_;
        if (htmldefaultstyle_.empty()) 
@@ -997,7 +940,7 @@ string Layout::defaultCSSClass() const
                                d = from_ascii("lyx_");
                        else
                                d += '_';
-               } else if (islower(c))
+               } else if (isLower(c))
                        d += c;
                else
                        // this is slow, so do it only if necessary
@@ -1009,15 +952,19 @@ string Layout::defaultCSSClass() const
 
 
 namespace {
-       string makeMarginValue(char const * side, double d) {
-               ostringstream os;
-               os << "margin-" << side << ": " << d << "ex;\n";
-               return os.str();
-       }
+
+string makeMarginValue(char const * side, double d)
+{
+       ostringstream os;
+       os << "margin-" << side << ": " << d << "ex;\n";
+       return os.str();
+}
+
 }
 
 
-void Layout::makeDefaultCSS() const {
+void Layout::makeDefaultCSS() const
+{
        // this never needs to be redone, since reloading layouts will
        // wipe out what we did before.
        if (!htmldefaultstyle_.empty())