X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Ftext3.C;h=a468a7289665a3590980354f8cc5dc346177fa62;hb=eead5ba43d0ddf06544ad1b40063981d3788c635;hp=9907cfe9fa623e5761129fb60bb2aad6ad161e93;hpb=2e57f2ff0ae7cd4a6efbf634ffe6d2f4379d9cfc;p=lyx.git diff --git a/src/text3.C b/src/text3.C index 9907cfe9fa..a468a72896 100644 --- a/src/text3.C +++ b/src/text3.C @@ -29,6 +29,7 @@ #include "language.h" #include "support/tostr.h" #include "support/lstrings.h" +#include "support/LAssert.h" #include "frontends/LyXView.h" #include "frontends/screen.h" #include "frontends/Dialogs.h" @@ -71,7 +72,7 @@ namespace { if (lt->isInInset()) bv->updateInset(lt->inset_owner); else - bv->toggleToggle(); + bv->repaint(); } if (!lt->isInInset()) { bv->update(lt, BufferView::SELECT); @@ -96,7 +97,7 @@ namespace { // check if the given co-ordinates are inside an inset at the // given cursor, if one exists. If so, the inset is returned, // and the co-ordinates are made relative. Otherwise, 0 is returned. - InsetOld * checkInset(BufferView * bv, LyXText & text, +InsetOld * checkInset(BufferView * /*bv*/, LyXText & text, LyXCursor const & cur, int & x, int & y) { lyx::pos_type const pos = cur.pos(); @@ -113,7 +114,7 @@ namespace { // get inset dimensions Assert(par->getInset(pos)); - LyXFont const & font = text.getFont(bv->buffer(), par, pos); + LyXFont const & font = text.getFont(par, pos); int const width = inset->width(); int const inset_x = font.isVisibleRightToLeft() @@ -248,11 +249,8 @@ void LyXText::cursorPrevious() int y = top_y(); if (cursorRow() == rows().begin()) { - if (y > 0) { - int new_y = bv()->text->top_y() - bv()->workHeight(); - bv()->screen().draw(bv()->text, bv(), new_y < 0 ? 0 : new_y); + if (y > 0) bv()->updateScrollbar(); - } return; } @@ -269,9 +267,6 @@ void LyXText::cursorPrevious() return; // This is what we used to do, so we wouldn't skip right past // tall rows, but it's not working right now. -#if 0 - new_y = bv->text->top_y() - bv->workHeight(); -#endif } else { if (inset_owner) { new_y = bv()->text->cursor.iy() @@ -285,7 +280,7 @@ void LyXText::cursorPrevious() - bv()->workHeight() + 1; } } - bv()->screen().draw(bv()->text, bv(), new_y < 0 ? 0 : new_y); + //bv()->screen().draw(bv()->text, bv(), new_y < 0 ? 0 : new_y); if (cursorRow() != rows().begin()) { LyXCursor cur; setCursor(cur, boost::prior(cursorRow())->par(), @@ -306,7 +301,7 @@ void LyXText::cursorNext() int y = cursor.y() - cursorRow()->baseline() + cursorRow()->height(); if (y > topy + bv()->workHeight()) { - bv()->screen().draw(bv()->text, bv(), bv()->text->top_y() + bv()->workHeight()); + //bv()->screen().draw(bv()->text, bv(), bv()->text->top_y() + bv()->workHeight()); bv()->updateScrollbar(); } return; @@ -346,7 +341,7 @@ void LyXText::cursorNext() new_y = cursor.y() - cursorRow()->baseline(); } } - bv()->screen().draw(bv()->text, bv(), new_y); + //bv()->screen().draw(bv()->text, bv(), new_y); RowList::iterator next_row = boost::next(cursorRow()); if (next_row != rows().end()) { @@ -689,10 +684,6 @@ InsetOld::RESULT LyXText::dispatch(FuncRequest const & cmd) bv->update(this, BufferView::UPDATE); cursorPrevious(); finishChange(bv, false); - // was: - // finishUndo(); - // moveCursorUpdate(bv, false, false); - // owner_->view_state_changed(); break; case LFUN_NEXT: @@ -1295,8 +1286,7 @@ InsetOld::RESULT LyXText::dispatch(FuncRequest const & cmd) if (bv->theLockingInset()) { InsetOld * tli = bv->theLockingInset(); LyXCursor cursor = bv->text->cursor; - LyXFont font = bv->text->getFont(bv->buffer(), - cursor.par(), cursor.pos()); + LyXFont font = bv->text->getFont(cursor.par(), cursor.pos()); int width = tli->width(); int inset_x = font.isVisibleRightToLeft() ? cursor.ix() - width : cursor.ix(); @@ -1340,7 +1330,7 @@ InsetOld::RESULT LyXText::dispatch(FuncRequest const & cmd) if (!bv->text->selection.set()) bv->update(BufferView::UPDATE); bv->text->setSelection(); - bv->screen().toggleToggle(bv->text, bv); + bv->repaint(); bv->fitCursor(); break; }