X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Fmathed%2FInsetMathMBox.cpp;h=90b152f9c18d8b8bec4dd1103e3fe4b079fd9b16;hb=12314897982e07afd8926c997f66d7bb08e7e1fd;hp=82cad33a4e320507444921ad09b99cda24fae457;hpb=e0d54dd3b497b78094ea16ab0f38ccdc8c1642e2;p=lyx.git diff --git a/src/mathed/InsetMathMBox.cpp b/src/mathed/InsetMathMBox.cpp index 82cad33a4e..90b152f9c1 100644 --- a/src/mathed/InsetMathMBox.cpp +++ b/src/mathed/InsetMathMBox.cpp @@ -26,11 +26,9 @@ #include "TexRow.h" #include "TextMetrics.h" -namespace lyx { -//using support::odocstream; +namespace lyx { -using std::auto_ptr; using std::endl; @@ -41,7 +39,7 @@ InsetMathMBox::InsetMathMBox() } -InsetMathMBox::InsetMathMBox(Layout_ptr const & layout) +InsetMathMBox::InsetMathMBox(LayoutPtr const & layout) { text_.paragraphs().clear(); text_.paragraphs().push_back(Paragraph()); @@ -49,27 +47,23 @@ InsetMathMBox::InsetMathMBox(Layout_ptr const & layout) } -auto_ptr InsetMathMBox::doClone() const +Inset * InsetMathMBox::clone() const { - return auto_ptr(new InsetMathMBox(*this)); + return new InsetMathMBox(*this); } -bool InsetMathMBox::metrics(MetricsInfo & mi, Dimension & dim) const +void InsetMathMBox::metrics(MetricsInfo & mi, Dimension & dim) const { TextMetrics & tm = mi.base.bv->textMetrics(&text_); tm.metrics(mi, dim); metricsMarkers2(dim); - if (dim_ == dim) - return false; - dim_ = dim; - return true; } void InsetMathMBox::draw(PainterInfo & pi, int x, int y) const { - text_.draw(pi, x + 1, y); + pi.base.bv->textMetrics(&text_).draw(pi, x + 1, y); drawMarkers(pi, x, y); } @@ -119,14 +113,8 @@ Text * InsetMathMBox::getText(int) const void InsetMathMBox::cursorPos(BufferView const & bv, CursorSlice const & sl, bool boundary, int & x, int & y) const { - x = text_.cursorX(bv, sl, boundary); - y = text_.cursorY(bv, sl, boundary); -} - - -void InsetMathMBox::drawSelection(PainterInfo & pi, int x, int y) const -{ - text_.drawSelection(pi, x, y); + x = bv.textMetrics(&text_).cursorX(sl, boundary); + y = bv.textMetrics(&text_).cursorY(sl, boundary); }