80 lines bite the dust...
-- Those who desire to give up Freedom in order to gain Security, will not have, nor do they deserve, either one. (T. Jefferson or B. Franklin or both...)
? 1.diff ? fullredraw.diff ? insets/1.diff Index: BufferView_pimpl.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/BufferView_pimpl.C,v retrieving revision 1.404 diff -u -p -r1.404 BufferView_pimpl.C --- BufferView_pimpl.C 1 Aug 2003 14:51:08 -0000 1.404 +++ BufferView_pimpl.C 1 Aug 2003 15:09:29 -0000 @@ -650,7 +650,6 @@ void BufferView::Pimpl::update() { lyxerr << "BufferView::update()\n"; screen().redraw(*bv_); - bv_->text->clearPaint(); } Index: lyxtext.h =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/lyxtext.h,v retrieving revision 1.203 diff -u -p -r1.203 lyxtext.h --- lyxtext.h 1 Aug 2003 11:22:10 -0000 1.203 +++ lyxtext.h 1 Aug 2003 15:09:29 -0000 @@ -167,12 +167,6 @@ public: /// compute text metrics void metrics(MetricsInfo & mi, Dimension & dim); - /// clear any pending paints - void clearPaint(); - - /// submit repaint request - void postPaint(); - /// InsetOld::RESULT dispatch(FuncRequest const & cmd); @@ -181,16 +175,6 @@ public: BufferView * bv() const; friend class LyXScreen; - - /** - * Return the status. This represents what repaints are - * pending after some operation (e.g. inserting a char). - */ - bool needRefresh() const; - -private: - // do we need a refresh? - bool need_refresh_; public: /// only the top-level LyXText has this non-zero Index: text.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/text.C,v retrieving revision 1.403 diff -u -p -r1.403 text.C --- text.C 1 Aug 2003 14:12:03 -0000 1.403 +++ text.C 1 Aug 2003 15:09:29 -0000 @@ -126,7 +126,6 @@ void LyXText::top_y(int newy) anchor_row_offset_ = newy - y; lyxerr[Debug::GUI] << "changing reference to row: " << &*anchor_row_ << " offset: " << anchor_row_offset_ << endl; - postPaint(); } @@ -1542,8 +1541,6 @@ void LyXText::breakParagraph(ParagraphLi cursorLeft(bv()); } - postPaint(); - removeParagraph(cursorRow()); // set the dimensions of the cursor row @@ -1732,8 +1729,6 @@ void LyXText::insertChar(char c) setHeightOfRow(boost::prior(row)); - postPaint(); - breakAgainOneRow(row); current_font = rawtmpfont; @@ -1760,7 +1755,6 @@ void LyXText::insertChar(char c) } if (c == Paragraph::META_INSET || row->fill() < 0) { - postPaint(); breakAgainOneRow(row); RowList::iterator next_row = boost::next(row); @@ -1788,7 +1782,6 @@ void LyXText::insertChar(char c) } else { // FIXME: similar code is duplicated all over - make resetHeightOfRow setHeightOfRow(row); - postPaint(); current_font = rawtmpfont; real_current_font = realtmpfont; @@ -2266,9 +2259,6 @@ void LyXText::changeCase(LyXText::TextCa ++pos; } - - if (getRow(to) != getRow(from)) - postPaint(); } @@ -2350,10 +2340,7 @@ void LyXText::backspace() cursorLeft(bv()); // the layout things can change the height of a row ! - int const tmpheight = cursorRow()->height(); setHeightOfRow(cursorRow()); - if (cursorRow()->height() != tmpheight) - postPaint(); return; } } @@ -2407,8 +2394,6 @@ void LyXText::backspace() if (cursor.pos()) cursor.pos(cursor.pos() - 1); - postPaint(); - // remove the lost paragraph // This one is not safe, since the paragraph that the tmprow and the // following rows belong to has been deleted by the PasteParagraph @@ -2531,7 +2516,6 @@ void LyXText::backspace() y -= tmprow->height(); tmprow->fill(fill(tmprow, workWidth())); setHeightOfRow(tmprow); - postPaint(); setCursor(cursor.par(), cursor.pos(), false, cursor.boundary()); @@ -2559,8 +2543,6 @@ void LyXText::backspace() if (lastPos(*this, row) == row->par()->size() - 1) removeRow(boost::next(row)); - postPaint(); - breakAgainOneRow(row); // will the cursor be in another row now? if (boost::next(row) != rows().end() && @@ -2575,7 +2557,6 @@ void LyXText::backspace() // set the dimensions of the row row->fill(fill(row, workWidth())); setHeightOfRow(row); - postPaint(); setCursor(cursor.par(), cursor.pos(), false, cursor.boundary()); } } Index: text2.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/text2.C,v retrieving revision 1.412 diff -u -p -r1.412 text2.C --- text2.C 1 Aug 2003 14:51:09 -0000 1.412 +++ text2.C 1 Aug 2003 15:09:29 -0000 @@ -65,7 +65,6 @@ LyXText::LyXText(BufferView * bv) inset_owner(0), the_locking_inset(0), bv_owner(bv) { anchor_row_ = rows().end(); - need_refresh_ = true; } @@ -74,7 +73,6 @@ LyXText::LyXText(BufferView * bv, InsetT inset_owner(inset), the_locking_inset(0), bv_owner(bv) { anchor_row_ = rows().end(); - need_refresh_ = true; } @@ -84,7 +82,6 @@ void LyXText::init(BufferView * bview) rowlist_.clear(); width = height = 0; - need_refresh_ = true; anchor_row_ = rows().end(); anchor_row_offset_ = 0; @@ -608,8 +605,6 @@ void LyXText::redoHeightOfParagraph() setHeightOfRow(tmprow); } - postPaint(); - setCursor(cursor.par(), cursor.pos(), false, cursor.boundary()); } @@ -958,7 +953,6 @@ void LyXText::setParagraph(bool line_top params.noindent(noindent); tmppit = boost::prior(pit); } - postPaint(); redoParagraphs(selection.start.par(), endpit); @@ -1468,7 +1462,6 @@ void LyXText::insertStringAsParagraphs(s void LyXText::checkParagraph(ParagraphList::iterator pit, pos_type pos) { breakAgain(getRow(pit, pos)); - postPaint(); setCursorIntern(cursor.par(), cursor.pos(), false, cursor.boundary()); } @@ -2126,7 +2119,6 @@ bool LyXText::deleteEmptyParagraphMechan if (getRow(old_cursor) != rows().begin()) { RowList::iterator prevrow = boost::prior(getRow(old_cursor)); - postPaint(); tmpcursor = cursor; cursor = old_cursor; // that undo can restore the right cursor position #warning FIXME. --end() iterator is usable here @@ -2157,7 +2149,6 @@ bool LyXText::deleteEmptyParagraphMechan setHeightOfRow(prevrow); } else { RowList::iterator nextrow = boost::next(getRow(old_cursor)); - postPaint(); tmpcursor = cursor; cursor = old_cursor; // that undo can restore the right cursor position @@ -2212,29 +2203,6 @@ ParagraphList & LyXText::ownerParagraphs return inset_owner->paragraphs; } return bv_owner->buffer()->paragraphs; -} - - -bool LyXText::needRefresh() const -{ - return need_refresh_; -} - - -void LyXText::clearPaint() -{ - need_refresh_ = false; -} - - -void LyXText::postPaint() -{ - need_refresh_ = true; - - // We are an inset's lyxtext. Tell the top-level lyxtext - // it needs to update the row we're in. - if (inset_owner) - bv()->text->postPaint(); } Index: text3.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/text3.C,v retrieving revision 1.99 diff -u -p -r1.99 text3.C --- text3.C 31 Jul 2003 10:24:21 -0000 1.99 +++ text3.C 1 Aug 2003 15:09:29 -0000 @@ -74,11 +74,7 @@ namespace { else bv->repaint(); } - if (!lt->isInInset()) { - bv->update(lt, BufferView::SELECT); - } else if (bv->text->needRefresh()) { - bv->update(BufferView::SELECT); - } + bv->update(); if (!lt->selection.set()) bv->haveSelection(false); @@ -434,7 +430,6 @@ InsetOld::RESULT LyXText::dispatch(FuncR // we can set the refreshing parameters now updateCounters(); redoHeightOfParagraph(); - postPaint(); setCursor(cursor.par(), cursor.pos()); update(); break; Index: undo_funcs.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/undo_funcs.C,v retrieving revision 1.77 diff -u -p -r1.77 undo_funcs.C --- undo_funcs.C 25 Jul 2003 19:18:40 -0000 1.77 +++ undo_funcs.C 1 Aug 2003 15:09:29 -0000 @@ -156,10 +156,6 @@ bool performUndoOrRedo(BufferView * bv, } finishUndo(); - - // And repaint the lot - bv->text->postPaint(); - return true; } @@ -177,7 +173,6 @@ bool textUndoOrRedo(BufferView * bv, freezeUndo(); bv->unlockInset(bv->theLockingInset()); finishUndo(); - bv->text->postPaint(); unFreezeUndo(); return false; } Index: insets/insettext.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insettext.C,v retrieving revision 1.462 diff -u -p -r1.462 insettext.C --- insets/insettext.C 1 Aug 2003 12:52:59 -0000 1.462 +++ insets/insettext.C 1 Aug 2003 15:09:30 -0000 @@ -363,8 +363,6 @@ void InsetText::draw(PainterInfo & pi, i paintRows(*bv, text_, rit, x, 0, yo, y2, yo); - text_.clearPaint(); - if (drawFrame_ == ALWAYS || (drawFrame_ == LOCKED && locked)) drawFrame(pain, int(start_x)); @@ -388,10 +386,6 @@ void InsetText::drawFrame(Painter & pain void InsetText::setUpdateStatus(int what) const { need_update |= what; - // we will to redraw us full if our LyXText wants it - if (text_.needRefresh()) - need_update |= FULL; - // this to not draw a selection when we redraw all of it! if (need_update & CURSOR && !(need_update & SELECTION)) { if (text_.selection.set()) @@ -412,17 +406,15 @@ void InsetText::updateLocal(BufferView * text_.partialRebreak(); setUpdateStatus(what); bool flag = mark_dirty || - ((need_update != CURSOR && need_update != NONE) || - text_.needRefresh() || text_.selection.set()); + (need_update != CURSOR && need_update != NONE) || + text_.selection.set(); if (!text_.selection.set()) text_.selection.cursor = text_.cursor; bv->fitCursor(); - if (flag) { - text_.postPaint(); + if (flag) bv->updateInset(const_cast<InsetText *>(this)); - } if (need_update == CURSOR) need_update = NONE;