* cosmetic

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23451 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Stefan Schimanski 2008-03-04 14:57:46 +00:00
parent 8aac28367e
commit cf15bd840b
2 changed files with 25 additions and 25 deletions

View File

@ -283,7 +283,7 @@ void MathMacro::updateMacro(MacroContext const & mc)
} }
void MathMacro::updateRepresentation(Cursor const * bvCur) void MathMacro::updateRepresentation()
{ {
// known macro? // known macro?
if (macro_ == 0) if (macro_ == 0)
@ -297,30 +297,30 @@ void MathMacro::updateRepresentation(Cursor const * bvCur)
return; return;
// macro changed? // macro changed?
if (needsUpdate_) { if (!needsUpdate_)
needsUpdate_ = false; return;
// get default values of macro needsUpdate_ = false;
vector<docstring> const & defaults = macro_->defaults();
// create MathMacroArgumentValue objects pointing to the cells of the macro // get default values of macro
vector<MathData> values(nargs()); vector<docstring> const & defaults = macro_->defaults();
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 // create MathMacroArgumentValue objects pointing to the cells of the macro
macro_->expand(values, expanded_.cell(0)); vector<MathData> values(nargs());
for (size_t i = 0; i < nargs(); ++i) {
// get definition for list edit mode ArgumentProxy * proxy;
docstring const & display = macro_->display(); if (i < defaults.size())
asArray(display.empty() ? macro_->definition() : display, definition_); 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_);
} }

View File

@ -133,7 +133,7 @@ protected:
/// update macro definition /// update macro definition
void updateMacro(MacroContext const & mc); void updateMacro(MacroContext const & mc);
/// check if macro definition changed, argument changed etc. and adapt /// 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. /// empty macro, put arguments into args, possibly strip arity-attachedArgsNum_ empty ones.
/// Includes the optional arguments. /// Includes the optional arguments.
void detachArguments(std::vector<MathData> & args, bool strip); void detachArguments(std::vector<MathData> & args, bool strip);