From 37603745aad361e94f89d0b41a098ed606a15d9a Mon Sep 17 00:00:00 2001 From: =?utf8?q?Lars=20Gullik=20Bj=C3=B8nnes?= Date: Mon, 5 Mar 2001 10:52:39 +0000 Subject: [PATCH] mathed40.diff git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@1665 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/mathed/ChangeLog | 7 +++++++ src/mathed/math_macro.C | 4 ++-- src/mathed/math_macrotemplate.C | 15 +++++++-------- src/mathed/math_macrotemplate.h | 5 ++--- 4 files changed, 18 insertions(+), 13 deletions(-) diff --git a/src/mathed/ChangeLog b/src/mathed/ChangeLog index 4c961f4edb..3e90e0f060 100644 --- a/src/mathed/ChangeLog +++ b/src/mathed/ChangeLog @@ -1,3 +1,10 @@ + +2001-02-14 André Pönitz + * math_macrotemplate.[Ch]: + math_macro.C: move update() functionality to the macro + + * math_rowst.h: split MathedRowSt into "data" and "list" + 2001-03-01 Lars Gullik Bjønnes * math_macrotemplate.C (update): use MathMacro::getArg, and diff --git a/src/mathed/math_macro.C b/src/mathed/math_macro.C index 0243be197a..d22a422106 100644 --- a/src/mathed/math_macro.C +++ b/src/mathed/math_macro.C @@ -74,8 +74,8 @@ MathedInset * MathMacro::Clone() void MathMacro::Metrics() { - if (args_.size() > 0) - tmplate_->update(*this); + for (int i = 0; i < args_.size(); ++i) + tmplate_->args_[i] = getArg(i); tmplate_->SetStyle(size()); tmplate_->Metrics(); width = tmplate_->Width(); diff --git a/src/mathed/math_macrotemplate.C b/src/mathed/math_macrotemplate.C index c75df81ad8..5276a16813 100644 --- a/src/mathed/math_macrotemplate.C +++ b/src/mathed/math_macrotemplate.C @@ -116,14 +116,6 @@ void MathMacroTemplate::Metrics() } -void MathMacroTemplate::update(MathMacro const & macro) -{ - for (int i = 0; i < nargs_; ++i) { - args_[i] = macro.getArg(i); - } -} - - void MathMacroTemplate::WriteDef(ostream & os, bool fragile) { os << "\n\\newcommand{\\" << name << "}"; @@ -159,6 +151,13 @@ MathParInset * MathMacroTemplate::getMacroPar(int i) const return 0; } +void MathMacroTemplate::setMacroPar(int i, MathedArray const & ar) +{ + if (i >= 0 && i < nargs_) + args_[i].setData(ar); +} + + void MathMacroTemplate::SetMacroFocus(int &idx, int x, int y) { diff --git a/src/mathed/math_macrotemplate.h b/src/mathed/math_macrotemplate.h index bca4647d1a..9edcf4fb1c 100644 --- a/src/mathed/math_macrotemplate.h +++ b/src/mathed/math_macrotemplate.h @@ -43,12 +43,11 @@ public: /// MathParInset * getMacroPar(int) const; /// + void setMacroPar(int, MathedArray const &); + /// void SetMacroFocus(int &, int, int); /// void setEditMode(bool); - - /// Replace the appropriate arguments with a specific macro's data - void update(MathMacro const & m); private: /// Are we in edit mode or not? bool edit_; -- 2.39.5