From cf15bd840b71a01ccbb2fbbbabc7066237b4bfd2 Mon Sep 17 00:00:00 2001 From: Stefan Schimanski Date: Tue, 4 Mar 2008 14:57:46 +0000 Subject: [PATCH] * cosmetic git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23451 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/mathed/MathMacro.cpp | 48 ++++++++++++++++++++-------------------- src/mathed/MathMacro.h | 2 +- 2 files changed, 25 insertions(+), 25 deletions(-) diff --git a/src/mathed/MathMacro.cpp b/src/mathed/MathMacro.cpp index 37c393e010..784c725de3 100644 --- a/src/mathed/MathMacro.cpp +++ b/src/mathed/MathMacro.cpp @@ -283,7 +283,7 @@ void MathMacro::updateMacro(MacroContext const & mc) } -void MathMacro::updateRepresentation(Cursor const * bvCur) +void MathMacro::updateRepresentation() { // known macro? if (macro_ == 0) @@ -297,30 +297,30 @@ void MathMacro::updateRepresentation(Cursor const * bvCur) return; // macro changed? - if (needsUpdate_) { - needsUpdate_ = false; - - // get default values of macro - vector const & defaults = macro_->defaults(); - - // create MathMacroArgumentValue objects pointing to the cells of the macro - vector values(nargs()); - for (size_t i = 0; i < nargs(); ++i) { - ArgumentProxy * proxy; - if (i < defaults.size()) - proxy = new ArgumentProxy(*this, i, defaults[i]); - else - proxy = new ArgumentProxy(*this, i); - values[i].insert(0, MathAtom(proxy)); - } - - // expanding macro with the values - macro_->expand(values, expanded_.cell(0)); - - // get definition for list edit mode - docstring const & display = macro_->display(); - asArray(display.empty() ? macro_->definition() : display, definition_); + if (!needsUpdate_) + return; + + needsUpdate_ = false; + + // get default values of macro + vector const & defaults = macro_->defaults(); + + // create MathMacroArgumentValue objects pointing to the cells of the macro + vector values(nargs()); + for (size_t i = 0; i < nargs(); ++i) { + ArgumentProxy * proxy; + if (i < defaults.size()) + proxy = new ArgumentProxy(*this, i, defaults[i]); + else + proxy = new ArgumentProxy(*this, i); + values[i].insert(0, MathAtom(proxy)); } + + // expanding macro with the values + macro_->expand(values, expanded_.cell(0)); + // get definition for list edit mode + docstring const & display = macro_->display(); + asArray(display.empty() ? macro_->definition() : display, definition_); } diff --git a/src/mathed/MathMacro.h b/src/mathed/MathMacro.h index f78aee1ba7..c09c1dd531 100644 --- a/src/mathed/MathMacro.h +++ b/src/mathed/MathMacro.h @@ -133,7 +133,7 @@ protected: /// update macro definition void updateMacro(MacroContext const & mc); /// check if macro definition changed, argument changed etc. and adapt - void updateRepresentation(Cursor const * bvCur); + void updateRepresentation(); /// empty macro, put arguments into args, possibly strip arity-attachedArgsNum_ empty ones. /// Includes the optional arguments. void detachArguments(std::vector & args, bool strip); -- 2.39.2