]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/math_scriptinset.C
move things around
[lyx.git] / src / mathed / math_scriptinset.C
index 49b0bb89fec80591e3d40f12e6090a57fdb7df9f..158c2b91c42e838f4ce635f3de9b2b38ab038668 100644 (file)
@@ -4,6 +4,7 @@
 
 #include "math_scriptinset.h"
 #include "support/LOstream.h"
+#include "support.h"
 
 
 MathScriptInset::MathScriptInset()
@@ -211,7 +212,7 @@ void MathScriptInset::writeNormal(std::ostream & os) const
 }
 
 
-void MathScriptInset::metrics(MathStyles st)
+void MathScriptInset::metrics(MathStyles st) const
 {
        size_ = st;
        MathStyles tt = smallerStyleScript(st);
@@ -239,15 +240,15 @@ void MathScriptInset::metrics(MathStyles st)
                dx0_   = (width_ - xcell(0).width()) / 2;
                dx1_   = (width_ - xcell(1).width()) / 2;
        } else {
-               int asc;
-               int des;
+               int asc = 0;
+               int des = 0;
                int wid = 0;
                mathed_char_height(LM_TC_VAR, st, 'I', asc, des);
                if (symbol_) {
                        symbol_->metrics(st);
                        wid  = symbol_->width();
                        asc  = symbol_->ascent();
-                       des = symbol_->descent();
+                       des  = symbol_->descent();
                }
                ascent_  = up()   ? xcell(0).height() + asc : 0;
                descent_ = down() ? xcell(1).height() + des : 0;
@@ -261,7 +262,7 @@ void MathScriptInset::metrics(MathStyles st)
 }
 
 
-void MathScriptInset::draw(Painter & pain, int x, int y)
+void MathScriptInset::draw(Painter & pain, int x, int y) const
 {  
        xo(x);
        yo(y);