]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/formula.C
more IU
[lyx.git] / src / mathed / formula.C
index 63cffade24a91543e4c2fa98288dd58cc22aa496..c80334a0567a390cb38ac229fac79a01571103b2 100644 (file)
@@ -174,13 +174,6 @@ void InsetFormula::read(Buffer const &, LyXLex & lex)
 }
 
 
-//ostream & operator<<(ostream & os, LyXCursor const & c)
-//{
-//     os << '[' << c.x() << ' ' << c.y() << ' ' << c.pos() << ']';
-//     return os;
-//}
-
-
 namespace {
 
 bool editing_inset(InsetFormula const * inset)
@@ -195,10 +188,13 @@ bool editing_inset(InsetFormula const * inset)
 
 void InsetFormula::draw(PainterInfo & pi, int x, int y) const
 {
+       xo_ = x;
+       yo_ = y;
+
        // The previews are drawn only when we're not editing the inset.
-       bool const use_preview = (!editing_inset(this) &&
-                                 RenderPreview::activated() &&
-                                 preview_->previewReady());
+       bool const use_preview = !editing_inset(this)
+               && RenderPreview::activated()
+               && preview_->previewReady();
 
        int const w = dim_.wid;
        int const d = dim_.des;
@@ -224,9 +220,6 @@ void InsetFormula::draw(PainterInfo & pi, int x, int y) const
 
                par_->draw(p, x, y);
        }
-
-       xo_ = x;
-       yo_ = y;
 }
 
 
@@ -260,9 +253,9 @@ bool InsetFormula::insetAllowed(InsetOld::Code code) const
 
 void InsetFormula::metrics(MetricsInfo & m, Dimension & dim) const
 {
-       bool const use_preview = (!editing_inset(this) &&
-                                 RenderPreview::activated() &&
-                                 preview_->previewReady());
+       bool const use_preview = !editing_inset(this)
+               && RenderPreview::activated()
+               && preview_->previewReady();
 
        if (use_preview) {
                preview_->metrics(m, dim);
@@ -303,10 +296,10 @@ namespace {
 
 string const latex_string(InsetFormula const & inset, Buffer const &)
 {
-       ostringstream ls;
-       WriteStream wi(ls, false, false);
+       ostringstream os;
+       WriteStream wi(os, false, false);
        inset.par()->write(wi);
-       return ls.str();
+       return os.str();
 }
 
 } // namespace anon