X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Fmathed%2FMacroTable.cpp;h=d279bdb84490c0c0efe4214905f117316babb610;hb=ebe6612e2661f49dcfae6103f056c27afd47751f;hp=5f43fa79942d1fc9508fa7c2fbaac7d8cbf13102;hpb=670efa8f646218f2a378f0cc614c4c37a9f6b89a;p=lyx.git diff --git a/src/mathed/MacroTable.cpp b/src/mathed/MacroTable.cpp index 5f43fa7994..d279bdb844 100644 --- a/src/mathed/MacroTable.cpp +++ b/src/mathed/MacroTable.cpp @@ -12,8 +12,8 @@ #include "InsetMathSqrt.h" #include "MacroTable.h" -#include "MathMacroTemplate.h" -#include "MathMacroArgument.h" +#include "InsetMathMacroTemplate.h" +#include "InsetMathMacroArgument.h" #include "MathParser.h" #include "MathStream.h" #include "MathSupport.h" @@ -55,7 +55,7 @@ MacroData::MacroData(Buffer * buf, DocIterator const & pos) } -MacroData::MacroData(Buffer * buf, MathMacroTemplate const & macro) +MacroData::MacroData(Buffer * buf, InsetMathMacroTemplate const & macro) : buffer_(buf), queried_(false), numargs_(0), sym_(0), optionals_(0), lockCount_(0), redefinition_(false), type_(MacroTypeNewcommand) { @@ -71,7 +71,7 @@ bool MacroData::expand(vector const & args, MathData & to) const InsetMathSqrt inset(const_cast(buffer_)); docstring const & definition(display_.empty() ? definition_ : display_); - asArray(definition, inset.cell(0)); + asArray(definition, inset.cell(0), Parse::QUIET | Parse::MACRODEF); //lyxerr << "MathData::expand: args: " << args << endl; //LYXERR0("MathData::expand: ar: " << inset.cell(0)); for (DocIterator it = doc_iterator_begin(buffer_, &inset); it; it.forwardChar()) { @@ -81,7 +81,7 @@ bool MacroData::expand(vector const & args, MathData & to) const continue; //it.cell().erase(it.pos()); //it.cell().insert(it.pos(), it.nextInset()->asInsetMath() - size_t n = static_cast(it.nextInset())->number(); + size_t n = static_cast(it.nextInset())->number(); if (n <= args.size()) { it.cell().erase(it.pos()); it.cell().insert(it.pos(), args[n - 1]); @@ -147,7 +147,7 @@ void MacroData::unlock() const } -void MacroData::queryData(MathMacroTemplate const & macro) const +void MacroData::queryData(InsetMathMacroTemplate const & macro) const { if (queried_) return; @@ -182,7 +182,7 @@ void MacroData::updateData() const } // query the data from the macro template - queryData(static_cast(*inset)); + queryData(static_cast(*inset)); } @@ -198,9 +198,9 @@ int MacroData::write(odocstream & os, bool overwriteRedefinition) const } // output template - MathMacroTemplate const & tmpl = - static_cast(*inset); - otexrowstream ots(os, false); + InsetMathMacroTemplate const & tmpl = + static_cast(*inset); + otexrowstream ots(os); WriteStream wi(ots, false, true, WriteStream::wsDefault); return tmpl.write(wi, overwriteRedefinition); } @@ -244,7 +244,7 @@ MacroTable::iterator MacroTable::insert(Buffer * buf, docstring const & def) { //lyxerr << "MacroTable::insert, def: " << to_utf8(def) << endl; - MathMacroTemplate mac(buf); + InsetMathMacroTemplate mac(buf); mac.fromString(def); MacroData data(buf, mac); return insert(mac.name(), data);