fix bug 4301:

BufferView::moveToPosition(..) failed for every position inside an inset because buffer_->text() was used instead of cursor_.text() to set the current font.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/branches/BRANCH_1_5_X@21442 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Bernhard Roider 2007-11-05 16:40:14 +00:00
parent 508f44d8be
commit 5275a25cf4

View File

@ -546,7 +546,7 @@ boost::tuple<pit_type, pos_type, int> BufferView::moveToPosition(pit_type bottom
break;
}
setCursor(dit);
buffer_->text().setCurrentFont(cursor_);
cursor_.text()->setCurrentFont(cursor_);
// Note: return bottom (document) level pit.
return boost::make_tuple(cursor_.bottom().pit(), cursor_.bottom().pos(), top_id);
}
@ -562,7 +562,7 @@ boost::tuple<pit_type, pos_type, int> BufferView::moveToPosition(pit_type bottom
it.pit() = bottom_pit;
it.pos() = min(bottom_pos, it.paragraph().size());
setCursor(it);
buffer_->text().setCurrentFont(cursor_);
cursor_.text()->setCurrentFont(cursor_);
return boost::make_tuple(it.pit(), it.pos(),
it.paragraph().id());
}