]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/InsetMathMBox.cpp
Change the interface to a paragraph's layout. We still store a LayoutPtr, but now...
[lyx.git] / src / mathed / InsetMathMBox.cpp
index 39e500540cd18a42bc252d15d923ff2c2f620156..8facb40d68d65ee852e3eb31e69063d67d44e1a3 100644 (file)
@@ -18,7 +18,6 @@
 #include "Buffer.h"
 #include "BufferParams.h"
 #include "Cursor.h"
-#include "support/debug.h"
 #include "MetricsInfo.h"
 #include "output_latex.h"
 #include "OutputParams.h"
@@ -26,6 +25,8 @@
 #include "TexRow.h"
 #include "TextMetrics.h"
 
+#include "support/debug.h"
+
 using namespace std;
 
 namespace lyx {
@@ -38,11 +39,11 @@ InsetMathMBox::InsetMathMBox()
 }
 
 
-InsetMathMBox::InsetMathMBox(LayoutPtr const & layout)
+InsetMathMBox::InsetMathMBox(Layout const & layout)
 {
        text_.paragraphs().clear();
        text_.paragraphs().push_back(Paragraph());
-       text_.paragraphs().back().layout(layout);
+       text_.paragraphs().back().setLayout(layout);
 }
 
 
@@ -67,31 +68,30 @@ void InsetMathMBox::draw(PainterInfo & pi, int x, int y) const
 }
 
 
-void InsetMathMBox::write(Buffer const & buf, WriteStream & ws) const
+void InsetMathMBox::write(WriteStream & ws) const
 {
        if (ws.latex()) {
                ws << "\\mbox{\n";
                TexRow texrow;
-               OutputParams runparams(&buf.params().encoding());
-               latexParagraphs(buf, text_.paragraphs(), ws.os(), texrow, runparams);
+               OutputParams runparams(&buffer().params().encoding());
+               latexParagraphs(buffer(), text_, ws.os(), texrow, runparams);
                ws.addlines(texrow.rows());
                ws << "}";
        } else {
                ws << "\\mbox{\n";
                ostringstream os;
-               text_.write(buf, os);
+               text_.write(buffer(), os);
                ws.os() << from_utf8(os.str());
                ws << "}";
        }
 }
 
 
-int InsetMathMBox::latex(Buffer const & buf, odocstream & os,
-                       OutputParams const & runparams) const
+int InsetMathMBox::latex(odocstream & os, OutputParams const & runparams) const
 {
        os << "\\mbox{\n";
        TexRow texrow;
-       latexParagraphs(buf, text_, os, texrow, runparams);
+       latexParagraphs(buffer(), text_, os, texrow, runparams);
        os << "}";
        return texrow.rows();
 }