X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Fmathed%2FMathStream.cpp;h=cf3fb51f1f0ba484be79ef9dc7567570b20c3afd;hb=cdc847fd304019a19425a0d5d9d42a556a937097;hp=78838ccd0ab25bb151e9441c4dbb42b87efb9faf;hpb=52dd5dc84f3a9f836903aeaca49f27e45cda6dce;p=lyx.git diff --git a/src/mathed/MathStream.cpp b/src/mathed/MathStream.cpp index 78838ccd0a..cf3fb51f1f 100644 --- a/src/mathed/MathStream.cpp +++ b/src/mathed/MathStream.cpp @@ -12,9 +12,12 @@ #include "MathStream.h" +#include "MathFactory.h" #include "MathData.h" #include "MathExtern.h" +#include "TexRow.h" + #include "support/docstring.h" #include "support/RefChanger.h" #include "support/textutils.h" @@ -125,9 +128,10 @@ WriteStream & operator<<(WriteStream & ws, docstring const & s) WriteStream::WriteStream(otexrowstream & os, bool fragile, bool latex, OutputType output, Encoding const * encoding) : 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_(TexRow::row_none) + output_(output), insidemacro_(false), pendingspace_(false), + pendingbrace_(false), textmode_(false), locked_(0), ascii_(0), + canbreakline_(true), mathsout_(false), ulemcmd_(NONE), line_(0), + encoding_(encoding), row_entry_(TexRow::row_none) {} @@ -694,4 +698,25 @@ OctaveStream & operator<<(OctaveStream & os, string const & s) } +docstring convertDelimToXMLEscape(docstring const & name) +{ + if (name.size() == 1) { + char_type const c = name[0]; + if (c == '<') + return from_ascii("<"); + else if (c == '>') + return from_ascii(">"); + else + return name; + } + MathWordList const & words = mathedWordList(); + MathWordList::const_iterator it = words.find(name); + if (it != words.end()) { + docstring const escape = it->second.xmlname; + return escape; + } + LYXERR0("Unable to find `" << name <<"' in the mathWordList."); + return name; +} + } // namespace lyx