X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Fmathed%2FInsetMathRef.cpp;h=ae1768351c426d20af4ab680e98282ad9c864222;hb=55a3dd7b346d29a52ba305a4558e9e380ef50f47;hp=2cbad4ca56e4d4dd3e000214246d612cfea89194;hpb=5577e877bb0a25a0919db09b10effe9f54ff1333;p=lyx.git diff --git a/src/mathed/InsetMathRef.cpp b/src/mathed/InsetMathRef.cpp index 2cbad4ca56..ae1768351c 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; } @@ -187,13 +188,13 @@ void InsetMathRef::updateBuffer(ParIterator const & it, UpdateType /*utype*/) } -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)); if (!cell(1).empty()) icp["name"] = asString(cell(1)); - return InsetCommand::params2string(name, icp); + return InsetCommand::params2string(icp); } @@ -212,7 +213,7 @@ void InsetMathRef::changeTarget(docstring const & target) MathData ar; Buffer & buf = buffer(); if (createInsetMath_fromDialogStr( - from_utf8(InsetCommand::params2string("ref", icp)), ar)) { + from_utf8(InsetCommand::params2string(icp)), ar)) { *this = *ar[0].nucleus()->asRefInset(); // FIXME audit setBuffer calls setBuffer(buf);