From cd591a9de213b16b9bcae1fca3c4e17cfcb8e23d Mon Sep 17 00:00:00 2001 From: Richard Kimberly Heck Date: Sat, 5 Dec 2020 19:48:16 -0500 Subject: [PATCH] Comments --- src/Buffer.cpp | 2 +- src/CursorSlice.cpp | 4 +++- src/mathed/InsetMathMacro.cpp | 7 +++---- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/Buffer.cpp b/src/Buffer.cpp index 8ddbe67caf..4cf5758743 100644 --- a/src/Buffer.cpp +++ b/src/Buffer.cpp @@ -3749,7 +3749,7 @@ MacroData const * Buffer::getMacro(docstring const & name, bool global) const MacroData const * Buffer::getMacro(docstring const & name, Buffer const & child, bool global) const { - // look where the child buffer is included first + // find out where the child buffer is first included Impl::BufferPositionMap::iterator it = d->children_positions.find(&child); if (it == d->children_positions.end()) { if (d->file_fully_loaded) diff --git a/src/CursorSlice.cpp b/src/CursorSlice.cpp index 872a91110e..ff56ce17bf 100644 --- a/src/CursorSlice.cpp +++ b/src/CursorSlice.cpp @@ -48,7 +48,9 @@ CursorSlice::CursorSlice(Inset & p) MathData & CursorSlice::cell() const { - return inset_->asInsetMath()->cell(idx_); + InsetMath * im = inset_->asInsetMath(); + LBUFERR(im); + return im->cell(idx_); } diff --git a/src/mathed/InsetMathMacro.cpp b/src/mathed/InsetMathMacro.cpp index ab9af5f5e8..420df09209 100644 --- a/src/mathed/InsetMathMacro.cpp +++ b/src/mathed/InsetMathMacro.cpp @@ -230,10 +230,9 @@ public: size_t optionals_; /// fold mode to be set in next metrics call? bool nextFoldMode_; - /// if macro_ == true, then here is a copy of the macro + /// here is a copy of the macro, for safety purposes /// don't use it for locking MacroData macroBackup_; - /// if macroNotFound_ == false, then here is a reference to the macro /// this might invalidate after metrics was called MacroData const * macro_; /// @@ -703,7 +702,7 @@ void InsetMathMacro::updateRepresentation(Cursor * cur, MacroContext const & mc, // get default values of macro vector const & defaults = d->macro_->defaults(); - // create MathMacroArgumentValue objects pointing to the cells of the macro + // create InsetArgumentProxy objects pointing to the cells of the macro vector values(nargs()); for (size_t i = 0; i < nargs(); ++i) { InsetArgumentProxy * proxy; @@ -721,9 +720,9 @@ void InsetMathMacro::updateRepresentation(Cursor * cur, MacroContext const & mc, // InsetMathMacro objects, so this would be a different recursion path // than the one protected by UpdateLocker. docstring const & display = d->macro_->display(); - docstring const latexname = from_ascii("\\") + macroName(); bool const ret = d->macro_->expand(values, d->expanded_); d->expanded_.setBuffer(buffer()); + docstring const latexname = from_ascii("\\") + macroName(); if (ret && !support::contains(display, latexname)) { if (utype == OutputUpdate && !d->expanded_.empty()) d->expanded_.updateMacroInstances(cur, mc, utype, nesting); -- 2.39.5