]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/MathStream.cpp
Preserve \inputencoding value when switching to non-TeX fonts.
[lyx.git] / src / mathed / MathStream.cpp
index eb567ff19b109db8494f1f01906766a5380a4caf..9a6c32ca219f087a91ad0e2ad1d16c05877cb579 100644 (file)
@@ -130,8 +130,8 @@ WriteStream::WriteStream(otexrowstream & os, bool fragile, bool latex,
        : os_(os), fragile_(fragile), firstitem_(false), latex_(latex),
          output_(output), pendingspace_(false), pendingbrace_(false),
          textmode_(false), locked_(0), ascii_(0), canbreakline_(true),
-         line_(0), encoding_(encoding),
-         row_entry_(make_unique<RowEntry>(TexRow::row_none))
+         mathsout_(false), ulemcmd_(NONE), line_(0), encoding_(encoding),
+         row_entry_(TexRow::row_none)
 {}
 
 
@@ -180,17 +180,17 @@ void WriteStream::asciiOnly(bool ascii)
 }
 
 
-Changer WriteStream::changeRowEntry(RowEntry entry)
+Changer WriteStream::changeRowEntry(TexRow::RowEntry entry)
 {
-       return make_change(*row_entry_, entry);
+       return make_change(row_entry_, entry);
 }
 
 
 bool WriteStream::startOuterRow()
 {
-       if (TexRow::isNone(*row_entry_))
+       if (TexRow::isNone(row_entry_))
                return false;
-       return texrow().start(*row_entry_);
+       return texrow().start(row_entry_);
 }
 
 
@@ -295,7 +295,7 @@ void MathStream::defer(string const & s)
 
 
 docstring MathStream::deferred() const
-{ 
+{
        return deferred_.str();
 }
 
@@ -385,7 +385,7 @@ void HtmlStream::defer(string const & s)
 
 
 docstring HtmlStream::deferred() const
-{ 
+{
        return deferred_.str();
 }
 
@@ -708,6 +708,12 @@ docstring convertDelimToXMLEscape(docstring const & name)
                        return from_ascii("&gt;");
                else
                        return name;
+       } else if (name.size() == 2 && name[0] == '\\') {
+               char_type const c = name[1];
+               if (c == '{')
+                       return from_ascii("&#123;");
+               else if (c == '}')
+                       return from_ascii("&#125;");
        }
        MathWordList const & words = mathedWordList();
        MathWordList::const_iterator it = words.find(name);