Small simple stuff.
-- Those who desire to give up Freedom in order to gain Security, will not have, nor do they deserve, either one. (T. Jefferson or B. Franklin or both...)
Index: cursor.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/cursor.C,v retrieving revision 1.50 diff -u -p -r1.50 cursor.C --- cursor.C 6 Feb 2004 09:34:02 -0000 1.50 +++ cursor.C 6 Feb 2004 11:46:13 -0000 @@ -215,7 +215,6 @@ int LCursor::currentMode() LyXText * LCursor::innerText() const { BOOST_ASSERT(!cursor_.empty()); - //lyxerr << "LCursor::innerText() depth: " << cursor_.size() << endl; if (cursor_.size() > 1) { // go up until first non-0 text is hit // (innermost text is 0 in mathed) @@ -230,7 +229,6 @@ LyXText * LCursor::innerText() const CursorSlice const & LCursor::innerTextSlice() const { BOOST_ASSERT(!cursor_.empty()); - //lyxerr << "LCursor::innerTextSlice() depth: " << cursor_.size() << endl; if (cursor_.size() > 1) { // go up until first non-0 text is hit // (innermost text is 0 in mathed) @@ -254,21 +252,14 @@ void LCursor::updatePos() void LCursor::getDim(int & asc, int & des) const { BOOST_ASSERT(!cursor_.empty()); - LyXText * text = innerText(); -#warning crashes with text-in-math - if (0 && text) { - RowList::iterator const rit = text->cursorRow(); - if (rit != text->endRow()) { - asc = rit->baseline(); - des = rit->height() - asc; - } else { - asc = 10; - des = 10; - } - } else { + if (inMathed()) { + //inset()->asMathInset()->getCursorDim(asc, des); asc = 10; des = 10; - //innerInset()->getCursorDim(asc, des); + } else { + Row const & row = *text()->cursorRow(); + asc = row.baseline(); + des = row.height() - asc; } } Index: rowpainter.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/rowpainter.C,v retrieving revision 1.115 diff -u -p -r1.115 rowpainter.C --- rowpainter.C 6 Feb 2004 11:12:48 -0000 1.115 +++ rowpainter.C 6 Feb 2004 11:46:13 -0000 @@ -136,8 +136,7 @@ RowPainter::RowPainter(BufferView const paintBackground(); // paint the selection background -#warning look here for selection - if (bv_.cursor().selection() && &text_ == bv_.cursor().innerText()) + if (bv_.cursor().selection() && &text_ == bv_.cursor().text()) paintSelection(); // vertical lines for appendix