From 3d03620a91b055c55453e8251cc024f6be75a590 Mon Sep 17 00:00:00 2001 From: Richard Heck Date: Sat, 9 Aug 2008 03:11:53 +0000 Subject: [PATCH] Convert LFUN_NOMENCL_INSERT to the newer style, fixing bug 5151. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@26107 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/Text3.cpp | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/src/Text3.cpp b/src/Text3.cpp index 993aa9810e..e116e3ed89 100644 --- a/src/Text3.cpp +++ b/src/Text3.cpp @@ -1431,21 +1431,18 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd) } case LFUN_NOMENCL_INSERT: { - FuncRequest cmd1 = cmd; - if (cmd.argument().empty()) - cmd1 = FuncRequest(cmd, - bv->cursor().innerText()->getStringToIndex(bv->cursor())); - Inset * inset = createInset(cur.bv().buffer(), cmd1); - if (!inset) - break; - cur.recordUndo(); - cur.clearSelection(); - insertInset(cur, inset); - // Show the dialog for the nomenclature entry, since the - // description entry still needs to be filled in. - if (cmd.action == LFUN_NOMENCL_INSERT) - inset->edit(cur, true); - cur.posForward(); + InsetCommandParams p(NOMENCL_CODE); + docstring const content = cmd.argument().empty() ? + bv->cursor().innerText()->getStringToIndex(bv->cursor()) : + cmd.argument(); + p["symbol"] = content; + string const data = InsetCommand::params2string("nomenclature", p); + if (p["symbol"].empty()) { + bv->showDialog("nomenclature", data); + } else { + FuncRequest fr(LFUN_INSET_INSERT, data); + dispatch(cur, fr); + } break; }