]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/math_inset.C
small stuff
[lyx.git] / src / mathed / math_inset.C
index 8d58533d40a47b2ecd5691de6c39263c50911720..9bc23390677907a362a73df3f06b728794f56084 100644 (file)
 int MathInset::workwidth;
 
 
-MathInset::MathInset(string const & name)
-       : name_(name), width_(0), ascent_(0), descent_(0),
-               size_(LM_ST_DISPLAY), code_(LM_TC_MIN), xo_(0), yo_(0)
+MathInset::MathInset()
+       : size_(LM_ST_DISPLAY), xo_(0), yo_(0)
 {}
 
 
-int MathInset::ascent() const
-{
-       return ascent_;
-}
-
-
-int MathInset::descent() const
-{
-       return descent_;
-}
-
-
-int MathInset::width() const
-{
-       return width_;
-}
-
-
 int MathInset::height() const
 {
-       return ascent_ + descent_;
-}
-
-
-string const & MathInset::name() const
-{
-       return name_;
-}
-
-
-void MathInset::setName(string const & n)
-{
-       name_ = n;
+       return ascent() + descent();
 }
 
 
@@ -74,7 +43,7 @@ MathStyles MathInset::size() const
 }
 
 
-void MathInset::size(MathStyles s)
+void MathInset::size(MathStyles s) const
 {
        size_ = s;
 }
@@ -99,13 +68,13 @@ int MathInset::yo() const
 }
 
 
-void MathInset::xo(int x)
+void MathInset::xo(int x) const
 {
        xo_ = x;
 }
 
 
-void MathInset::yo(int y)
+void MathInset::yo(int y) const
 {
        yo_ = y;
 }
@@ -267,7 +236,7 @@ void MathInset::userSetSize(MathStyles sz)
 
 void MathInset::writeNormal(std::ostream & os) const
 {
-       os << "[" << name_ << "] ";
+       os << "[unknown] ";
 }
 
 
@@ -285,7 +254,7 @@ void MathInset::push_back(unsigned char, MathTextCodes)
 }
 
 
-void MathInset::push_back(MathInset * p)
+void MathInset::push_back(MathInset *)
 {
        lyxerr << "can't push without a cell\n";
 }
@@ -295,9 +264,9 @@ bool MathInset::covers(int x, int y) const
 {
        return
                x >= xo_ &&
-               x <= xo_ + width_ &&
-               y >= yo_ - ascent_ &&
-               y <= yo_ + descent_;
+               x <= xo_ + width() &&
+               y >= yo_ - ascent() &&
+               y <= yo_ + descent();
 }
 
 
@@ -314,13 +283,20 @@ std::vector<int> MathInset::idxBetween(int from, int to) const
 }
 
 
-MathTextCodes MathInset::code() const
+void MathInset::metrics(MathStyles st) const
+{
+       lyxerr << "MathInset::metrics() called directly!\n";
+       size_ = st;
+}
+
+
+void MathInset::draw(Painter &, int, int) const
 {
-       return code_;
+       lyxerr << "MathInset::draw() called directly!\n";
 }
 
 
-void MathInset::code(MathTextCodes t)
+void MathInset::write(std::ostream &, bool) const
 {
-       code_ = t;
+       lyxerr << "MathInset::write() called directly!\n";
 }