]> git.lyx.org Git - features.git/commitdiff
* mathed/CMakeLists.txt: do not exclude InsetMathMBox.C
authorAbdelrazak Younes <younes@lyx.org>
Thu, 22 Feb 2007 21:17:34 +0000 (21:17 +0000)
committerAbdelrazak Younes <younes@lyx.org>
Thu, 22 Feb 2007 21:17:34 +0000 (21:17 +0000)
* InsetMathMBox.C: Make it compile.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17307 a592a061-630c-0410-9148-cb99ea01b6c8

development/cmake/src/mathed/CMakeLists.txt
src/mathed/InsetMathMBox.C

index 65ec0432950fde0e9f2786ce6cfd9af3ad9b7ec3..7c00bd2e449be57d60f8fba28f82a8177c5d0990 100644 (file)
@@ -11,7 +11,6 @@ file(GLOB mathed_headers ${TOP_SRC_DIR}/src/mathed/*.h)
 
 list(REMOVE_ITEM mathed_sources
        ${TOP_SRC_DIR}/src/mathed/InsetMathXYArrow.C
-       ${TOP_SRC_DIR}/src/mathed/InsetMathMBox.C
        ${TOP_SRC_DIR}/src/mathed/InsetFormulaMacro.C)
 
 lyx_add_msvc_pch(mathed)
index 9f705290108e66d75e62d637379f6376c3c71fd9..13fdc76bad87688c0ad690739344bbfe10a0ac05 100644 (file)
@@ -12,6 +12,7 @@
 
 #include "InsetMathMBox.h"
 #include "MathData.h"
+#include "MathStream.h"
 
 #include "BufferView.h"
 #include "buffer.h"
 #include "outputparams.h"
 #include "paragraph.h"
 #include "texrow.h"
-
+#include "TextMetrics.h"
 
 namespace lyx {
 
-using odocstream;
+//using support::odocstream;
 
 using std::auto_ptr;
 using std::endl;
 
 
 InsetMathMBox::InsetMathMBox(BufferView & bv)
-       : text_(&bv), bv_(&bv)
+       : text_(), bv_(&bv)
 {
        text_.paragraphs().clear();
        text_.paragraphs().push_back(Paragraph());
        text_.paragraphs().back().
                layout(bv.buffer()->params().getLyXTextClass().defaultLayout());
-       text_.redoParagraph(0);
 }
 
 
@@ -52,7 +52,8 @@ auto_ptr<InsetBase> InsetMathMBox::doClone() const
 
 bool InsetMathMBox::metrics(MetricsInfo & mi, Dimension & dim) const
 {
-       text_.metrics(mi, dim);
+       TextMetrics & tm = mi.base.bv->textMetrics(&text_);
+       tm.metrics(mi, dim);
        metricsMarkers2(dim);
        if (dim_ == dim)
                return false;
@@ -114,8 +115,8 @@ LyXText * InsetMathMBox::getText(int) const
 void InsetMathMBox::cursorPos(BufferView const & bv,
                CursorSlice const & sl, bool boundary, int & x, int & y) const
 {
-       x = text_.cursorX(sl, boundary);
-       y = text_.cursorY(sl, boundary);
+       x = text_.cursorX(bv, sl, boundary);
+       y = text_.cursorY(bv, sl, boundary);
 }