From b610c13f67cc112f12ccdd5a793a1ed633c09e43 Mon Sep 17 00:00:00 2001 From: Enrico Forestieri Date: Sat, 20 Jun 2015 03:05:50 +0200 Subject: [PATCH] Amend 98a5072a We only look once for the definition of the same macro, but we have to always check its arguments when the same macro appears more than once in a math inset. So, move earlier this check. --- src/mathed/InsetMathHull.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/mathed/InsetMathHull.cpp b/src/mathed/InsetMathHull.cpp index 0cfaad0dc0..e1e339dacb 100644 --- a/src/mathed/InsetMathHull.cpp +++ b/src/mathed/InsetMathHull.cpp @@ -640,6 +640,9 @@ void InsetMathHull::usedMacros(MathData const & md, DocIterator const & pos, InsetMathGrid const * gi = md[i].nucleus()->asGridInset(); InsetMathNest const * ni = md[i].nucleus()->asNestInset(); if (mi) { + // Look for macros in the arguments of this macro. + for (idx_type idx = 0; idx < mi->nargs(); ++idx) + usedMacros(mi->cell(idx), pos, macros, defs); // Make sure this is a macro defined in the document // (as we also spot the macros in the symbols file) // or that we have not already accounted for it. @@ -647,9 +650,6 @@ void InsetMathHull::usedMacros(MathData const & md, DocIterator const & pos, if (macros.find(name) == end) continue; macros.erase(name); - // Look for macros in the arguments of this macro. - for (idx_type idx = 0; idx < mi->nargs(); ++idx) - usedMacros(mi->cell(idx), pos, macros, defs); // Look for macros in the definition of this macro. MathData ar(pos.buffer()); MacroData const * data = -- 2.39.2