}
-MathMacro::MathMacro(MathMacro const & m)
- : MathParInset(LM_ST_TEXT, m.GetName(), LM_OT_MACRO),
- tmplate_(m.tmplate_), idx_(0)
-{
- nargs_ = tmplate_->getNoArgs();
- tcode_ = tmplate_->getTCode();
- SetName(tmplate_->GetName());
-
- std::vector<MacroArgumentBase>::const_iterator cit = m.args_.begin();
- std::vector<MacroArgumentBase>::const_iterator end = m.args_.end();
-
- //args_.resize(nargs_);
- //for (int i = 0; i < tmplate_->getNoArgs(); ++i) {
- // args_[i].row = m->args_[i].row;
- // args_[i].array = m->args_[i].array;
- //}
- for (; cit != end; ++cit) {
- args_.push_back(*cit);
- }
-}
-
-
MathedInset * MathMacro::Clone()
{
return new MathMacro(*this);
*/
class MathMacro : public MathParInset {
public:
- /// A macro can only be builded from an existing template
+ /// A macro can only be built from an existing template
explicit
MathMacro(boost::shared_ptr<MathMacroTemplate> const &);
- /// or from another macro.
- explicit
- MathMacro(MathMacro const &);
///
void draw(Painter &, int, int);
///
void draw(Painter &, int x, int baseline);
///
void Write(std::ostream &, bool fragile);
- ///
- void setNumber(int n);
/// Is expanded or not
void setExpand(bool e);
/// Is expanded or not
{
if (nargs_ > 0) {
tcode_ = LM_TC_ACTIVE_INSET;
- args_.resize(nargs_);
for (int i = 0; i < nargs_; ++i) {
- args_[i].setNumber(i + 1);
+ args_.push_back(MathMacroArgument(i + 1));
}
} else {
tcode_ = LM_TC_INSET;