mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-27 06:19:36 +00:00
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:
parent
fd355bbb2f
commit
890bba60e4
@ -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);
|
||||
|
@ -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
|
||||
|
@ -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.
|
||||
|
@ -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;
|
||||
}
|
||||
|
31
src/text3.C
31
src/text3.C
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user