#include "TexRow.h"
#include "TextMetrics.h"
-namespace lyx {
-//using support::odocstream;
+namespace lyx {
-using std::auto_ptr;
using std::endl;
}
-InsetMathMBox::InsetMathMBox(Layout_ptr const & layout)
+InsetMathMBox::InsetMathMBox(LayoutPtr const & layout)
{
text_.paragraphs().clear();
text_.paragraphs().push_back(Paragraph());
}
-auto_ptr<Inset> InsetMathMBox::doClone() const
+Inset * InsetMathMBox::clone() const
{
- return auto_ptr<Inset>(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);
}
}
-LyXText * InsetMathMBox::getText(int) const
+Text * InsetMathMBox::getText(int) const
{
return &text_;
}
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);
}