]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/math_funcinset.C
further code uglification to make Jean-Marc's compiler happy
[lyx.git] / src / mathed / math_funcinset.C
index a75ba7360cc7efe63629e5f3039766d9340e08d2..9932510580690f8b7c20a19e9c358265c50c3986 100644 (file)
@@ -14,11 +14,9 @@ using std::ostream;
 extern LyXFont WhichFont(short type, int size);
 
 
-MathFuncInset::MathFuncInset(string const & nm, MathInsetTypes ot)
-       : MathInset(0, nm, ot)
-{
-       lims_ = (GetType() == LM_OT_FUNCLIM);
-}
+MathFuncInset::MathFuncInset(string const & nm)
+       : name_(nm)
+{}
 
 
 MathInset * MathFuncInset::clone() const
@@ -27,34 +25,40 @@ MathInset * MathFuncInset::clone() const
 }
 
 
-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(std::ostream & os, bool /* fragile */) const
 {
        os << "\\" << name_ << ' ';
 }
 
 
-void MathFuncInset::WriteNormal(std::ostream & os) const
+void MathFuncInset::writeNormal(std::ostream & os) const
 {
        os << "[" << name_ << "] ";
 }
 
 
-void MathFuncInset::Metrics(MathStyles st, int, int) 
+void MathFuncInset::metrics(MathStyles 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_, 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_, x, y, name_);
 }