X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Fmathed%2FMathMacro.cpp;h=b955cd659ec1117f549dbf84694b0e160debda2d;hb=e0d54dd3b497b78094ea16ab0f38ccdc8c1642e2;hp=bf9afad0ea23eda1c9f1951f11b05b846ec18eec;hpb=00e305c9d9bd8b0ff54b6c58adb6192d5934ed60;p=lyx.git diff --git a/src/mathed/MathMacro.cpp b/src/mathed/MathMacro.cpp index bf9afad0ea..b955cd659e 100644 --- a/src/mathed/MathMacro.cpp +++ b/src/mathed/MathMacro.cpp @@ -17,7 +17,7 @@ #include "MathStream.h" #include "Buffer.h" -#include "LCursor.h" +#include "Cursor.h" #include "debug.h" #include "BufferView.h" #include "LaTeXFeatures.h" @@ -38,7 +38,7 @@ using std::vector; class MathMacroArgumentValue : public InsetMathDim { public: /// - MathMacroArgumentValue(MathArray const * value, docstring const & macroName) + MathMacroArgumentValue(MathData const * value, docstring const & macroName) : value_(value), macroName_(macroName) {} /// bool metrics(MetricsInfo & mi, Dimension & dim) const; @@ -46,15 +46,15 @@ public: void draw(PainterInfo &, int x, int y) const; private: - std::auto_ptr doClone() const; - MathArray const * value_; + std::auto_ptr doClone() const; + MathData const * value_; docstring macroName_; }; -auto_ptr MathMacroArgumentValue::doClone() const +auto_ptr MathMacroArgumentValue::doClone() const { - return auto_ptr(new MathMacroArgumentValue(*this)); + return auto_ptr(new MathMacroArgumentValue(*this)); } @@ -86,9 +86,9 @@ MathMacro::MathMacro(docstring const & name, int numargs) {} -auto_ptr MathMacro::doClone() const +auto_ptr MathMacro::doClone() const { - return auto_ptr(new MathMacro(*this)); + return auto_ptr(new MathMacro(*this)); } @@ -115,11 +115,11 @@ bool MathMacro::metrics(MetricsInfo & mi, Dimension & dim) const MacroData const & macro = MacroTable::globalMacros().get(name()); if (macro.locked()) { mathed_string_dim(mi.base.font, "Self reference: " + name(), dim); - expanded_ = MathArray(); + expanded_ = MathData(); } else if (editing(mi.base.bv)) { // FIXME UNICODE asArray(macro.def(), tmpl_); - LyXFont font = mi.base.font; + Font font = mi.base.font; augmentFont(font, from_ascii("lyxtex")); tmpl_.metrics(mi, dim); // FIXME UNICODE @@ -127,7 +127,7 @@ bool MathMacro::metrics(MetricsInfo & mi, Dimension & dim) const // FIXME UNICODE int ww = mathed_string_width(font, from_ascii("#1: ")); for (idx_type i = 0; i < nargs(); ++i) { - MathArray const & c = cell(i); + MathData const & c = cell(i); c.metrics(mi); dim.wid = max(dim.wid, c.width() + ww); dim.des += c.height() + 10; @@ -135,7 +135,7 @@ bool MathMacro::metrics(MetricsInfo & mi, Dimension & dim) const } else { // create MathMacroArgumentValue object pointing to the cells of the macro MacroData const & macro = MacroTable::globalMacros().get(name()); - vector values(nargs()); + vector values(nargs()); for (size_t i = 0; i != nargs(); ++i) values[i].insert(0, MathAtom(new MathMacroArgumentValue(&cells_[i], name()))); macro.expand(values, expanded_); @@ -164,7 +164,7 @@ void MathMacro::draw(PainterInfo & pi, int x, int y) const // FIXME UNICODE drawStrRed(pi, x, y, "Self reference: " + name()); } else if (editing(pi.base.bv)) { - LyXFont font = pi.base.font; + Font font = pi.base.font; augmentFont(font, from_ascii("lyxtex")); int h = y - dim_.ascent() + 2 + tmpl_.ascent(); pi.pain.text(x + 3, h, name(), font); @@ -175,7 +175,7 @@ void MathMacro::draw(PainterInfo & pi, int x, int y) const docstring t = from_ascii("#1: "); mathed_string_dim(font, t, ldim); for (idx_type i = 0; i < nargs(); ++i) { - MathArray const & c = cell(i); + MathData const & c = cell(i); h += max(c.ascent(), ldim.asc) + 5; c.draw(pi, x + ldim.wid, h); char_type str[] = { '#', '1', ':', '\0' }; @@ -208,7 +208,7 @@ void MathMacro::validate(LaTeXFeatures & features) const } -InsetBase * MathMacro::editXY(LCursor & cur, int x, int y) +Inset * MathMacro::editXY(Cursor & cur, int x, int y) { // We may have 0 arguments, but InsetMathNest requires at least one. if (nargs() > 0) { @@ -226,21 +226,21 @@ InsetBase * MathMacro::editXY(LCursor & cur, int x, int y) } -bool MathMacro::idxFirst(LCursor & cur) const +bool MathMacro::idxFirst(Cursor & cur) const { cur.updateFlags(Update::Force); return InsetMathNest::idxFirst(cur); } -bool MathMacro::idxLast(LCursor & cur) const +bool MathMacro::idxLast(Cursor & cur) const { cur.updateFlags(Update::Force); return InsetMathNest::idxLast(cur); } -bool MathMacro::notifyCursorLeaves(LCursor & cur) +bool MathMacro::notifyCursorLeaves(Cursor & cur) { cur.updateFlags(Update::Force); return InsetMathNest::notifyCursorLeaves(cur);