fix bug 1569 (insert->label suggestion)

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@8667 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
John Levon 2004-04-19 02:39:05 +00:00
parent 7be1d7a717
commit 7a4a8abd42
3 changed files with 17 additions and 12 deletions

View File

@ -1022,16 +1022,6 @@ bool BufferView::Pimpl::dispatch(FuncRequest const & cmd)
cur.message(cur.currentState());
break;
case LFUN_INSERT_LABEL: {
// Try and generate a valid label
string const contents = cmd.argument.empty() ?
cur.getPossibleLabel() : cmd.argument;
InsetCommandParams icp("label", contents);
string data = InsetCommandMailer::params2string("label", icp);
owner_->getDialogs().show("label", data, 0);
break;
}
case LFUN_BOOKMARK_SAVE:
savePosition(strToUnsignedInt(cmd.argument));
break;

View File

@ -1,3 +1,8 @@
2004-04-19 John Levon <levon@movementarian.org>
* BufferView_pimpl.C:
* text3.C: fix bug 1569 (insert->label doesn't give suggestion)
2004-04-05 Angus Leeming <leeming@lyx.org>
* text.C (redoParagraphs): add call to updateCounters(), thereby

View File

@ -1245,9 +1245,19 @@ void LyXText::dispatch(LCursor & cur, FuncRequest & cmd)
}
case LFUN_INSERT_LABEL: {
InsetCommandParams p("label");
// Try to generate a valid label
string const contents = cmd.argument.empty() ?
cur.getPossibleLabel() : cmd.argument;
InsetCommandParams p("label", contents);
string const data = InsetCommandMailer::params2string("label", p);
bv->owner()->getDialogs().show("label", data, 0);
if (cmd.argument.empty()) {
bv->owner()->getDialogs().show("label", data, 0);
} else {
FuncRequest fr(LFUN_INSET_INSERT, data);
dispatch(cur, fr);
}
break;
}