X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Fmathed%2FMacroTable.cpp;h=d23855c511f5bd3fadd26661f81fc2d0b97a9abf;hb=02e82157ec583c3900e359de86be79fac6512387;hp=2d29f520e99657d65261c8645d477dd0dc313823;hpb=24d011117fb9646e5817b0e703aef781715a6352;p=lyx.git diff --git a/src/mathed/MacroTable.cpp b/src/mathed/MacroTable.cpp index 2d29f520e9..d23855c511 100644 --- a/src/mathed/MacroTable.cpp +++ b/src/mathed/MacroTable.cpp @@ -68,11 +68,10 @@ bool MacroData::expand(vector const & args, MathData & to) const updateData(); // Hack. Any inset with a cell would do. - static InsetMathSqrt inset(0); - inset.setBuffer(const_cast(*buffer_)); + InsetMathSqrt inset(const_cast(buffer_)); docstring const & definition(display_.empty() ? definition_ : display_); - asArray(definition, inset.cell(0)); + asArray(definition, inset.cell(0), Parse::QUIET); //lyxerr << "MathData::expand: args: " << args << endl; //LYXERR0("MathData::expand: ar: " << inset.cell(0)); for (DocIterator it = doc_iterator_begin(buffer_, &inset); it; it.forwardChar()) { @@ -201,7 +200,8 @@ int MacroData::write(odocstream & os, bool overwriteRedefinition) const // output template MathMacroTemplate const & tmpl = static_cast(*inset); - WriteStream wi(os, false, true, WriteStream::wsDefault); + otexrowstream ots(os); + WriteStream wi(ots, false, true, WriteStream::wsDefault); return tmpl.write(wi, overwriteRedefinition); } @@ -244,7 +244,8 @@ MacroTable::iterator MacroTable::insert(Buffer * buf, docstring const & def) { //lyxerr << "MacroTable::insert, def: " << to_utf8(def) << endl; - MathMacroTemplate mac(buf, def); + MathMacroTemplate mac(buf); + mac.fromString(def); MacroData data(buf, mac); return insert(mac.name(), data); }