[LyX features/cleanup/updateMacros4] Comments

Richard Kimberly Heck rikiheck at lyx.org
Sun Dec 6 00:43:24 UTC 2020


The branch, cleanup/updateMacros4, has been updated.
  discards  5fb79e419fd06f8854d1b8bb8bb9761636ac1ab6 (commit)

This update added new revisions after undoing existing revisions.  That is
to say, the old revision is not a strict subset of the new revision.  This
situation occurs when you --force push a change and generate a repository
containing something like this:

 * -- * -- B -- O -- O -- O (5fb79e419fd06f8854d1b8bb8bb9761636ac1ab6)
            \
             N -- N -- N (cd591a9de213b16b9bcae1fca3c4e17cfcb8e23d)

When this happens we assume that you've already had alert emails for all
of the O revisions, and so we here report only the revisions in the N
branch from the common base, B.

- Log -----------------------------------------------------------------

commit cd591a9de213b16b9bcae1fca3c4e17cfcb8e23d
Author: Richard Kimberly Heck <rikiheck at lyx.org>
Date:   Sat Dec 5 19:48:16 2020 -0500

    Comments

diff --git a/src/Buffer.cpp b/src/Buffer.cpp
index 8ddbe67..4cf5758 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 872a911..ff56ce1 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 ab9af5f..420df09 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<docstring> 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<MathData> 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);

-----------------------------------------------------------------------

Summary of changes:
 src/CursorSlice.cpp |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)


hooks/post-receive
-- 
Repository for new features


More information about the lyx-cvs mailing list