]> git.lyx.org Git - features.git/commitdiff
fix two warnings
authorAndré Pönitz <poenitz@gmx.net>
Fri, 6 Feb 2004 11:50:13 +0000 (11:50 +0000)
committerAndré Pönitz <poenitz@gmx.net>
Fri, 6 Feb 2004 11:50:13 +0000 (11:50 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@8408 a592a061-630c-0410-9148-cb99ea01b6c8

src/cursor.C
src/rowpainter.C

index 2151f6be1273414ecd244ad02f5f2d836d5d6f7e..c5bbcc5429ca61e63b5a845ab01bfcafde4c52bd 100644 (file)
@@ -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 fcdd02f95a3df8b80c2433f559eaad6e13363585..60b51df1edc744321717d742da3266e7e98e6cb9 100644 (file)
@@ -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