]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/InsetMathMBox.cpp
simplify GuiToc / TocWidget interaction. Much can still be simplified...
[lyx.git] / src / mathed / InsetMathMBox.cpp
index e6df5b41e2795ba31ef5899d4c5121be171f703d..c3c41b194dc14fd8902e71760c57c393515f55e4 100644 (file)
@@ -18,7 +18,7 @@
 #include "Buffer.h"
 #include "BufferParams.h"
 #include "Cursor.h"
-#include "debug.h"
+#include "support/debug.h"
 #include "MetricsInfo.h"
 #include "output_latex.h"
 #include "OutputParams.h"
 #include "TexRow.h"
 #include "TextMetrics.h"
 
+using namespace std;
 
 namespace lyx {
 
-using std::endl;
-
 
 InsetMathMBox::InsetMathMBox()
 {
@@ -53,15 +52,11 @@ Inset * InsetMathMBox::clone() const
 }
 
 
-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;
 }
 
 
@@ -78,12 +73,12 @@ void InsetMathMBox::write(Buffer const & buf, WriteStream & ws) const
                ws << "\\mbox{\n";
                TexRow texrow;
                OutputParams runparams(&buf.params().encoding());
-               latexParagraphs(buf, text_.paragraphs(), ws.os(), texrow, runparams);
+               latexParagraphs(buf, text_, ws.os(), texrow, runparams);
                ws.addlines(texrow.rows());
                ws << "}";
        } else {
                ws << "\\mbox{\n";
-               std::ostringstream os;
+               ostringstream os;
                text_.write(buf, os);
                ws.os() << from_utf8(os.str());
                ws << "}";
@@ -96,7 +91,7 @@ int InsetMathMBox::latex(Buffer const & buf, odocstream & os,
 {
        os << "\\mbox{\n";
        TexRow texrow;
-       latexParagraphs(buf, text_.paragraphs(), os, texrow, runparams);
+       latexParagraphs(buf, text_, os, texrow, runparams);
        os << "}";
        return texrow.rows();
 }