This patch reduces complexity some more by making us examine the lfun
flags for deciding if the buffer has changed or not, hence removing
BufferView::CHANGE
There are only a couple of cases where we have to special-case
and set markDirty explicitly:
o the collapsable inset handling. This affects the written out buffer
but is not easily lfun-able (there's a new word for you !)
o lyxreplace/replace word - these should be easily lfunable
Comments ?
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 18 Mar 2003 21:12:19 -0000
@@ -574,7 +574,7 @@ void BufferView::undo()
if (!textUndo(this))
owner()->message(_("No further undo information"));
else
- update(text, BufferView::SELECT|BufferView::FITCUR|BufferView::CHANGE);
+ update(text, BufferView::SELECT|BufferView::FITCUR);
switchKeyMap();
}
@@ -591,7 +591,7 @@ void BufferView::redo()
if (!textRedo(this))
owner()->message(_("No further redo information"));
else
- update(text, BufferView::SELECT|BufferView::FITCUR|BufferView::CHANGE);
+ update(text, BufferView::SELECT|BufferView::FITCUR);
switchKeyMap();
}
@@ -610,7 +610,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|BufferView::FITCUR);
}
}
@@ -677,7 +677,9 @@ 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|BufferView::FITCUR);
+ // FIXME: should be done through LFUN
+ buffer()->markDirty();
}
// End of spellchecker stuff
@@ -814,9 +816,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 18 Mar 2003 21:12:19 -0000
@@ -46,8 +46,7 @@ public:
enum UpdateCodes {
UPDATE = 0, //< FIXME
SELECT = 1, //< selection change
- FITCUR = 2, //< the cursor needs fitting into the view
- CHANGE = 4 //< document data has changed
+ FITCUR = 2 //< the cursor needs fitting into the view
};
/**
@@ -89,7 +88,7 @@ public:
// update for a particular lyxtext
void update(LyXText *, 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.345
diff -u -p -r1.345 BufferView_pimpl.C
--- BufferView_pimpl.C 17 Mar 2003 16:24:48 -0000 1.345
+++ BufferView_pimpl.C 18 Mar 2003 21:12:24 -0000
@@ -379,6 +379,8 @@ void BufferView::Pimpl::scrollDocView(in
vbt->setCursorFromCoordinates(0, first);
else if (vbt->cursor.y() > last)
vbt->setCursorFromCoordinates(0, last);
+
+ owner_->updateLayoutChoice();
}
@@ -528,48 +530,8 @@ 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)
{
- owner_->updateLayoutChoice();
-
if (!text->selection.set() && (f & SELECT)) {
text->selection.cursor = text->cursor;
}
@@ -578,7 +540,7 @@ 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();
}
@@ -586,10 +548,6 @@ void BufferView::Pimpl::update(LyXText *
if ((f & FITCUR)) {
fitCursor();
}
-
- if ((f & CHANGE)) {
- buffer_->markDirty();
- }
}
@@ -1132,9 +1090,7 @@ bool BufferView::Pimpl::dispatch(FuncReq
owner_->getIntl().getTransManager()
.TranslateAndInsert(ev.argument[0], bv_->getLyXText());
update(bv_->getLyXText(),
- BufferView::SELECT
- | BufferView::FITCUR
- | BufferView::CHANGE);
+ BufferView::SELECT | BufferView::FITCUR);
}
break;
@@ -1162,7 +1118,7 @@ bool BufferView::Pimpl::dispatch(FuncReq
} else {
Inset * inset = createInset(ev);
if (inset && insertInset(inset)) {
- updateInset(inset, true);
+ updateInset(inset);
} else {
delete inset;
}
@@ -1263,8 +1219,7 @@ bool BufferView::Pimpl::dispatch(FuncReq
while (lyxfind::findNextChange(bv_)) {
bv_->getLyXText()->acceptChange();
}
- update(bv_->text,
- BufferView::SELECT | BufferView::FITCUR | BufferView::CHANGE);
+ update(bv_->text, BufferView::SELECT | BufferView::FITCUR);
break;
}
@@ -1278,21 +1233,21 @@ bool BufferView::Pimpl::dispatch(FuncReq
bv_->getLyXText()->rejectChange();
}
update(bv_->text,
- BufferView::SELECT | BufferView::FITCUR | BufferView::CHANGE);
+ BufferView::SELECT | BufferView::FITCUR);
break;
}
case LFUN_ACCEPT_CHANGE: {
bv_->getLyXText()->acceptChange();
update(bv_->text,
- BufferView::SELECT | BufferView::FITCUR | BufferView::CHANGE);
+ BufferView::SELECT | BufferView::FITCUR);
break;
}
case LFUN_REJECT_CHANGE: {
bv_->getLyXText()->rejectChange();
update(bv_->text,
- BufferView::SELECT | BufferView::FITCUR | BufferView::CHANGE);
+ BufferView::SELECT | BufferView::FITCUR);
break;
}
@@ -1326,13 +1281,13 @@ bool BufferView::Pimpl::insertInset(Inse
if (!lout.empty()) {
update(bv_->text, BufferView::SELECT|BufferView::FITCUR);
bv_->text->breakParagraph(bv_->buffer()->paragraphs);
- update(bv_->text,
BufferView::SELECT|BufferView::FITCUR|BufferView::CHANGE);
+ update(bv_->text, BufferView::SELECT|BufferView::FITCUR);
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(bv_->text, BufferView::SELECT|BufferView::FITCUR);
}
string lres = lout;
@@ -1358,18 +1313,18 @@ bool BufferView::Pimpl::insertInset(Inse
LYX_ALIGN_LAYOUT,
string(),
0);
- update(bv_->text,
BufferView::SELECT|BufferView::FITCUR|BufferView::CHANGE);
+ update(bv_->text, BufferView::SELECT|BufferView::FITCUR);
}
bv_->text->insertInset(inset);
- update(bv_->text, BufferView::SELECT|BufferView::FITCUR|BufferView::CHANGE);
+ update(bv_->text, BufferView::SELECT|BufferView::FITCUR);
unFreezeUndo();
return true;
}
-void BufferView::Pimpl::updateInset(Inset * inset, bool mark_dirty)
+void BufferView::Pimpl::updateInset(Inset * inset)
{
if (!inset || !available())
return;
@@ -1379,18 +1334,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;
}
@@ -1407,14 +1356,7 @@ void BufferView::Pimpl::updateInset(Inse
if (tl_inset == inset) {
update(bv_->text, 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(bv_->text, BufferView::SELECT | BufferView::FITCUR);
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 18 Mar 2003 21:12:24 -0000
@@ -99,7 +99,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 18 Mar 2003 21:12:27 -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 | BufferView::FITCUR);
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 18 Mar 2003 21:12:34 -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 18 Mar 2003 21:12:36 -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"));
}
@@ -240,8 +239,8 @@ void changeDepth(BufferView * bv, LyXTex
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(bv->text, BufferView::SELECT|BufferView::FITCUR);
}
@@ -399,7 +398,7 @@ void toggleAndShow(BufferView * bv, LyXF
bv->hideCursor();
bv->update(text, BufferView::SELECT | BufferView::FITCUR);
text->toggleFree(font, toggleall);
- bv->update(text, BufferView::SELECT | BufferView::FITCUR | BufferView::CHANGE);
+ bv->update(text, BufferView::SELECT | BufferView::FITCUR);
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 18 Mar 2003 21:12:41 -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(bv->text, BufferView::SELECT|BufferView::FITCUR);
}
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 18 Mar 2003 21:12:41 -0000
@@ -96,12 +96,15 @@ int LyXReplace(BufferView * bv,
bv->toggleSelection(false);
text->replaceSelectionWithString(replacestr);
text->setSelectionRange(replacestr.length());
- bv->update(text,
BufferView::SELECT|BufferView::FITCUR|BufferView::CHANGE);
+ bv->update(text, BufferView::SELECT|BufferView::FITCUR);
++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();
return replace_count;
}
Index: lyxfunc.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/lyxfunc.C,v
retrieving revision 1.417
diff -u -p -r1.417 lyxfunc.C
--- lyxfunc.C 17 Mar 2003 16:24:52 -0000 1.417
+++ lyxfunc.C 18 Mar 2003 21:12:46 -0000
@@ -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|BufferView::FITCUR);
TEXT(false)->selection.cursor = TEXT(false)->cursor;
}
@@ -1579,6 +1578,13 @@ void LyXFunc::dispatch(FuncRequest const
break;
} // end of switch
+ view()->owner()->updateLayoutChoice();
+
+ // 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 18 Mar 2003 21:12: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 18 Mar 2003 21:13:10 -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.50
diff -u -p -r1.50 text3.C
--- text3.C 18 Mar 2003 13:05:08 -0000 1.50
+++ text3.C 18 Mar 2003 21:13:16 -0000
@@ -60,14 +60,11 @@ 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->showCursor();
} else if (bv->text->status() != LyXText::UNCHANGED) {
@@ -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 | BufferView::FITCUR);
}
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;
@@ -1408,7 +1398,6 @@ Inset::RESULT LyXText::dispatch(FuncRequ
// Highly editable inset, like math
UpdatableInset * inset = static_cast<UpdatableInset
*>(inset_hit);
selection_possible = false;
- bv->owner()->updateLayoutChoice();
bv->owner()->message(inset->editMessage());
//inset->edit(bv, x, y, cmd.button());
// We just have to lock the inset before calling a PressEvent
on it!
@@ -1433,7 +1422,6 @@ Inset::RESULT LyXText::dispatch(FuncRequ
bv->text->selection.cursor = bv->text->cursor;
bv->text->cursor.x_fix(bv->text->cursor.x());
- bv->owner()->updateLayoutChoice();
if (bv->fitCursor())
selection_possible = false;
@@ -1550,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);
}
@@ -1564,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 18 Mar 2003 21:13:19 -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: frontends/controllers/ControlParagraph.C
===================================================================
RCS file:
/usr/local/lyx/cvsroot/lyx-devel/src/frontends/controllers/ControlParagraph.C,v
retrieving revision 1.18
diff -u -p -r1.18 ControlParagraph.C
--- frontends/controllers/ControlParagraph.C 14 Mar 2003 00:20:42 -0000 1.18
+++ frontends/controllers/ControlParagraph.C 18 Mar 2003 21:13:19 -0000
@@ -19,6 +19,9 @@
#include "ParagraphParameters.h"
#include "support/LAssert.h"
#include "Lsstream.h"
+#include "debug.h"
+
+using std::endl;
ControlParagraph::ControlParagraph(Dialog & parent)
@@ -48,7 +51,8 @@ bool ControlParagraph::initialiseParams(
lex.next();
bool const accept = lex.getBool();
action = accept ? 1 : 2;
- } else {
+ } else if (!token.empty()) {
+ lyxerr << "unreg " << token << endl;
// Unrecognised token
return false;
}
@@ -77,7 +81,8 @@ bool ControlParagraph::initialiseParams(
token == "\\ininset") {
lex.next();
Int = lex.getInteger();
- } else {
+ } else if (!token.empty()) {
+ lyxerr << "unrec " << token << endl;
// Unrecognised token
return false;
}
@@ -92,8 +97,10 @@ bool ControlParagraph::initialiseParams(
ininset_ = Int;
}
}
- if (nset != 3)
+ if (nset != 3) {
+ lyxerr << "not 3" << endl;
return false;
+ }
// If "update", then set the activation status of the button controller
if (action > 0) {
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 18 Mar 2003 21:13:32 -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 18 Mar 2003 21:13:32 -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 18 Mar 2003 21:13:32 -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 18 Mar 2003 21:13:35 -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 18 Mar 2003 21:13:35 -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 18 Mar 2003 21:13:37 -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 18 Mar 2003 21:13:37 -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 18 Mar 2003 21:13:39 -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 18 Mar 2003 21:13:41 -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 18 Mar 2003 21:13:42 -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 18 Mar 2003 21:13:42 -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 18 Mar 2003 21:13:42 -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 18 Mar 2003 21:13:47 -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 18 Mar 2003 21:13:52 -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 18 Mar 2003 21:13:52 -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 18 Mar 2003 21:13:52 -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 18 Mar 2003 21:13:54 -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 18 Mar 2003 21:13:55 -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 18 Mar 2003 21:13:57 -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 18 Mar 2003 21:13:58 -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 18 Mar 2003 21:13:58 -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;
}