mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-07 12:32:26 +00:00
Fix my fix for nomencl-insert. The previous one was just a thinko.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@26108 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
3d03620a91
commit
efbf10c5ad
@ -1432,14 +1432,18 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd)
|
|||||||
|
|
||||||
case LFUN_NOMENCL_INSERT: {
|
case LFUN_NOMENCL_INSERT: {
|
||||||
InsetCommandParams p(NOMENCL_CODE);
|
InsetCommandParams p(NOMENCL_CODE);
|
||||||
docstring const content = cmd.argument().empty() ?
|
if (cmd.argument().empty()) {
|
||||||
bv->cursor().innerText()->getStringToIndex(bv->cursor()) :
|
p["symbol"] = bv->cursor().innerText()->getStringToIndex(bv->cursor());
|
||||||
cmd.argument();
|
string const data = InsetCommand::params2string("nomenclature", p);
|
||||||
p["symbol"] = content;
|
|
||||||
string const data = InsetCommand::params2string("nomenclature", p);
|
|
||||||
if (p["symbol"].empty()) {
|
|
||||||
bv->showDialog("nomenclature", data);
|
bv->showDialog("nomenclature", data);
|
||||||
} else {
|
break;
|
||||||
|
}
|
||||||
|
// this back and forth checks the validity of the data
|
||||||
|
InsetCommand::string2params("nomenclature", to_utf8(cmd.argument()), p);
|
||||||
|
string const data = InsetCommand::params2string("nomenclature", p);
|
||||||
|
if (p["symbol"].empty() || p["description"].empty())
|
||||||
|
bv->showDialog("nomenclature", data);
|
||||||
|
else {
|
||||||
FuncRequest fr(LFUN_INSET_INSERT, data);
|
FuncRequest fr(LFUN_INSET_INSERT, data);
|
||||||
dispatch(cur, fr);
|
dispatch(cur, fr);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user