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)
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)
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;
}
}
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