]> git.lyx.org Git - lyx.git/blobdiff - src/Layout.cpp
Attempt to fix #8137 (arrived at r40862).
[lyx.git] / src / Layout.cpp
index 6485a451cd57b8295b0fb4a8d7e751242b2110f0..ec6e2dc5a5dfe760f5c931acea611e93f1635ddf 100644 (file)
@@ -13,6 +13,7 @@
 #include <config.h>
 
 #include "Layout.h"
+#include "Encoding.h"
 #include "FontInfo.h"
 #include "Language.h"
 #include "Lexer.h"
@@ -23,7 +24,6 @@
 #include "support/lassert.h"
 #include "support/lstrings.h"
 #include "support/Messages.h"
-#include "support/regex.h"
 #include "support/textutils.h"
 
 
@@ -858,50 +858,6 @@ void Layout::readSpacing(Lexer & lex)
 }
 
 
-namespace {
-
-docstring const i18npreamble(Language const * lang, 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
-       // 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));
-               preamble = subst(preamble, sub.str(), translated);
-       }
-#endif
-       return from_utf8(preamble);
-}
-
-}
-
-
-docstring const Layout::langpreamble(Language const * lang, bool const polyglossia) const
-{
-       return i18npreamble(lang, langpreamble_, polyglossia);
-}
-
-
-docstring const Layout::babelpreamble(Language const * lang, bool const polyglossia) const
-{
-       return i18npreamble(lang, babelpreamble_, polyglossia);
-}
-
-
 string const & Layout::htmltag() const 
 { 
        if (htmltag_.empty())