From 7a4a8abd426b3a1e5242e6ebd40d842913086e66 Mon Sep 17 00:00:00 2001 From: John Levon Date: Mon, 19 Apr 2004 02:39:05 +0000 Subject: [PATCH] fix bug 1569 (insert->label suggestion) git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@8667 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/BufferView_pimpl.C | 10 ---------- src/ChangeLog | 5 +++++ src/text3.C | 14 ++++++++++++-- 3 files changed, 17 insertions(+), 12 deletions(-) diff --git a/src/BufferView_pimpl.C b/src/BufferView_pimpl.C index 9c0a6710bc..72e072490a 100644 --- a/src/BufferView_pimpl.C +++ b/src/BufferView_pimpl.C @@ -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; diff --git a/src/ChangeLog b/src/ChangeLog index 40424c830d..d5da907c6d 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2004-04-19 John Levon + + * BufferView_pimpl.C: + * text3.C: fix bug 1569 (insert->label doesn't give suggestion) + 2004-04-05 Angus Leeming * text.C (redoParagraphs): add call to updateCounters(), thereby diff --git a/src/text3.C b/src/text3.C index d4e09ee7bf..ffa454b086 100644 --- a/src/text3.C +++ b/src/text3.C @@ -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; } -- 2.39.5