Cruft removal, small clean-up, no functional changes.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@8234 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Angus Leeming 2003-12-12 10:05:21 +00:00
parent fd355bbb2f
commit 890bba60e4
5 changed files with 29 additions and 37 deletions

View File

@ -1131,26 +1131,6 @@ bool BufferView::Pimpl::dispatch(FuncRequest const & ev_in)
mathDispatch(ev);
break;
case LFUN_INSET_APPLY: {
#warning is this code ever called?
// Remove if not triggered. Mail lyx-devel if triggered.
// This code was replaced by code in text3.C.
BOOST_ASSERT(false);
string const name = ev.getArg(0);
InsetBase * inset = owner_->getDialogs().getOpenInset(name);
if (inset) {
// This works both for 'original' and 'mathed' insets.
// Note that the localDispatch performs update also.
FuncRequest fr(bv_, LFUN_INSET_MODIFY, ev.argument);
inset->dispatch(fr);
} else {
FuncRequest fr(bv_, LFUN_INSET_INSERT, ev.argument);
dispatch(fr);
}
}
break;
case LFUN_INSET_INSERT: {
// Same as above.
BOOST_ASSERT(false);

View File

@ -1,3 +1,10 @@
2003-12-11 Angus Leeming <leeming@lyx.org>
* BufferView_pimpl.C (dispatch): remove LFUN_INSET_APPLY code
as it is now handled in LyXText::dispatch.
* text3.C (doInsertInset): remove a level of nesting.
2003-12-11 Angus Leeming <leeming@lyx.org>
* factory.C (createInset): changes due to the changed interface to

View File

@ -1,3 +1,7 @@
2003-12-12 Angus Leeming <leeming@lyx.org>
* mailinset.C (print_mailer_error): tidy up the output.
2003-12-11 Angus Leeming <leeming@lyx.org>
* mailinset.[Ch] (print_mailer_error): new helper function.

View File

@ -47,7 +47,7 @@ void MailInset::hideDialog() const
void print_mailer_error(string const & class_name,
string const & data, int arg_id, string const & arg)
{
lyxerr << class_name << "::string2params(" << data << ")\n"
<< "Expected arg " << arg_id << "to be \"" << arg << '"'
lyxerr << '\n' << class_name << "::string2params(" << data << ")\n"
<< "Expected arg " << arg_id << " to be \"" << arg << "\"\n"
<< std::endl;
}

View File

@ -418,22 +418,23 @@ void doInsertInset(LyXText const & lt, FuncRequest const & cmd,
bool edit, bool pastesel)
{
InsetOld * inset = createInset(cmd);
if (!inset)
return;
BufferView * bv = cmd.view();
if (inset) {
bool gotsel = false;
if (lt.selection.set()) {
bv->owner()->dispatch(FuncRequest(LFUN_CUT));
gotsel = true;
}
if (bv->insertInset(inset)) {
if (edit)
inset->edit(bv, true);
if (gotsel && pastesel)
bv->owner()->dispatch(FuncRequest(LFUN_PASTE));
} else
delete inset;
bool gotsel = false;
if (lt.selection.set()) {
bv->owner()->dispatch(FuncRequest(LFUN_CUT));
gotsel = true;
}
if (bv->insertInset(inset)) {
if (edit)
inset->edit(bv, true);
if (gotsel && pastesel)
bv->owner()->dispatch(FuncRequest(LFUN_PASTE));
} else
delete inset;
}
} // anon namespace
@ -877,10 +878,10 @@ DispatchResult LyXText::dispatch(FuncRequest const & cmd)
case LFUN_INSET_INSERT: {
InsetOld * inset = createInset(cmd);
if (!inset || !bv->insertInset(inset))
if (inset && !bv->insertInset(inset))
delete inset;
break;
}
}
case LFUN_INSET_SETTINGS:
bv->cursor().innerInset()->showInsetDialog(bv);