using std::endl;
-InsetMathMBox::InsetMathMBox(BufferView & bv)
- : text_(), bv_(&bv)
+InsetMathMBox::InsetMathMBox(LyXLayout_ptr const & layout)
{
text_.paragraphs().clear();
text_.paragraphs().push_back(Paragraph());
- text_.paragraphs().back().
- layout(bv.buffer()->params().getLyXTextClass().defaultLayout());
+ text_.paragraphs().back().layout(layout);
}
}
-void InsetMathMBox::write(WriteStream & ws) const
+void InsetMathMBox::write(Buffer const & buf, WriteStream & ws) const
{
if (ws.latex()) {
ws << "\\mbox{\n";
TexRow texrow;
OutputParams runparams;
- latexParagraphs(*bv_->buffer(), text_.paragraphs(),
- ws.os(), texrow, runparams);
+ latexParagraphs(buf, text_.paragraphs(), ws.os(), texrow, runparams);
ws.addlines(texrow.rows());
ws << "}";
} else {
ws << "\\mbox{\n";
std::ostringstream os;
- text_.write(*bv_->buffer(), os);
+ text_.write(buf, os);
ws.os() << from_utf8(os.str());
ws << "}";
}
namespace lyx {
+class Buffer;
+class BufferView;
// almost a substitute for the real text inset...
class InsetMathMBox : public InsetMathDim {
public:
///
- explicit InsetMathMBox(BufferView & bv);
+ explicit InsetMathMBox(LyXLayout_ptr const & layout);
/// this stores metrics information in cache_
bool metrics(MetricsInfo & mi, Dimension & dim) const;
/// draw according to cached metrics
bool isActive() const { return true; }
///
- void write(WriteStream & os) const;
+ void write(Buffer const & buf, WriteStream & os) const;
///
int latex(Buffer const &, odocstream & os,
OutputParams const & runparams) const;
///
mutable LyXText text_;
- ///
- BufferView * const bv_;
+
private:
virtual std::auto_ptr<InsetBase> doClone() const;
};