+#include <config.h>
#include "math_parboxinset.h"
#include "math_mathmlstream.h"
#include "lyxlength.h"
#include "debug.h"
+using std::auto_ptr;
+using std::endl;
+
MathParboxInset::MathParboxInset()
- : MathNestInset(1), lyx_width_(0), tex_width_("0mm"),
- position_('c')
+ : lyx_width_(0), tex_width_("0mm"), position_('c')
{
- lyxerr << "constructing MathParboxInset\n";
+ lyxerr << "constructing MathParboxInset" << endl;
}
-MathInset * MathParboxInset::clone() const
+auto_ptr<InsetBase> MathParboxInset::clone() const
{
- return new MathParboxInset(*this);
+ return auto_ptr<InsetBase>(new MathParboxInset(*this));
}
{
tex_width_ = w;
lyx_width_ = LyXLength(w).inBP();
- lyxerr << "setting " << w << " to " << lyx_width_ << " pixel\n";
+ lyxerr << "setting " << w << " to " << lyx_width_ << " pixel" << endl;
}
-void MathParboxInset::metrics(MathMetricsInfo & mi) const
+void MathParboxInset::metrics(MetricsInfo & mi, Dimension & dim) const
{
- MathFontSetChanger dummy1(mi.base, "textnormal");
- MathWidthChanger dummy2(mi.base, lyx_width_);
- xcell(0).metrics(mi);
- ascent_ = xcell(0).ascent();
- descent_ = xcell(0).descent() + 1;
- width_ = xcell(0).width() + 2;
+ FontSetChanger dummy1(mi.base, "textnormal");
+ WidthChanger dummy2(mi.base, lyx_width_);
+ MathTextInset::metrics(mi, dim_);
+ metricsMarkers();
+ dim = dim_;
}
-void MathParboxInset::draw(MathPainterInfo & pi, int x, int y) const
+void MathParboxInset::draw(PainterInfo & pi, int x, int y) const
{
- MathFontSetChanger dummy1(pi.base, "textnormal");
- MathWidthChanger dummy2(pi.base, lyx_width_);
- xcell(0).draw(pi, x + 1, y);
+ FontSetChanger dummy(pi.base, "textnormal");
+ MathTextInset::draw(pi, x + 1, y);
drawMarkers(pi, x, y);
}
void MathParboxInset::infoize(std::ostream & os) const
{
- os << "Box: Parbox " << tex_width_ << ' ';
+ os << "Box: Parbox " << tex_width_;
}
-