MathFuncInset::MathFuncInset(string const & nm)
- : MathInset(nm)
+ : name_(nm)
{}
}
-void MathFuncInset::write(std::ostream & os, bool /* fragile */) const
+string const & MathFuncInset::name() const
+{
+ return name_;
+}
+
+
+void MathFuncInset::setName(string const & n)
+{
+ name_ = n;
+}
+
+
+void MathFuncInset::write(MathWriteInfo & os) const
{
os << "\\" << name_ << ' ';
}
}
-void MathFuncInset::metrics(MathStyles st)
+void MathFuncInset::metrics(MathMetricsInfo const & st) const
{
size_ = st;
- if (name_.empty())
- mathed_char_dim(LM_TC_TEXTRM, size_, 'I', ascent_, descent_, width_);
- else
- mathed_string_dim(LM_TC_TEXTRM, size_, name_, ascent_, descent_, width_);
+ mathed_string_dim(LM_TC_TEX, size_.size, name_, ascent_, descent_, width_);
}
-void MathFuncInset::draw(Painter & pain, int x, int y)
+void MathFuncInset::draw(Painter & pain, int x, int y) const
{
xo(x);
yo(y);
- if (name_.empty())
- drawChar(pain, LM_TC_TEXTRM, size_, x, y, ' ');
- else
- drawStr(pain, LM_TC_TEXTRM, size_, x, y, name_);
+ drawStr(pain, LM_TC_TEX, size_.size, x, y, name_);
}