]> git.lyx.org Git - features.git/commitdiff
OK, let's actually get this nomencl-insert thing right.
authorRichard Heck <rgheck@comcast.net>
Sat, 9 Aug 2008 16:15:49 +0000 (16:15 +0000)
committerRichard Heck <rgheck@comcast.net>
Sat, 9 Aug 2008 16:15:49 +0000 (16:15 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@26109 a592a061-630c-0410-9148-cb99ea01b6c8

src/Text3.cpp

index 13e3669e8a1dd27c65c876574ea8b56762ea4f77..6cc9446f0d062b905e0b5521a20d3de4b386dffe 100644 (file)
@@ -1432,21 +1432,12 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd)
 
        case LFUN_NOMENCL_INSERT: {
                InsetCommandParams p(NOMENCL_CODE);
-               if (cmd.argument().empty()) {
+               if (cmd.argument().empty())
                        p["symbol"] = bv->cursor().innerText()->getStringToIndex(bv->cursor());
-                       string const data = InsetCommand::params2string("nomenclature", p);
-                       bv->showDialog("nomenclature", data);
-                       break;
-               }
-               // this back and forth checks the validity of the data
-               InsetCommand::string2params("nomenclature", to_utf8(cmd.argument()), p);
+               else
+                       p["symbol"] = cmd.argument();
                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);
-                       dispatch(cur, fr);
-               }
+               bv->showDialog("nomenclature", data);   
                break;
        }
 
@@ -1997,10 +1988,7 @@ bool Text::getStatus(Cursor & cur, FuncRequest const & cmd,
                code = TOC_CODE;
                break;
        case LFUN_HYPERLINK_INSERT:
-               if (cur.selection() && 
-                   (cur.isMultiCell() ||
-                   cur.selBegin().pit() != cur.selEnd().pit())
-                        ) {
+               if (cur.selIsMultiCell() || cur.selIsMultiLine()) {
                        enable = false;
                        break;
                }