From: André Pönitz Date: Fri, 6 Feb 2004 11:50:13 +0000 (+0000) Subject: fix two warnings X-Git-Tag: 1.6.10~15524 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=38512e841254676b5c51bae3c2238be0425be0ed;p=features.git fix two warnings git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@8408 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/cursor.C b/src/cursor.C index 2151f6be12..c5bbcc5429 100644 --- a/src/cursor.C +++ b/src/cursor.C @@ -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; } } diff --git a/src/rowpainter.C b/src/rowpainter.C index fcdd02f95a..60b51df1ed 100644 --- a/src/rowpainter.C +++ b/src/rowpainter.C @@ -136,8 +136,7 @@ RowPainter::RowPainter(BufferView const & bv, LyXText const & text, 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