This includes the move of fitCursor(). Couldn't reproduce any problems on a quick test.
Note I've added BufferView::update(UpdateCodes). This is really part of the transition of totally cleaning up the stuff so we don't have call sequences like : text -> bv->update(text) -> text->stuff(bv) which is just odd. It won't exist in its current form forever. Next on the agenda are the removal of BufferView::SELECT (need to grok the temporary selection cursor stuff a little more first), then finally, the promised changes to direct calling of update() etc. If nobody complains loudly, I'll commit this tomorrow. regards, john Index: BufferView.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/BufferView.C,v retrieving revision 1.127 diff -u -p -r1.127 BufferView.C --- BufferView.C 17 Mar 2003 16:24:47 -0000 1.127 +++ BufferView.C 19 Mar 2003 00:34:37 -0000 @@ -197,6 +197,12 @@ void BufferView::update(LyXText * text, } +void BufferView::update(UpdateCodes f) +{ + pimpl_->update(f); +} + + void BufferView::switchKeyMap() { pimpl_->switchKeyMap(); @@ -554,7 +560,7 @@ bool BufferView::gotoLabel(string const beforeChange(text); text->setCursor(it.getPar(), it.getPos()); text->selection.cursor = text->cursor; - update(text, BufferView::SELECT|BufferView::FITCUR); + update(text, BufferView::SELECT); return true; } } @@ -570,11 +576,11 @@ void BufferView::undo() owner()->message(_("Undo")); hideCursor(); beforeChange(text); - update(text, BufferView::SELECT|BufferView::FITCUR); + update(text, BufferView::SELECT); if (!textUndo(this)) owner()->message(_("No further undo information")); else - update(text, BufferView::SELECT|BufferView::FITCUR|BufferView::CHANGE); + update(text, BufferView::SELECT); switchKeyMap(); } @@ -587,11 +593,11 @@ void BufferView::redo() owner()->message(_("Redo")); hideCursor(); beforeChange(text); - update(text, BufferView::SELECT|BufferView::FITCUR); + update(text, BufferView::SELECT); if (!textRedo(this)) owner()->message(_("No further redo information")); else - update(text, BufferView::SELECT|BufferView::FITCUR|BufferView::CHANGE); + update(text, BufferView::SELECT); switchKeyMap(); } @@ -610,7 +616,7 @@ void BufferView::pasteEnvironment() if (available()) { text->pasteEnvironmentType(); owner()->message(_("Paragraph environment type set")); - update(text, BufferView::SELECT|BufferView::FITCUR|BufferView::CHANGE); + update(text, BufferView::SELECT); } } @@ -638,7 +644,7 @@ void BufferView::selectLastWord() text->selection.cursor = cur; text->selectSelectedWord(); toggleSelection(false); - update(text, BufferView::SELECT|BufferView::FITCUR); + update(text, BufferView::SELECT); } @@ -650,7 +656,7 @@ void BufferView::endOfSpellCheck() beforeChange(text); text->selectSelectedWord(); text->clearSelection(); - update(text, BufferView::SELECT|BufferView::FITCUR); + update(text, BufferView::SELECT); } @@ -661,11 +667,11 @@ void BufferView::replaceWord(string cons LyXText * tt = getLyXText(); hideCursor(); - update(tt, BufferView::SELECT|BufferView::FITCUR); + update(tt, BufferView::SELECT); // clear the selection (if there is any) toggleSelection(false); - update(tt, BufferView::SELECT|BufferView::FITCUR); + update(tt, BufferView::SELECT); // clear the selection (if there is any) toggleSelection(false); @@ -677,7 +683,11 @@ void BufferView::replaceWord(string cons for (string::size_type i = 0; i < replacestring.length() + 1; ++i) { tt->cursorLeft(this); } - update(tt, BufferView::SELECT|BufferView::FITCUR|BufferView::CHANGE); + update(tt, BufferView::SELECT); + + // FIXME: should be done through LFUN + buffer()->markDirty(); + fitCursor(); } // End of spellchecker stuff @@ -814,9 +824,9 @@ void BufferView::lockedInsetStoreUndo(Un } -void BufferView::updateInset(Inset * inset, bool mark_dirty) +void BufferView::updateInset(Inset * inset) { - pimpl_->updateInset(inset, mark_dirty); + pimpl_->updateInset(inset); } Index: BufferView.h =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/BufferView.h,v retrieving revision 1.118 diff -u -p -r1.118 BufferView.h --- BufferView.h 8 Mar 2003 05:37:52 -0000 1.118 +++ BufferView.h 19 Mar 2003 00:34:37 -0000 @@ -44,10 +44,8 @@ public: * of the document rendering. */ enum UpdateCodes { - UPDATE = 0, //< FIXME - SELECT = 1, //< selection change - FITCUR = 2, //< the cursor needs fitting into the view - CHANGE = 4 //< document data has changed + UPDATE = 0, //< repaint + SELECT = 1 //< reset selection to current cursor pos }; /** @@ -88,8 +86,10 @@ public: void update(); // update for a particular lyxtext void update(LyXText *, UpdateCodes uc); + /// update for the top-level lyxtext + void update(UpdateCodes uc); /// update for a particular inset - void updateInset(Inset * inset, bool mark_dirty); + void updateInset(Inset * inset); /// reset the scrollbar to reflect current view position void updateScrollbar(); /// FIXME Index: BufferView_pimpl.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/BufferView_pimpl.C,v retrieving revision 1.346 diff -u -p -r1.346 BufferView_pimpl.C --- BufferView_pimpl.C 18 Mar 2003 20:54:01 -0000 1.346 +++ BufferView_pimpl.C 19 Mar 2003 00:34:39 -0000 @@ -530,43 +530,6 @@ void BufferView::Pimpl::update() } } -// Values used when calling update: -// -3 - update -// -2 - update, move sel_cursor if selection, fitcursor -// -1 - update, move sel_cursor if selection, fitcursor, mark dirty -// 0 - update, move sel_cursor if selection, fitcursor -// 1 - update, move sel_cursor if selection, fitcursor, mark dirty -// 3 - update, move sel_cursor if selection -// -// update - -// a simple redraw of the parts that need refresh -// -// move sel_cursor if selection - -// the text's sel_cursor is moved if there is selection is progress -// -// fitcursor - -// fitCursor() is called and the scrollbar updated -// -// mark dirty - -// the buffer is marked dirty. -// -// enum { -// UPDATE = 0, -// SELECT = 1, -// FITCUR = 2, -// CHANGE = 4 -// }; -// -// UPDATE_ONLY = UPDATE; -// UPDATE_SELECT = UPDATE | SELECT; -// UPDATE_SELECT_MOVE = UPDATE | SELECT | FITCUR; -// UPDATE_SELECT_MOVE_AFTER_CHANGE = UPDATE | SELECT | FITCUR | CHANGE; -// -// update(-3) -> update(0) -> update(0) -> update(UPDATE) -// update(-2) -> update(1 + 2) -> update(3) -> update(SELECT|FITCUR) -// update(-1) -> update(1 + 2 + 4) -> update(7) -> update(SELECT|FITCUR|CHANGE) -// update(1) -> update(1 + 2 + 4) -> update(7) -> update(SELECT|FITCUR|CHANGE) -// update(3) -> update(1) -> update(1) -> update(SELECT) void BufferView::Pimpl::update(LyXText * text, BufferView::UpdateCodes f) { @@ -578,17 +541,28 @@ void BufferView::Pimpl::update(LyXText * if (text->inset_owner) { text->inset_owner->setUpdateStatus(bv_, InsetText::NONE); - updateInset(text->inset_owner, false); + updateInset(text->inset_owner); } else { update(); } +} + + +void BufferView::Pimpl::update(BufferView::UpdateCodes f) +{ + LyXText * text = bv_->text; - if ((f & FITCUR)) { - fitCursor(); + if (!text->selection.set() && (f & SELECT)) { + text->selection.cursor = text->cursor; } - if ((f & CHANGE)) { - buffer_->markDirty(); + text->fullRebreak(); + + if (text->inset_owner) { + text->inset_owner->setUpdateStatus(bv_, InsetText::NONE); + updateInset(text->inset_owner); + } else { + update(); } } @@ -683,7 +657,7 @@ void BufferView::Pimpl::restorePosition( bv_->text->setCursor(par, min(par->size(), saved_positions[i].par_pos)); - update(bv_->text, BufferView::SELECT | BufferView::FITCUR); + update(BufferView::SELECT); if (i > 0) { ostringstream str; #if USE_BOOST_FORMAT @@ -776,6 +750,8 @@ void BufferView::Pimpl::center() new_y = t->cursor.y() - half_height; } + // FIXME: look at this comment again ... + // FIXME: can we do this w/o calling screen directly ? // This updates top_y() but means the fitCursor() call // from the update(FITCUR) doesn't realise that we might @@ -787,7 +763,7 @@ void BufferView::Pimpl::center() // pretty obfuscated way of updating t->top_y() screen().draw(t, bv_, new_y); - update(t, BufferView::SELECT | BufferView::FITCUR); + update(BufferView::SELECT); } @@ -939,7 +915,7 @@ void BufferView::Pimpl::trackChanges() // we cannot allow undos beyond the freeze point buf->undostack.clear(); } else { - bv_->update(bv_->text, BufferView::SELECT | BufferView::FITCUR); + update(BufferView::SELECT); bv_->text->setCursor(&(*buf->paragraphs.begin()), 0); #warning changes FIXME //moveCursorUpdate(false); @@ -1131,10 +1107,7 @@ bool BufferView::Pimpl::dispatch(FuncReq owner_->getLyXFunc().handleKeyFunc(ev.action); owner_->getIntl().getTransManager() .TranslateAndInsert(ev.argument[0], bv_->getLyXText()); - update(bv_->getLyXText(), - BufferView::SELECT - | BufferView::FITCUR - | BufferView::CHANGE); + update(bv_->getLyXText(), BufferView::SELECT); } break; @@ -1162,7 +1135,7 @@ bool BufferView::Pimpl::dispatch(FuncReq } else { Inset * inset = createInset(ev); if (inset && insertInset(inset)) { - updateInset(inset, true); + updateInset(inset); } else { delete inset; } @@ -1255,7 +1228,7 @@ bool BufferView::Pimpl::dispatch(FuncReq break; case LFUN_ACCEPT_ALL_CHANGES: { - bv_->update(bv_->text, BufferView::SELECT | BufferView::FITCUR); + update(BufferView::SELECT); bv_->text->setCursor(&(*bv_->buffer()->paragraphs.begin()), 0); #warning FIXME changes //moveCursorUpdate(false); @@ -1263,13 +1236,12 @@ bool BufferView::Pimpl::dispatch(FuncReq while (lyxfind::findNextChange(bv_)) { bv_->getLyXText()->acceptChange(); } - update(bv_->text, - BufferView::SELECT | BufferView::FITCUR | BufferView::CHANGE); + update(BufferView::SELECT); break; } case LFUN_REJECT_ALL_CHANGES: { - bv_->update(bv_->text, BufferView::SELECT | BufferView::FITCUR); + update(BufferView::SELECT); bv_->text->setCursor(&(*bv_->buffer()->paragraphs.begin()), 0); #warning FIXME changes //moveCursorUpdate(false); @@ -1277,22 +1249,19 @@ bool BufferView::Pimpl::dispatch(FuncReq while (lyxfind::findNextChange(bv_)) { bv_->getLyXText()->rejectChange(); } - update(bv_->text, - BufferView::SELECT | BufferView::FITCUR | BufferView::CHANGE); + update(BufferView::SELECT); break; } case LFUN_ACCEPT_CHANGE: { bv_->getLyXText()->acceptChange(); - update(bv_->text, - BufferView::SELECT | BufferView::FITCUR | BufferView::CHANGE); + update(BufferView::SELECT); break; } case LFUN_REJECT_CHANGE: { bv_->getLyXText()->rejectChange(); - update(bv_->text, - BufferView::SELECT | BufferView::FITCUR | BufferView::CHANGE); + update(BufferView::SELECT); break; } @@ -1324,15 +1293,15 @@ bool BufferView::Pimpl::insertInset(Inse beforeChange(bv_->text); if (!lout.empty()) { - update(bv_->text, BufferView::SELECT|BufferView::FITCUR); + update(BufferView::SELECT); bv_->text->breakParagraph(bv_->buffer()->paragraphs); - update(bv_->text, BufferView::SELECT|BufferView::FITCUR|BufferView::CHANGE); + update(BufferView::SELECT); if (!bv_->text->cursor.par()->empty()) { bv_->text->cursorLeft(bv_); bv_->text->breakParagraph(bv_->buffer()->paragraphs); - update(bv_->text, BufferView::SELECT|BufferView::FITCUR|BufferView::CHANGE); + update(BufferView::SELECT); } string lres = lout; @@ -1358,18 +1327,18 @@ bool BufferView::Pimpl::insertInset(Inse LYX_ALIGN_LAYOUT, string(), 0); - update(bv_->text, BufferView::SELECT|BufferView::FITCUR|BufferView::CHANGE); + update(BufferView::SELECT); } bv_->text->insertInset(inset); - update(bv_->text, BufferView::SELECT|BufferView::FITCUR|BufferView::CHANGE); + update(BufferView::SELECT); unFreezeUndo(); return true; } -void BufferView::Pimpl::updateInset(Inset * inset, bool mark_dirty) +void BufferView::Pimpl::updateInset(Inset * inset) { if (!inset || !available()) return; @@ -1379,18 +1348,12 @@ void BufferView::Pimpl::updateInset(Inse if (bv_->theLockingInset() == inset) { if (bv_->text->updateInset(inset)) { update(); - if (mark_dirty) { - buffer_->markDirty(); - } updateScrollbar(); return; } } else if (bv_->theLockingInset()->updateInsetInInset(bv_, inset)) { if (bv_->text->updateInset(bv_->theLockingInset())) { update(); - if (mark_dirty) { - buffer_->markDirty(); - } updateScrollbar(); return; } @@ -1405,16 +1368,9 @@ void BufferView::Pimpl::updateInset(Inse tl_inset = tl_inset->owner(); hideCursor(); if (tl_inset == inset) { - update(bv_->text, BufferView::UPDATE); + update(BufferView::UPDATE); if (bv_->text->updateInset(inset)) { - if (mark_dirty) { - update(bv_->text, - BufferView::SELECT - | BufferView::FITCUR - | BufferView::CHANGE); - } else { - update(bv_->text, SELECT); - } + update(BufferView::SELECT); return; } } else if (static_cast<UpdatableInset *>(tl_inset) Index: BufferView_pimpl.h =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/BufferView_pimpl.h,v retrieving revision 1.84 diff -u -p -r1.84 BufferView_pimpl.h --- BufferView_pimpl.h 14 Feb 2003 00:41:37 -0000 1.84 +++ BufferView_pimpl.h 19 Mar 2003 00:34:39 -0000 @@ -47,6 +47,8 @@ struct BufferView::Pimpl : public boost: void update(); // void update(LyXText *, BufferView::UpdateCodes); + /// update the toplevel lyx text + void update(BufferView::UpdateCodes); /** * Repaint pixmap. Used for when we've made a visible * change but don't need the full update() logic @@ -99,7 +101,7 @@ struct BufferView::Pimpl : public boost: /// bool insertInset(Inset * inset, string const & lout = string()); /// - void updateInset(Inset * inset, bool mark_dirty); + void updateInset(Inset * inset); /// bool dispatch(FuncRequest const & ev); private: Index: ParagraphParameters.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/ParagraphParameters.C,v retrieving revision 1.16 diff -u -p -r1.16 ParagraphParameters.C --- ParagraphParameters.C 17 Mar 2003 16:24:50 -0000 1.16 +++ ParagraphParameters.C 19 Mar 2003 00:34:40 -0000 @@ -438,12 +438,7 @@ void setParagraphParams(BufferView & bv, params.noindent()); // Actually apply these settings - bv.update(text, - BufferView::SELECT | - BufferView::FITCUR | - BufferView::CHANGE); - - bv.buffer()->markDirty(); + bv.update(text, BufferView::SELECT); bv.owner()->message(_("Paragraph layout set")); } Index: buffer.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/buffer.C,v retrieving revision 1.434 diff -u -p -r1.434 buffer.C --- buffer.C 17 Mar 2003 16:24:50 -0000 1.434 +++ buffer.C 19 Mar 2003 00:34:44 -0000 @@ -338,7 +338,6 @@ bool Buffer::readBody(LyXLex & lex, Para } else { // We are inserting into an existing document users->text->breakParagraph(paragraphs); - markDirty(); // We don't want to adopt the parameters from the // document we insert, so read them into a temporary buffer Index: bufferview_funcs.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/bufferview_funcs.C,v retrieving revision 1.65 diff -u -p -r1.65 bufferview_funcs.C --- bufferview_funcs.C 17 Mar 2003 16:24:52 -0000 1.65 +++ bufferview_funcs.C 19 Mar 2003 00:34:44 -0000 @@ -177,7 +177,6 @@ void apply_freefont(BufferView * bv) { toggleAndShow(bv, freefont, toggleall); bv->owner()->view_state_changed(); - bv->buffer()->markDirty(); bv->owner()->message(_("Character set")); } @@ -234,14 +233,14 @@ void changeDepth(BufferView * bv, LyXTex return; bv->hideCursor(); - bv->update(bv->text, BufferView::SELECT|BufferView::FITCUR); + bv->update(BufferView::SELECT); if (decInc >= 0) text->incDepth(); else text->decDepth(); if (text->inset_owner) - bv->updateInset((Inset *)text->inset_owner, true); - bv->update(bv->text, BufferView::SELECT|BufferView::FITCUR|BufferView::CHANGE); + bv->updateInset((Inset *)text->inset_owner); + bv->update(BufferView::SELECT); } @@ -397,9 +396,9 @@ void toggleAndShow(BufferView * bv, LyXF return; bv->hideCursor(); - bv->update(text, BufferView::SELECT | BufferView::FITCUR); + bv->update(text, BufferView::SELECT); text->toggleFree(font, toggleall); - bv->update(text, BufferView::SELECT | BufferView::FITCUR | BufferView::CHANGE); + bv->update(text, BufferView::SELECT); if (font.language() != ignore_language || font.number() != LyXFont::IGNORE) { Index: lyx_cb.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/lyx_cb.C,v retrieving revision 1.194 diff -u -p -r1.194 lyx_cb.C --- lyx_cb.C 17 Mar 2003 16:24:52 -0000 1.194 +++ lyx_cb.C 19 Mar 2003 00:34:45 -0000 @@ -408,8 +408,7 @@ void InsertAsciiFile(BufferView * bv, st else bv->getLyXText()->insertStringAsParagraphs(tmpstr); if (flag) - bv->update(bv->text, - BufferView::SELECT|BufferView::FITCUR|BufferView::CHANGE); + bv->update(BufferView::SELECT); } Index: lyxfind.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/lyxfind.C,v retrieving revision 1.35 diff -u -p -r1.35 lyxfind.C --- lyxfind.C 17 Mar 2003 16:24:52 -0000 1.35 +++ lyxfind.C 19 Mar 2003 00:34:46 -0000 @@ -92,17 +92,21 @@ int LyXReplace(BufferView * bv, (text->inset_owner == text->inset_owner->getLockingInset()))) { bv->hideCursor(); - bv->update(text, BufferView::SELECT|BufferView::FITCUR); + bv->update(text, BufferView::SELECT); bv->toggleSelection(false); text->replaceSelectionWithString(replacestr); text->setSelectionRange(replacestr.length()); - bv->update(text, BufferView::SELECT|BufferView::FITCUR|BufferView::CHANGE); + bv->update(text, BufferView::SELECT); ++replace_count; } if (!once) found = LyXFind(bv, searchstr, fw, casesens, matchwrd); } while (!once && replaceall && found); + // FIXME: should be called via an LFUN + bv->buffer()->markDirty(); + bv->fitCursor(); + return replace_count; } @@ -115,7 +119,7 @@ bool LyXFind(BufferView * bv, return false; bv->hideCursor(); - bv->update(bv->getLyXText(), BufferView::SELECT|BufferView::FITCUR); + bv->update(bv->getLyXText(), BufferView::SELECT); if (bv->theLockingInset()) { bool found = forward ? @@ -153,16 +157,18 @@ bool LyXFind(BufferView * bv, // inset did it already. if (result == SR_FOUND) { bv->unlockInset(bv->theLockingInset()); - bv->update(text, BufferView::SELECT|BufferView::FITCUR); + bv->update(text, BufferView::SELECT); text->setSelectionRange(searchstr.length()); bv->toggleSelection(false); - bv->update(text, BufferView::SELECT|BufferView::FITCUR); + bv->update(text, BufferView::SELECT); } else if (result == SR_NOT_FOUND) { bv->unlockInset(bv->theLockingInset()); - bv->update(text, BufferView::SELECT|BufferView::FITCUR); + bv->update(text, BufferView::SELECT); found = false; } + bv->fitCursor(); + return found; } @@ -383,7 +389,7 @@ bool findNextChange(BufferView * bv) return false; bv->hideCursor(); - bv->update(bv->getLyXText(), BufferView::SELECT | BufferView::FITCUR); + bv->update(bv->getLyXText(), BufferView::SELECT); pos_type length; @@ -421,15 +427,17 @@ bool findNextChange(BufferView * bv) // inset did it already. if (result == SR_FOUND) { bv->unlockInset(bv->theLockingInset()); - bv->update(text, BufferView::SELECT|BufferView::FITCUR); + bv->update(text, BufferView::SELECT); text->setSelectionRange(length); bv->toggleSelection(false); - bv->update(text, BufferView::SELECT|BufferView::FITCUR); + bv->update(text, BufferView::SELECT); } else if (result == SR_NOT_FOUND) { bv->unlockInset(bv->theLockingInset()); - bv->update(text, BufferView::SELECT|BufferView::FITCUR); + bv->update(text, BufferView::SELECT); found = false; } + + bv->fitCursor(); return found; } Index: lyxfunc.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/lyxfunc.C,v retrieving revision 1.418 diff -u -p -r1.418 lyxfunc.C --- lyxfunc.C 18 Mar 2003 20:54:00 -0000 1.418 +++ lyxfunc.C 19 Mar 2003 00:34:49 -0000 @@ -125,7 +125,7 @@ void LyXFunc::moveCursorUpdate(bool flag if (!TEXT(flag)->isInInset()) view()->toggleToggle(); } - view()->update(TEXT(flag), BufferView::SELECT|BufferView::FITCUR); + view()->update(TEXT(flag), BufferView::SELECT); view()->showCursor(); view()->switchKeyMap(); @@ -146,8 +146,7 @@ void LyXFunc::handleKeyFunc(kb_action ac // actions keyseq.clear(); // copied verbatim from do_accent_char - view()->update(TEXT(false), - BufferView::SELECT|BufferView::FITCUR|BufferView::CHANGE); + view()->update(TEXT(false), BufferView::SELECT); TEXT(false)->selection.cursor = TEXT(false)->cursor; } @@ -835,7 +834,7 @@ void LyXFunc::dispatch(FuncRequest const moveCursorUpdate(true, false); owner->view_state_changed(); } else { - view()->update(TEXT(), BufferView::SELECT|BufferView::FITCUR); + view()->update(TEXT(), BufferView::SELECT); } goto exit_with_message; } else if (result == FINISHED_DOWN) { @@ -948,8 +947,7 @@ void LyXFunc::dispatch(FuncRequest const case LFUN_PREFIX: { if (view()->available() && !view()->theLockingInset()) { - view()->update(TEXT(), - BufferView::SELECT|BufferView::FITCUR); + view()->update(TEXT(), BufferView::SELECT); } owner->message(keyseq.printOptions()); } @@ -1580,6 +1578,12 @@ void LyXFunc::dispatch(FuncRequest const } // end of switch view()->owner()->updateLayoutChoice(); + view()->fitCursor(); + + // If we executed a mutating lfun, mark the buffer as dirty + if (!lyxaction.funcHasFlag(ev.action, LyXAction::NoBuffer) + && !lyxaction.funcHasFlag(ev.action, LyXAction::ReadOnly)) + view()->buffer()->markDirty(); exit_with_message: sendDispatchMessage(getMessage(), ev, verbose); Index: lyxtext.h =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/lyxtext.h,v retrieving revision 1.146 diff -u -p -r1.146 lyxtext.h --- lyxtext.h 18 Mar 2003 16:47:18 -0000 1.146 +++ lyxtext.h 19 Mar 2003 00:34:51 -0000 @@ -581,7 +581,7 @@ public: * with a dynamic left margin will be rebroken. */ void updateCounters(); /// - void update(bool changed = true); + void update(); /** * Returns an inset if inset was hit, or 0 if not. * If hit, the coordinates are changed relative to the inset. Index: text2.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/text2.C,v retrieving revision 1.294 diff -u -p -r1.294 text2.C --- text2.C 18 Mar 2003 16:47:18 -0000 1.294 +++ text2.C 19 Mar 2003 00:34:55 -0000 @@ -1129,7 +1129,7 @@ void LyXText::setParagraph(bool line_top setSelection(); setCursor(tmpcursor.par(), tmpcursor.pos()); if (inset_owner) - bv()->updateInset(inset_owner, true); + bv()->updateInset(inset_owner); } Index: text3.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/text3.C,v retrieving revision 1.51 diff -u -p -r1.51 text3.C --- text3.C 18 Mar 2003 20:54:01 -0000 1.51 +++ text3.C 19 Mar 2003 00:34:57 -0000 @@ -60,19 +60,16 @@ namespace { if (selecting || lt->selection.mark()) { lt->setSelection(); if (lt->isInInset()) - bv->updateInset(lt->inset_owner, false); + bv->updateInset(lt->inset_owner); else bv->toggleToggle(); } if (!lt->isInInset()) { - //if (fitcur) - // bv->update(lt, BufferView::SELECT|BufferView::FITCUR); - //else - bv->update(lt, BufferView::SELECT|BufferView::FITCUR); + bv->update(lt, BufferView::SELECT); bv->showCursor(); } else if (bv->text->status() != LyXText::UNCHANGED) { bv->theLockingInset()->hideInsetCursor(bv); - bv->update(bv->text, BufferView::SELECT|BufferView::FITCUR); + bv->update(BufferView::SELECT); bv->showCursor(); } @@ -205,7 +202,7 @@ void LyXText::gotoInset(vector<Inset::Co { bv()->hideCursor(); bv()->beforeChange(this); - update(false); + update(); string contents; if (same_content && cursor.par()->isInset(cursor.pos())) { @@ -228,7 +225,7 @@ void LyXText::gotoInset(vector<Inset::Co bv()->owner()->message(_("No more insets")); } } - update(false); + update(); selection.cursor = cursor; } @@ -352,13 +349,9 @@ void LyXText::cursorNext() } -void LyXText::update(bool changed) +void LyXText::update() { - BufferView::UpdateCodes c = BufferView::SELECT | BufferView::FITCUR; - if (changed) - bv()->update(this, c | BufferView::CHANGE); - else - bv()->update(this, c); + bv()->update(this, BufferView::SELECT); } namespace { @@ -366,12 +359,12 @@ namespace { void specialChar(LyXText * lt, BufferView * bv, InsetSpecialChar::Kind kind) { bv->hideCursor(); - lt->update(bv); + lt->update(); InsetSpecialChar * new_inset = new InsetSpecialChar(kind); if (!bv->insertInset(new_inset)) delete new_inset; else - bv->updateInset(new_inset, true); + bv->updateInset(new_inset); } @@ -433,29 +426,29 @@ Inset::RESULT LyXText::dispatch(FuncRequ redoHeightOfParagraph(); postPaint(0); setCursor(cursor.par(), cursor.pos()); - update(bv); + update(); break; } case LFUN_DELETE_WORD_FORWARD: bv->beforeChange(this); - update(false); + update(); deleteWordForward(); - update(bv); + update(); finishChange(bv); break; case LFUN_DELETE_WORD_BACKWARD: bv->beforeChange(this); - update(false); + update(); deleteWordBackward(); - update(true); + update(); finishChange(bv); break; case LFUN_DELETE_LINE_FORWARD: bv->beforeChange(this); - update(false); + update(); deleteLineForward(); update(); finishChange(bv); @@ -465,7 +458,7 @@ Inset::RESULT LyXText::dispatch(FuncRequ case LFUN_TAB: if (!selection.mark()) bv->beforeChange(this); - update(false); + update(); cursorTab(); finishChange(bv); break; @@ -473,7 +466,7 @@ Inset::RESULT LyXText::dispatch(FuncRequ case LFUN_WORDRIGHT: if (!selection.mark()) bv->beforeChange(this); - update(false); + update(); if (cursor.par()->isRightToLeftPar(bv->buffer()->params)) cursorLeftOneWord(); else @@ -484,7 +477,7 @@ Inset::RESULT LyXText::dispatch(FuncRequ case LFUN_WORDLEFT: if (!selection.mark()) bv->beforeChange(this); - update(false); + update(); if (cursor.par()->isRightToLeftPar(bv->buffer()->params)) cursorRightOneWord(); else @@ -495,7 +488,7 @@ Inset::RESULT LyXText::dispatch(FuncRequ case LFUN_BEGINNINGBUF: if (!selection.mark()) bv->beforeChange(this); - update(false); + update(); cursorTop(); finishChange(bv); break; @@ -503,13 +496,13 @@ Inset::RESULT LyXText::dispatch(FuncRequ case LFUN_ENDBUF: if (selection.mark()) bv->beforeChange(this); - update(false); + update(); cursorBottom(); finishChange(bv); break; case LFUN_RIGHTSEL: - update(false); + update(); if (cursor.par()->isRightToLeftPar(bv->buffer()->params)) cursorLeft(bv); else @@ -518,7 +511,7 @@ Inset::RESULT LyXText::dispatch(FuncRequ break; case LFUN_LEFTSEL: - update(false); + update(); if (cursor.par()->isRightToLeftPar(bv->buffer()->params)) cursorRight(bv); else @@ -527,55 +520,55 @@ Inset::RESULT LyXText::dispatch(FuncRequ break; case LFUN_UPSEL: - update(false); + update(); cursorUp(true); finishChange(bv, true); break; case LFUN_DOWNSEL: - update(false); + update(); cursorDown(true); finishChange(bv, true); break; case LFUN_UP_PARAGRAPHSEL: - update(false); + update(); cursorUpParagraph(); finishChange(bv, true); break; case LFUN_DOWN_PARAGRAPHSEL: - update(false); + update(); cursorDownParagraph(); finishChange(bv, true); break; case LFUN_PRIORSEL: - update(false); + update(); cursorPrevious(); finishChange(bv, true); break; case LFUN_NEXTSEL: - update(false); + update(); cursorNext(); finishChange(bv, true); break; case LFUN_HOMESEL: - update(false); + update(); cursorHome(); finishChange(bv, true); break; case LFUN_ENDSEL: - update(false); + update(); cursorEnd(); finishChange(bv, true); break; case LFUN_WORDRIGHTSEL: - update(false); + update(); if (cursor.par()->isRightToLeftPar(bv->buffer()->params)) cursorLeftOneWord(); else @@ -584,7 +577,7 @@ Inset::RESULT LyXText::dispatch(FuncRequ break; case LFUN_WORDLEFTSEL: - update(false); + update(); if (cursor.par()->isRightToLeftPar(bv->buffer()->params)) cursorRightOneWord(); else @@ -593,7 +586,7 @@ Inset::RESULT LyXText::dispatch(FuncRequ break; case LFUN_WORDSEL: { - update(false); + update(); LyXCursor cur1; LyXCursor cur2; getWord(cur1, cur2, WHOLE_WORD); @@ -608,7 +601,7 @@ Inset::RESULT LyXText::dispatch(FuncRequ bool is_rtl = cursor.par()->isRightToLeftPar(bv->buffer()->params); if (!selection.mark()) bv->beforeChange(this); - update(false); + update(); if (is_rtl) cursorLeft(false); if (cursor.pos() < cursor.par()->size() @@ -631,7 +624,7 @@ Inset::RESULT LyXText::dispatch(FuncRequ bool const is_rtl = cursor.par()->isRightToLeftPar(bv->buffer()->params); if (!selection.mark()) bv->beforeChange(this); - update(false); + update(); LyXCursor const cur = cursor; if (!is_rtl) cursorLeft(false); @@ -705,7 +698,7 @@ Inset::RESULT LyXText::dispatch(FuncRequ case LFUN_HOME: if (!selection.mark()) bv->beforeChange(this); - update(bv); + update(); cursorHome(); finishChange(bv, false); break; @@ -713,7 +706,7 @@ Inset::RESULT LyXText::dispatch(FuncRequ case LFUN_END: if (!selection.mark()) bv->beforeChange(this); - update(bv); + update(); cursorEnd(); finishChange(bv, false); break; @@ -727,7 +720,7 @@ Inset::RESULT LyXText::dispatch(FuncRequ bv->beforeChange(this); insertInset(new InsetNewline); - update(true); + update(); setCursor(cursor.par(), cursor.pos()); moveCursorUpdate(bv, false); break; @@ -737,14 +730,14 @@ Inset::RESULT LyXText::dispatch(FuncRequ if (!selection.set()) { Delete(); selection.cursor = cursor; - update(bv); + update(); // It is possible to make it a lot faster still // just comment out the line below... bv->showCursor(); } else { - update(false); + update(); cutSelection(bv, true); - update(bv); + update(); } moveCursorUpdate(bv, false); bv->owner()->view_state_changed(); @@ -772,7 +765,7 @@ Inset::RESULT LyXText::dispatch(FuncRequ cur.par()->params().align(), cur.par()->params().labelWidthString(), 0); cursorLeft(bv); - update(bv); + update(); } else { cursorLeft(bv); Delete(); @@ -783,10 +776,10 @@ Inset::RESULT LyXText::dispatch(FuncRequ selection.cursor = cursor; } } else { - update(false); + update(); cutSelection(bv, true); } - update(bv); + update(); break; @@ -795,15 +788,15 @@ Inset::RESULT LyXText::dispatch(FuncRequ if (bv->owner()->getIntl().getTransManager().backspace()) { backspace(); selection.cursor = cursor; - update(bv); + update(); // It is possible to make it a lot faster still // just comment out the line below... bv->showCursor(); } } else { - update(false); + update(); cutSelection(bv, true); - update(bv); + update(); } bv->owner()->view_state_changed(); bv->switchKeyMap(); @@ -830,16 +823,16 @@ Inset::RESULT LyXText::dispatch(FuncRequ selection.cursor = cur; } } else { - update(false); + update(); cutSelection(bv, true); } - update(bv); + update(); break; case LFUN_BREAKPARAGRAPH: bv->beforeChange(this); breakParagraph(bv->buffer()->paragraphs, 0); - update(bv); + update(); selection.cursor = cursor; bv->switchKeyMap(); bv->owner()->view_state_changed(); @@ -848,7 +841,7 @@ Inset::RESULT LyXText::dispatch(FuncRequ case LFUN_BREAKPARAGRAPHKEEPLAYOUT: bv->beforeChange(this); breakParagraph(bv->buffer()->paragraphs, 1); - update(bv); + update(); selection.cursor = cursor; bv->switchKeyMap(); bv->owner()->view_state_changed(); @@ -871,14 +864,12 @@ Inset::RESULT LyXText::dispatch(FuncRequ cur.par()->params().spacing(), cur.par()->params().align(), cur.par()->params().labelWidthString(), 1); - //update(bv); } } else { breakParagraph(bv->buffer()->paragraphs, 0); - //update(bv); } - update(bv); + update(); selection.cursor = cur; bv->switchKeyMap(); bv->owner()->view_state_changed(); @@ -922,7 +913,7 @@ Inset::RESULT LyXText::dispatch(FuncRequ if (cur_spacing != new_spacing || cur_value != new_value) { par->params().spacing(Spacing(new_spacing, new_value)); redoParagraph(); - update(bv); + update(); } break; } @@ -930,16 +921,16 @@ Inset::RESULT LyXText::dispatch(FuncRequ case LFUN_INSET_TOGGLE: bv->hideCursor(); bv->beforeChange(this); - update(false); + update(); toggleInset(); - update(false); + update(); bv->switchKeyMap(); break; case LFUN_PROTECTEDSPACE: if (cursor.par()->layout()->free_spacing) { insertChar(' '); - update(bv); + update(); } else { specialChar(this, bv, InsetSpecialChar::PROTECTED_SEPARATOR); } @@ -968,7 +959,7 @@ Inset::RESULT LyXText::dispatch(FuncRequ case LFUN_MARK_OFF: bv->beforeChange(this); - update(false); + update(); selection.cursor = cursor; cmd.message(N_("Mark off")); break; @@ -976,7 +967,7 @@ Inset::RESULT LyXText::dispatch(FuncRequ case LFUN_MARK_ON: bv->beforeChange(this); selection.mark(true); - update(false); + update(); selection.cursor = cursor; cmd.message(N_("Mark on")); break; @@ -984,46 +975,46 @@ Inset::RESULT LyXText::dispatch(FuncRequ case LFUN_SETMARK: bv->beforeChange(this); if (selection.mark()) { - update(bv); + update(); cmd.message(N_("Mark removed")); } else { selection.mark(true); - update(bv); + update(); cmd.message(N_("Mark set")); } selection.cursor = cursor; break; case LFUN_UPCASE_WORD: - update(false); + update(); changeCase(LyXText::text_uppercase); if (inset_owner) - bv->updateInset(inset_owner, true); - update(bv); + bv->updateInset(inset_owner); + update(); break; case LFUN_LOWCASE_WORD: - update(false); + update(); changeCase(LyXText::text_lowercase); if (inset_owner) - bv->updateInset(inset_owner, true); + bv->updateInset(inset_owner); update(); break; case LFUN_CAPITALIZE_WORD: - update(false); + update(); changeCase(LyXText::text_capitalization); if (inset_owner) - bv->updateInset(inset_owner, true); - update(bv); + bv->updateInset(inset_owner); + update(); break; case LFUN_TRANSPOSE_CHARS: - update(false); + update(); transposeChars(); if (inset_owner) - bv->updateInset(inset_owner, true); - update(bv); + bv->updateInset(inset_owner); + update(); break; case LFUN_PASTE: @@ -1032,19 +1023,18 @@ Inset::RESULT LyXText::dispatch(FuncRequ // clear the selection bv->toggleSelection(); clearSelection(); - update(false); + update(); pasteSelection(); clearSelection(); // bug 393 - update(false); - update(bv); + update(); bv->switchKeyMap(); break; case LFUN_CUT: bv->hideCursor(); - update(false); + update(); cutSelection(bv, true); - update(bv); + update(); cmd.message(_("Cut")); break; @@ -1056,7 +1046,7 @@ Inset::RESULT LyXText::dispatch(FuncRequ case LFUN_BEGINNINGBUFSEL: if (inset_owner) return UNDISPATCHED; - update(false); + update(); cursorTop(); finishChange(bv, true); break; @@ -1064,7 +1054,7 @@ Inset::RESULT LyXText::dispatch(FuncRequ case LFUN_ENDBUFSEL: if (inset_owner) return UNDISPATCHED; - update(false); + update(); cursorBottom(); finishChange(bv, true); break; @@ -1149,10 +1139,10 @@ Inset::RESULT LyXText::dispatch(FuncRequ if (change_layout) { bv->hideCursor(); current_layout = layout; - update(false); + update(); setLayout(layout); bv->owner()->setLayout(layout); - update(bv); + update(); bv->switchKeyMap(); } break; @@ -1172,7 +1162,7 @@ Inset::RESULT LyXText::dispatch(FuncRequ else insertStringAsLines(clip); clearSelection(); - update(bv); + update(); } break; } @@ -1231,7 +1221,7 @@ Inset::RESULT LyXText::dispatch(FuncRequ for (int i = 0; i < datetmp_len; i++) { insertChar(datetmp[i]); - update(true); + update(); } selection.cursor = cursor; moveCursorUpdate(bv, false); @@ -1254,7 +1244,7 @@ Inset::RESULT LyXText::dispatch(FuncRequ setSelection(); if (!isInInset()) bv->screen().toggleSelection(this, bv, false); - update(false); + update(); bv->haveSelection(selection.set()); } break; @@ -1273,7 +1263,7 @@ Inset::RESULT LyXText::dispatch(FuncRequ } else { selectWord(LyXText::WHOLE_WORD_STRICT); } - update(false); + update(); bv->haveSelection(selection.set()); } break; @@ -1336,7 +1326,7 @@ Inset::RESULT LyXText::dispatch(FuncRequ // Maybe an empty line was deleted if (!bv->text->selection.set()) - bv->update(bv->text, BufferView::UPDATE); + bv->update(BufferView::UPDATE); bv->text->setSelection(); bv->screen().toggleToggle(bv->text, bv); bv->fitCursor(); @@ -1548,7 +1538,7 @@ Inset::RESULT LyXText::dispatch(FuncRequ if (lyxrc.auto_region_delete) { if (selection.set()) { cutSelection(false, false); - update(bv); + update(); } bv->haveSelection(false); } @@ -1562,7 +1552,7 @@ Inset::RESULT LyXText::dispatch(FuncRequ bv->owner()->getIntl().getTransManager(). TranslateAndInsert(*cit, this); - update(bv); + update(); selection.cursor = cursor; moveCursorUpdate(bv, false); Index: undo_funcs.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/undo_funcs.C,v retrieving revision 1.35 diff -u -p -r1.35 undo_funcs.C --- undo_funcs.C 17 Mar 2003 16:24:57 -0000 1.35 +++ undo_funcs.C 19 Mar 2003 00:34:58 -0000 @@ -232,7 +232,7 @@ bool textHandleUndo(BufferView * bv, Und t->updateCounters(); bv->fitCursor(); } - bv->updateInset(it, false); + bv->updateInset(it); bv->text->setCursorIntern(bv->text->cursor.par(), bv->text->cursor.pos()); } else { Index: graphics/PreviewedInset.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/graphics/PreviewedInset.C,v retrieving revision 1.12 diff -u -p -r1.12 PreviewedInset.C --- graphics/PreviewedInset.C 26 Feb 2003 13:10:16 -0000 1.12 +++ graphics/PreviewedInset.C 19 Mar 2003 00:35:01 -0000 @@ -122,7 +122,7 @@ void PreviewedInset::imageReady(grfx::Pr pimage_ = &pimage; if (view()) - view()->updateInset(&inset_, false); + view()->updateInset(&inset_); } } // namespace grfx Index: insets/insetbibitem.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetbibitem.C,v retrieving revision 1.7 diff -u -p -r1.7 insetbibitem.C --- insets/insetbibitem.C 10 Mar 2003 22:12:07 -0000 1.7 +++ insets/insetbibitem.C 19 Mar 2003 00:35:01 -0000 @@ -66,7 +66,7 @@ dispatch_result InsetBibitem::localDispa } setParams(p); - cmd.view()->updateInset(this, true); + cmd.view()->updateInset(this); result = DISPATCHED; } break; Index: insets/insetbibtex.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetbibtex.C,v retrieving revision 1.7 diff -u -p -r1.7 insetbibtex.C --- insets/insetbibtex.C 10 Mar 2003 22:12:07 -0000 1.7 +++ insets/insetbibtex.C 19 Mar 2003 00:35:01 -0000 @@ -63,7 +63,7 @@ dispatch_result InsetBibtex::localDispat } setParams(p); - cmd.view()->updateInset(this, true); + cmd.view()->updateInset(this); result = DISPATCHED; } break; Index: insets/insetcollapsable.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetcollapsable.C,v retrieving revision 1.128 diff -u -p -r1.128 insetcollapsable.C --- insets/insetcollapsable.C 17 Mar 2003 01:34:34 -0000 1.128 +++ insets/insetcollapsable.C 19 Mar 2003 00:35:02 -0000 @@ -24,6 +24,7 @@ #include "lyxtext.h" #include "WordLangTuple.h" #include "funcrequest.h" +#include "buffer.h" #include "frontends/font_metrics.h" #include "frontends/Painter.h" @@ -245,7 +246,8 @@ void InsetCollapsable::edit(BufferView * first_after_edit = true; if (!bv->lockInset(this)) return; - bv->updateInset(this, false); + bv->updateInset(this); + bv->buffer()->markDirty(); inset.edit(bv); } else { if (!bv->lockInset(this)) @@ -273,7 +275,8 @@ void InsetCollapsable::edit(BufferView * if (!bv->lockInset(this)) return; inset.setUpdateStatus(bv, InsetText::FULL); - bv->updateInset(this, false); + bv->updateInset(this); + bv->buffer()->markDirty(); inset.edit(bv, front); first_after_edit = true; } else { @@ -307,7 +310,7 @@ void InsetCollapsable::insetUnlock(Buffe inset.insetUnlock(bv); if (scroll()) scroll(bv, 0.0F); - bv->updateInset(this, false); + bv->updateInset(this); } @@ -337,11 +340,13 @@ bool InsetCollapsable::lfunMouseRelease( // should not be called on inset open! // inset.insetButtonRelease(bv, 0, 0, button); inset.setUpdateStatus(bv, InsetText::FULL); - bv->updateInset(this, false); + bv->updateInset(this); + bv->buffer()->markDirty(); } else { collapsed_ = true; bv->unlockInset(this); - bv->updateInset(this, false); + bv->updateInset(this); + bv->buffer()->markDirty(); } } else if (!collapsed_ && (cmd.y > button_bottom_y)) { LyXFont font(LyXFont::ALL_SANE); @@ -624,7 +629,7 @@ void InsetCollapsable::open(BufferView * if (!collapsed_) return; collapsed_ = false; - bv->updateInset(this, false); + bv->updateInset(this); } @@ -634,7 +639,7 @@ void InsetCollapsable::close(BufferView return; collapsed_ = true; - bv->updateInset(const_cast<InsetCollapsable *>(this), false); + bv->updateInset(const_cast<InsetCollapsable *>(this)); } Index: insets/insetcommand.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetcommand.C,v retrieving revision 1.64 diff -u -p -r1.64 insetcommand.C --- insets/insetcommand.C 11 Mar 2003 11:52:05 -0000 1.64 +++ insets/insetcommand.C 19 Mar 2003 00:35:02 -0000 @@ -77,7 +77,7 @@ dispatch_result InsetCommand::localDispa break; setParams(p); - cmd.view()->updateInset(this, true); + cmd.view()->updateInset(this); result = DISPATCHED; } break; Index: insets/insetert.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetert.C,v retrieving revision 1.109 diff -u -p -r1.109 insetert.C --- insets/insetert.C 17 Mar 2003 16:24:58 -0000 1.109 +++ insets/insetert.C 19 Mar 2003 00:35:04 -0000 @@ -445,7 +445,7 @@ Inset::RESULT InsetERT::localDispatch(Fu InsetERTMailer::string2params(cmd.argument, status_); status(bv, status_); - bv->updateInset(this, true); + bv->updateInset(this); result = DISPATCHED; } break; @@ -640,8 +640,10 @@ void InsetERT::status(BufferView * bv, E bv->unlockInset(const_cast<InsetERT *>(this)); break; } - if (bv) - bv->updateInset(const_cast<InsetERT *>(this), false); + if (bv) { + bv->updateInset(const_cast<InsetERT *>(this)); + bv->buffer()->markDirty(); + } } } Index: insets/insetexternal.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetexternal.C,v retrieving revision 1.61 diff -u -p -r1.61 insetexternal.C --- insets/insetexternal.C 10 Mar 2003 22:12:07 -0000 1.61 +++ insets/insetexternal.C 19 Mar 2003 00:35:05 -0000 @@ -74,7 +74,7 @@ dispatch_result InsetExternal::localDisp break; setFromParams(p); - cmd.view()->updateInset(this, true); + cmd.view()->updateInset(this); result = DISPATCHED; } break; Index: insets/insetfloat.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetfloat.C,v retrieving revision 1.64 diff -u -p -r1.64 insetfloat.C --- insets/insetfloat.C 10 Mar 2003 22:12:07 -0000 1.64 +++ insets/insetfloat.C 19 Mar 2003 00:35:05 -0000 @@ -165,7 +165,7 @@ dispatch_result InsetFloat::localDispatc params_.placement = params.placement; params_.wide = params.wide; - cmd.view()->updateInset(this, true); + cmd.view()->updateInset(this); result = DISPATCHED; } break; Index: insets/insetgraphics.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetgraphics.C,v retrieving revision 1.159 diff -u -p -r1.159 insetgraphics.C --- insets/insetgraphics.C 17 Mar 2003 01:34:34 -0000 1.159 +++ insets/insetgraphics.C 19 Mar 2003 00:35:07 -0000 @@ -230,7 +230,7 @@ dispatch_result InsetGraphics::localDisp string const filepath = cmd.view()->buffer()->filePath(); setParams(p, filepath); - cmd.view()->updateInset(this, true); + cmd.view()->updateInset(this); result = DISPATCHED; } break; @@ -835,7 +835,7 @@ void InsetGraphics::validate(LaTeXFeatur void InsetGraphics::statusChanged() { if (!cache_->view.expired()) - cache_->view.lock()->updateInset(this, false); + cache_->view.lock()->updateInset(this); } Index: insets/insetinclude.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetinclude.C,v retrieving revision 1.105 diff -u -p -r1.105 insetinclude.C --- insets/insetinclude.C 17 Mar 2003 01:34:34 -0000 1.105 +++ insets/insetinclude.C 19 Mar 2003 00:35:08 -0000 @@ -127,7 +127,7 @@ dispatch_result InsetInclude::localDispa set(p); params_.masterFilename_ = cmd.view()->buffer()->fileName(); - cmd.view()->updateInset(this, true); + cmd.view()->updateInset(this); result = DISPATCHED; } break; @@ -624,7 +624,7 @@ void InsetInclude::PreviewImpl::restartL lyxerr << "restartLoading()" << std::endl; removePreview(); if (view()) - view()->updateInset(&parent(), false); + view()->updateInset(&parent()); generatePreview(); } Index: insets/insetlabel.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetlabel.C,v retrieving revision 1.56 diff -u -p -r1.56 insetlabel.C --- insets/insetlabel.C 11 Mar 2003 11:52:05 -0000 1.56 +++ insets/insetlabel.C 19 Mar 2003 00:35:08 -0000 @@ -70,7 +70,7 @@ dispatch_result InsetLabel::localDispatc } setParams(p); - cmd.view()->updateInset(this, !clean); + cmd.view()->updateInset(this); result = DISPATCHED; } break; Index: insets/insetminipage.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetminipage.C,v retrieving revision 1.57 diff -u -p -r1.57 insetminipage.C --- insets/insetminipage.C 10 Mar 2003 22:12:07 -0000 1.57 +++ insets/insetminipage.C 19 Mar 2003 00:35:09 -0000 @@ -117,7 +117,7 @@ dispatch_result InsetMinipage::localDisp params_.pos = params.pos; params_.width = params.width; - cmd.view()->updateInset(this, true); + cmd.view()->updateInset(this); result = DISPATCHED; } break; Index: insets/insettabular.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insettabular.C,v retrieving revision 1.248 diff -u -p -r1.248 insettabular.C --- insets/insettabular.C 17 Mar 2003 16:24:58 -0000 1.248 +++ insets/insettabular.C 19 Mar 2003 00:35:14 -0000 @@ -535,7 +535,7 @@ void InsetTabular::updateLocal(BufferVie need_update = what; // Dirty Cast! (Lgb) if (need_update != NONE) { - bv->updateInset(const_cast<InsetTabular *>(this), mark_dirty); + bv->updateInset(const_cast<InsetTabular *>(this)); if (locked) resetPos(bv); } Index: insets/insettext.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insettext.C,v retrieving revision 1.359 diff -u -p -r1.359 insettext.C --- insets/insettext.C 17 Mar 2003 16:24:59 -0000 1.359 +++ insets/insettext.C 19 Mar 2003 00:35:18 -0000 @@ -586,7 +586,7 @@ void InsetText::updateLocal(BufferView * bv->fitCursor(); #endif if (flag) - bv->updateInset(const_cast<InsetText *>(this), mark_dirty); + bv->updateInset(const_cast<InsetText *>(this)); if (need_update == CURSOR) need_update = NONE; Index: insets/insetwrap.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetwrap.C,v retrieving revision 1.12 diff -u -p -r1.12 insetwrap.C --- insets/insetwrap.C 10 Mar 2003 22:12:07 -0000 1.12 +++ insets/insetwrap.C 19 Mar 2003 00:35:19 -0000 @@ -95,7 +95,7 @@ dispatch_result InsetWrap::localDispatch params_.placement = params.placement; params_.width = params.width; - cmd.view()->updateInset(this, true); + cmd.view()->updateInset(this); result = DISPATCHED; } break; Index: insets/updatableinset.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/updatableinset.C,v retrieving revision 1.5 diff -u -p -r1.5 updatableinset.C --- insets/updatableinset.C 17 Mar 2003 16:24:59 -0000 1.5 +++ insets/updatableinset.C 19 Mar 2003 00:35:19 -0000 @@ -110,8 +110,6 @@ void UpdatableInset::scroll(BufferView * if ((tmp_top_x + scx + width(bv, font)) < (workW / 2)) { scx += (workW / 2) - (tmp_top_x + scx + width(bv, font)); } - - // bv->updateInset(const_cast<UpdatableInset *>(this), false); } void UpdatableInset::scroll(BufferView * bv, int offset) const @@ -134,7 +132,6 @@ void UpdatableInset::scroll(BufferView * scx += offset; } } -// bv->updateInset(const_cast<UpdatableInset *>(this), false); } @@ -152,7 +149,7 @@ Inset::RESULT UpdatableInset::localDispa int const xx = strToInt(ev.argument); scroll(ev.view(), xx); } - ev.view()->updateInset(this, false); + ev.view()->updateInset(this); return DISPATCHED; } Index: mathed/formulabase.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/formulabase.C,v retrieving revision 1.253 diff -u -p -r1.253 formulabase.C --- mathed/formulabase.C 12 Mar 2003 22:17:50 -0000 1.253 +++ mathed/formulabase.C 19 Mar 2003 00:35:21 -0000 @@ -127,15 +127,15 @@ void InsetFormulaBase::handleFont bv->lockedInsetStoreUndo(Undo::EDIT); if (mathcursor->par()->name() == font) { mathcursor->handleFont(font); - updateLocal(bv, true); + bv->updateInset(this); } else { bool sel = mathcursor->selection(); if (sel) - updateLocal(bv, true); + bv->updateInset(this); mathcursor->handleNest(createMathInset(font)); mathcursor->insert(arg); if (!sel) - updateLocal(bv, false); + bv->updateInset(this); } } @@ -185,7 +185,7 @@ void InsetFormulaBase::edit(BufferView * mathcursor->setPos(x + xo_, y + yo_); // if that is removed, we won't get the magenta box when entering an // inset for the first time - bv->updateInset(this, false); + bv->updateInset(this); } @@ -196,7 +196,7 @@ void InsetFormulaBase::edit(BufferView * releaseMathCursor(bv); mathcursor = new MathCursor(this, front); metrics(bv); - bv->updateInset(this, false); + bv->updateInset(this); } @@ -205,12 +205,12 @@ void InsetFormulaBase::insetUnlock(Buffe if (mathcursor) { if (mathcursor->inMacroMode()) { mathcursor->macroModeClose(); - updateLocal(bv, true); + bv->updateInset(this); } releaseMathCursor(bv); } generatePreview(); - bv->updateInset(this, false); + bv->updateInset(this); } @@ -291,7 +291,7 @@ void InsetFormulaBase::fitInsetCursor(Bu void InsetFormulaBase::toggleInsetSelection(BufferView * bv) { if (mathcursor) - bv->updateInset(this, false); + bv->updateInset(this); } @@ -301,12 +301,6 @@ vector<string> const InsetFormulaBase::g } -void InsetFormulaBase::updateLocal(BufferView * bv, bool dirty) -{ - bv->updateInset(this, dirty); -} - - dispatch_result InsetFormulaBase::lfunMouseRelease(FuncRequest const & cmd) { if (!mathcursor) @@ -315,7 +309,7 @@ dispatch_result InsetFormulaBase::lfunMo BufferView * bv = cmd.view(); hideInsetCursor(bv); showInsetCursor(bv); - bv->updateInset(this, false); + bv->updateInset(this); //lyxerr << "lfunMouseRelease: buttons: " << cmd.button() << endl; if (cmd.button() == mouse_button::button3) { @@ -332,7 +326,7 @@ dispatch_result InsetFormulaBase::lfunMo mathcursor->selClear(); mathcursor->setPos(cmd.x + xo_, cmd.y + yo_); mathcursor->insert(asArray(bv->getClipboard())); - bv->updateInset(this, true); + bv->updateInset(this); return DISPATCHED; } @@ -379,7 +373,7 @@ dispatch_result InsetFormulaBase::lfunMo return DISPATCHED; } - bv->updateInset(this, false); + bv->updateInset(this); return DISPATCHED; } @@ -409,7 +403,7 @@ dispatch_result InsetFormulaBase::lfunMo hideInsetCursor(bv); mathcursor->setPos(cmd.x + xo_, cmd.y + yo_); showInsetCursor(bv); - bv->updateInset(this, false); + bv->updateInset(this); return DISPATCHED; } @@ -472,7 +466,7 @@ dispatch_result InsetFormulaBase::localD case LFUN_MATH_LIMITS: bv->lockedInsetStoreUndo(Undo::EDIT); mathcursor->dispatch(cmd); - updateLocal(bv, true); + bv->updateInset(this); break; case LFUN_RIGHTSEL: @@ -481,7 +475,7 @@ dispatch_result InsetFormulaBase::localD result = mathcursor->right(sel) ? DISPATCHED : FINISHED_RIGHT; //lyxerr << "calling scroll 20\n"; //scroll(bv, 20); - updateLocal(bv, false); + bv->updateInset(this); // write something to the minibuffer //bv->owner()->message(mathcursor->info()); break; @@ -490,27 +484,27 @@ dispatch_result InsetFormulaBase::localD sel = true; // fall through case LFUN_LEFT: result = mathcursor->left(sel) ? DISPATCHED : FINISHED; - updateLocal(bv, false); + bv->updateInset(this); break; case LFUN_UPSEL: sel = true; // fall through case LFUN_UP: result = mathcursor->up(sel) ? DISPATCHED : FINISHED_UP; - updateLocal(bv, false); + bv->updateInset(this); break; case LFUN_DOWNSEL: sel = true; // fall through case LFUN_DOWN: result = mathcursor->down(sel) ? DISPATCHED : FINISHED_DOWN; - updateLocal(bv, false); + bv->updateInset(this); break; case LFUN_WORDSEL: mathcursor->home(false); mathcursor->end(true); - updateLocal(bv, false); + bv->updateInset(this); break; case LFUN_UP_PARAGRAPHSEL: @@ -518,7 +512,7 @@ dispatch_result InsetFormulaBase::localD case LFUN_DOWN_PARAGRAPHSEL: case LFUN_DOWN_PARAGRAPH: result = FINISHED; - updateLocal(bv, false); + bv->updateInset(this); break; case LFUN_HOMESEL: @@ -527,7 +521,7 @@ dispatch_result InsetFormulaBase::localD case LFUN_HOME: case LFUN_WORDLEFT: result = mathcursor->home(sel) ? DISPATCHED : FINISHED; - updateLocal(bv, false); + bv->updateInset(this); break; case LFUN_ENDSEL: @@ -536,7 +530,7 @@ dispatch_result InsetFormulaBase::localD case LFUN_END: case LFUN_WORDRIGHT: result = mathcursor->end(sel) ? DISPATCHED : FINISHED_RIGHT; - updateLocal(bv, false); + bv->updateInset(this); break; case LFUN_PRIORSEL: @@ -544,7 +538,7 @@ dispatch_result InsetFormulaBase::localD case LFUN_BEGINNINGBUFSEL: case LFUN_BEGINNINGBUF: result = FINISHED; - updateLocal(bv, false); + bv->updateInset(this); break; case LFUN_NEXTSEL: @@ -552,17 +546,17 @@ dispatch_result InsetFormulaBase::localD case LFUN_ENDBUFSEL: case LFUN_ENDBUF: result = FINISHED_RIGHT; - updateLocal(bv, false); + bv->updateInset(this); break; case LFUN_TAB: mathcursor->idxNext(); - updateLocal(bv, false); + bv->updateInset(this); break; case LFUN_SHIFT_TAB: mathcursor->idxPrev(); - updateLocal(bv, false); + bv->updateInset(this); break; case LFUN_DELETE_WORD_BACKWARD: @@ -574,7 +568,7 @@ dispatch_result InsetFormulaBase::localD result = FINISHED; remove_inset = true; } - updateLocal(bv, true); + bv->updateInset(this); break; case LFUN_DELETE_WORD_FORWARD: @@ -586,7 +580,7 @@ dispatch_result InsetFormulaBase::localD result = FINISHED; remove_inset = true; } - updateLocal(bv, true); + bv->updateInset(this); break; // case LFUN_GETXY: @@ -600,7 +594,7 @@ dispatch_result InsetFormulaBase::localD istringstream is(cmd.argument.c_str()); is >> x >> y; mathcursor->setPos(x, y); - updateLocal(bv, false); + bv->updateInset(this); break; } @@ -609,13 +603,13 @@ dispatch_result InsetFormulaBase::localD mathcursor->macroModeClose(); bv->lockedInsetStoreUndo(Undo::EDIT); mathcursor->selPaste(); - updateLocal(bv, true); + bv->updateInset(this); break; case LFUN_CUT: bv->lockedInsetStoreUndo(Undo::DELETE); mathcursor->selCut(); - updateLocal(bv, true); + bv->updateInset(this); break; case LFUN_COPY: @@ -631,7 +625,7 @@ dispatch_result InsetFormulaBase::localD // deadkeys bv->lockedInsetStoreUndo(Undo::EDIT); mathcursor->script(true); - updateLocal(bv, true); + bv->updateInset(this); } break; @@ -673,7 +667,7 @@ dispatch_result InsetFormulaBase::localD case LFUN_MATH_MODE: if (mathcursor->currentMode() == MathInset::TEXT_MODE) { mathcursor->niceInsert(MathAtom(new MathHullInset("simple"))); - updateLocal(bv, true); + bv->updateInset(this); } else { handleFont(bv, cmd.argument, "textrm"); } @@ -685,7 +679,7 @@ dispatch_result InsetFormulaBase::localD if (!arg.empty()) { bv->lockedInsetStoreUndo(Undo::EDIT); mathcursor->setSize(arg); - updateLocal(bv, true); + bv->updateInset(this); } #endif break; @@ -703,7 +697,7 @@ dispatch_result InsetFormulaBase::localD v_align += 'c'; mathcursor->niceInsert( MathAtom(new MathArrayInset("array", m, n, v_align[0], h_align))); - updateLocal(bv, true); + bv->updateInset(this); break; } @@ -712,7 +706,7 @@ dispatch_result InsetFormulaBase::localD { bv->lockedInsetStoreUndo(Undo::EDIT); mathcursor->script(cmd.action == LFUN_SUPERSCRIPT); - updateLocal(bv, true); + bv->updateInset(this); break; } @@ -729,7 +723,7 @@ dispatch_result InsetFormulaBase::localD bv->lockedInsetStoreUndo(Undo::EDIT); mathcursor->handleNest(MathAtom(new MathDelimInset(ls, rs))); - updateLocal(bv, true); + bv->updateInset(this); break; } @@ -737,7 +731,7 @@ dispatch_result InsetFormulaBase::localD case LFUN_MATH_SPACE: bv->lockedInsetStoreUndo(Undo::EDIT); mathcursor->insert(MathAtom(new MathSpaceInset(","))); - updateLocal(bv, true); + bv->updateInset(this); break; case LFUN_UNDO: @@ -753,7 +747,7 @@ dispatch_result InsetFormulaBase::localD // interpret this as if a backslash was typed bv->lockedInsetStoreUndo(Undo::EDIT); mathcursor->interpret('\\'); - updateLocal(bv, true); + bv->updateInset(this); break; case LFUN_BREAKPARAGRAPH: @@ -768,7 +762,7 @@ dispatch_result InsetFormulaBase::localD case LFUN_INSERT_MATH: bv->lockedInsetStoreUndo(Undo::EDIT); mathcursor->niceInsert(argument); - updateLocal(bv, true); + bv->updateInset(this); break; case -1: @@ -779,7 +773,7 @@ dispatch_result InsetFormulaBase::localD result = mathcursor->interpret(argument[0]) ? DISPATCHED : FINISHED_RIGHT; else mathcursor->insert(asArray(argument)); - updateLocal(bv, true); + bv->updateInset(this); } break; @@ -796,7 +790,7 @@ dispatch_result InsetFormulaBase::localD case LFUN_INSET_TOGGLE: mathcursor->insetToggle(); - updateLocal(bv, true); + bv->updateInset(this); break; case LFUN_DIALOG_SHOW_NEW_INSET: { @@ -833,7 +827,7 @@ dispatch_result InsetFormulaBase::localD } } if (result == DISPATCHED) - updateLocal(bv, true); + bv->updateInset(this); } break; @@ -970,7 +964,7 @@ bool InsetFormulaBase::searchForward(Buf mathcursor->setSelection(it, ar.size()); current = it; it.jump(ar.size()); - updateLocal(bv, false); + bv->updateInset(this); return true; } } Index: mathed/formulabase.h =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/formulabase.h,v retrieving revision 1.61 diff -u -p -r1.61 formulabase.h --- mathed/formulabase.h 17 Mar 2003 01:34:36 -0000 1.61 +++ mathed/formulabase.h 19 Mar 2003 00:35:21 -0000 @@ -89,8 +89,6 @@ public: /// virtual MathAtom & par() = 0; /// - virtual void updateLocal(BufferView * bv, bool mark_dirty); - /// // And shouldn't this really return a shared_ptr<BufferView> instead? BufferView * view() const; Index: mathed/math_gridinset.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/math_gridinset.C,v retrieving revision 1.94 diff -u -p -r1.94 math_gridinset.C --- mathed/math_gridinset.C 11 Mar 2003 09:25:47 -0000 1.94 +++ mathed/math_gridinset.C 19 Mar 2003 00:35:23 -0000 @@ -1041,7 +1041,6 @@ dispatch_result MathGridInset::dispatch case LFUN_TABINSERT: //bv->lockedInsetStoreUndo(Undo::EDIT); splitCell(idx, pos); - //updateLocal(bv, true); return DISPATCHED_POP; case LFUN_BREAKLINE: { @@ -1061,7 +1060,6 @@ dispatch_result MathGridInset::dispatch pos = cell(idx).size(); //mathcursor->normalize(); - //updateLocal(bv, true); return DISPATCHED_POP; } Index: mathed/math_hullinset.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/math_hullinset.C,v retrieving revision 1.70 diff -u -p -r1.70 math_hullinset.C --- mathed/math_hullinset.C 17 Mar 2003 16:24:59 -0000 1.70 +++ mathed/math_hullinset.C 19 Mar 2003 00:35:24 -0000 @@ -768,7 +768,6 @@ dispatch_result MathHullInset::dispatch for (row_type row = 0; row < nrows(); ++row) numbered(row, !old); //bv->owner()->message(old ? _("No number") : _("Number")); - //updateLocal(bv, true); } return DISPATCHED; @@ -779,7 +778,6 @@ dispatch_result MathHullInset::dispatch bool old = numbered(r); //bv->owner()->message(old ? _("No number") : _("Number")); numbered(r, !old); - //updateLocal(bv, true); } return DISPATCHED; Index: mathed/ref_inset.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/ref_inset.C,v retrieving revision 1.21 diff -u -p -r1.21 ref_inset.C --- mathed/ref_inset.C 4 Mar 2003 16:39:13 -0000 1.21 +++ mathed/ref_inset.C 19 Mar 2003 00:35:25 -0000 @@ -137,7 +137,7 @@ dispatch_result RefInset::localDispatch( // if (cmd.view()) // // This does not compile because updateInset expects // // an Inset* and 'this' isn't. -// cmd.view()->updateInset(this, true); +// cmd.view()->updateInset(this); return DISPATCHED; }