[LyX features/cleanup/updateMacros4] Comments

Richard Kimberly Heck rikiheck at lyx.org
Sun Dec 6 00:27:03 UTC 2020


The branch, cleanup/updateMacros4, has been updated.

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

commit 5fb79e419fd06f8854d1b8bb8bb9761636ac1ab6
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/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/Buffer.cpp                |    2 +-
 src/mathed/InsetMathMacro.cpp |    7 +++----
 2 files changed, 4 insertions(+), 5 deletions(-)


hooks/post-receive
-- 
Repository for new features


More information about the lyx-cvs mailing list