X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Fmathed%2FInsetMathRef.cpp;h=ef08cbcd3d0610d95c8b9446e85b5959261822fe;hb=cdc847fd304019a19425a0d5d9d42a556a937097;hp=14d3a35e2942a7b717a9af465d5f0df4a5fa2e1e;hpb=c5b9664476770aad788572fd4a16ec89ca4382ab;p=lyx.git diff --git a/src/mathed/InsetMathRef.cpp b/src/mathed/InsetMathRef.cpp index 14d3a35e29..ef08cbcd3d 100644 --- a/src/mathed/InsetMathRef.cpp +++ b/src/mathed/InsetMathRef.cpp @@ -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; } @@ -74,7 +75,7 @@ void InsetMathRef::doDispatch(Cursor & cur, FuncRequest & cmd) break; case LFUN_INSET_DIALOG_UPDATE: { - string const data = createDialogStr("ref"); + string const data = createDialogStr(); cur.bv().updateDialog("ref", data); break; } @@ -88,7 +89,7 @@ void InsetMathRef::doDispatch(Cursor & cur, FuncRequest & cmd) } if (cmd.button() == mouse_button::button1) { // Eventually trigger dialog with button 3, not 1 - string const data = createDialogStr("ref"); + string const data = createDialogStr(); cur.bv().showDialog("ref", data, this); break; } @@ -183,11 +184,11 @@ void InsetMathRef::updateBuffer(ParIterator const & it, UpdateType /*utype*/) return; } // register this inset into the buffer reference cache. - buffer().references(getTarget()).push_back(make_pair(this, it)); + buffer().addReference(getTarget(), this, it); } -string const InsetMathRef::createDialogStr(string const & /*name*/) const +string const InsetMathRef::createDialogStr() const { InsetCommandParams icp(REF_CODE, to_ascii(commandname())); icp["reference"] = asString(cell(0));