mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-22 21:21:32 +00:00
Try to finally fix #6930. All the paths that did not come from context
menus were (intentionally) missing, and it turns out they were needed. Normally all invocations of INSET_MODIFY should trigger a recordUndo now. Of course all cases have not been tested, but it should be working. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@36770 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
4ae901ee70
commit
838af80834
@ -122,6 +122,9 @@ void InsetBibitem::doDispatch(Cursor & cur, FuncRequest & cmd)
|
||||
cur.noScreenUpdate();
|
||||
break;
|
||||
}
|
||||
|
||||
cur.recordUndo();
|
||||
|
||||
docstring const & old_key = params()["key"];
|
||||
docstring const & old_label = params()["label"];
|
||||
docstring label = p["label"];
|
||||
|
@ -103,7 +103,8 @@ void InsetBibtex::doDispatch(Cursor & cur, FuncRequest & cmd)
|
||||
throw message;
|
||||
break;
|
||||
}
|
||||
//
|
||||
|
||||
cur.recordUndo();
|
||||
setParams(p);
|
||||
buffer().invalidateBibfileCache();
|
||||
cur.forceBufferUpdate();
|
||||
|
@ -192,8 +192,8 @@ void InsetBox::doDispatch(Cursor & cur, FuncRequest & cmd)
|
||||
|
||||
case LFUN_INSET_MODIFY: {
|
||||
//lyxerr << "InsetBox::dispatch MODIFY" << endl;
|
||||
cur.recordUndoInset(ATOMIC_UNDO, this);
|
||||
if (cmd.getArg(0) == "changetype") {
|
||||
cur.recordUndoInset(ATOMIC_UNDO, this);
|
||||
params_.type = cmd.getArg(1);
|
||||
} else
|
||||
string2params(to_utf8(cmd.argument()), params_);
|
||||
|
@ -116,6 +116,8 @@ void InsetBranch::doDispatch(Cursor & cur, FuncRequest & cmd)
|
||||
case LFUN_INSET_MODIFY: {
|
||||
InsetBranchParams params;
|
||||
InsetBranch::string2params(to_utf8(cmd.argument()), params);
|
||||
|
||||
cur.recordUndoInset(ATOMIC_UNDO, this);
|
||||
params_.branch = params.branch;
|
||||
// what we really want here is a TOC update, but that means
|
||||
// a full buffer update
|
||||
|
@ -156,8 +156,10 @@ void InsetCommand::doDispatch(Cursor & cur, FuncRequest & cmd)
|
||||
InsetCommand::string2params(to_utf8(cmd.argument()), p);
|
||||
if (p.getCmdName().empty())
|
||||
cur.noScreenUpdate();
|
||||
else
|
||||
else {
|
||||
cur.recordUndo();
|
||||
setParams(p);
|
||||
}
|
||||
// FIXME We might also want to check here if this one is in the TOC.
|
||||
// But I think most of those are labeled.
|
||||
if (isLabeled())
|
||||
|
@ -114,6 +114,7 @@ void InsetERT::doDispatch(Cursor & cur, FuncRequest & cmd)
|
||||
switch (cmd.action()) {
|
||||
case LFUN_INSET_MODIFY:
|
||||
if (cmd.getArg(0) == "ert") {
|
||||
cur.recordUndoInset(ATOMIC_UNDO, this);
|
||||
setStatus(cur, string2params(to_utf8(cmd.argument())));
|
||||
break;
|
||||
}
|
||||
|
@ -420,6 +420,7 @@ void InsetExternal::doDispatch(Cursor & cur, FuncRequest & cmd)
|
||||
case LFUN_INSET_MODIFY: {
|
||||
InsetExternalParams p;
|
||||
string2params(to_utf8(cmd.argument()), buffer(), p);
|
||||
cur.recordUndo();
|
||||
setParams(p);
|
||||
break;
|
||||
}
|
||||
|
@ -142,6 +142,7 @@ void InsetFloat::doDispatch(Cursor & cur, FuncRequest & cmd)
|
||||
case LFUN_INSET_MODIFY: {
|
||||
InsetFloatParams params;
|
||||
string2params(to_utf8(cmd.argument()), params);
|
||||
cur.recordUndoInset(ATOMIC_UNDO, this);
|
||||
|
||||
// placement, wide and sideways are not used for subfloats
|
||||
if (!params_.subfloat) {
|
||||
|
@ -210,6 +210,7 @@ void InsetGraphics::doDispatch(Cursor & cur, FuncRequest & cmd)
|
||||
break;
|
||||
}
|
||||
|
||||
cur.recordUndo();
|
||||
setParams(p);
|
||||
// if the inset is part of a graphics group, all the
|
||||
// other members should be updated too.
|
||||
|
@ -277,6 +277,7 @@ void InsetInclude::doDispatch(Cursor & cur, FuncRequest & cmd)
|
||||
}
|
||||
}
|
||||
}
|
||||
cur.recordUndo();
|
||||
setParams(p);
|
||||
cur.forceBufferUpdate();
|
||||
} else
|
||||
|
@ -213,6 +213,7 @@ void InsetIndex::doDispatch(Cursor & cur, FuncRequest & cmd)
|
||||
}
|
||||
InsetIndexParams params;
|
||||
InsetIndex::string2params(to_utf8(cmd.argument()), params);
|
||||
cur.recordUndoInset(ATOMIC_UNDO, this);
|
||||
params_.index = params.index;
|
||||
// what we really want here is a TOC update, but that means
|
||||
// a full buffer update
|
||||
|
@ -196,8 +196,10 @@ void InsetLabel::doDispatch(Cursor & cur, FuncRequest & cmd)
|
||||
cur.noScreenUpdate();
|
||||
break;
|
||||
}
|
||||
if (p["name"] != params()["name"])
|
||||
if (p["name"] != params()["name"]) {
|
||||
// undo is handled in updateCommand
|
||||
updateCommand(p["name"]);
|
||||
}
|
||||
cur.forceBufferUpdate();
|
||||
break;
|
||||
}
|
||||
|
@ -77,6 +77,7 @@ void InsetLine::doDispatch(Cursor & cur, FuncRequest & cmd)
|
||||
cur.noScreenUpdate();
|
||||
break;
|
||||
}
|
||||
cur.recordUndo();
|
||||
setParams(p);
|
||||
break;
|
||||
}
|
||||
|
@ -320,6 +320,7 @@ void InsetListings::doDispatch(Cursor & cur, FuncRequest & cmd)
|
||||
switch (cmd.action()) {
|
||||
|
||||
case LFUN_INSET_MODIFY: {
|
||||
cur.recordUndoInset(ATOMIC_UNDO, this);
|
||||
InsetListings::string2params(to_utf8(cmd.argument()), params());
|
||||
break;
|
||||
}
|
||||
|
@ -175,6 +175,8 @@ void InsetPrintNomencl::doDispatch(Cursor & cur, FuncRequest & cmd)
|
||||
cur.noScreenUpdate();
|
||||
break;
|
||||
}
|
||||
|
||||
cur.recordUndo();
|
||||
setParams(p);
|
||||
break;
|
||||
}
|
||||
|
@ -5114,7 +5114,7 @@ void InsetTabular::tabularFeatures(Cursor & cur,
|
||||
break;
|
||||
}
|
||||
|
||||
cur.recordUndoInset(ATOMIC_UNDO);
|
||||
cur.recordUndoInset(ATOMIC_UNDO, this);
|
||||
|
||||
getSelection(cur, sel_row_start, sel_row_end, sel_col_start, sel_col_end);
|
||||
row_type const row = tabular.cellRow(cur.idx());
|
||||
|
@ -80,6 +80,7 @@ void InsetWrap::doDispatch(Cursor & cur, FuncRequest & cmd)
|
||||
{
|
||||
switch (cmd.action()) {
|
||||
case LFUN_INSET_MODIFY: {
|
||||
cur.recordUndoInset(ATOMIC_UNDO, this);
|
||||
InsetWrapParams params;
|
||||
InsetWrap::string2params(to_utf8(cmd.argument()), params);
|
||||
params_.lines = params.lines;
|
||||
|
@ -66,6 +66,7 @@ void InsetMathRef::doDispatch(Cursor & cur, FuncRequest & cmd)
|
||||
if (cmd.getArg(0) == "ref") {
|
||||
MathData ar;
|
||||
if (createInsetMath_fromDialogStr(cmd.argument(), ar)) {
|
||||
cur.recordUndo();
|
||||
*this = *ar[0].nucleus()->asRefInset();
|
||||
break;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user