From 890bba60e4e1b7bb5fe1697003cd8ba38e7d7c04 Mon Sep 17 00:00:00 2001 From: Angus Leeming Date: Fri, 12 Dec 2003 10:05:21 +0000 Subject: [PATCH] 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 --- src/BufferView_pimpl.C | 20 -------------------- src/ChangeLog | 7 +++++++ src/insets/ChangeLog | 4 ++++ src/insets/mailinset.C | 4 ++-- src/text3.C | 31 ++++++++++++++++--------------- 5 files changed, 29 insertions(+), 37 deletions(-) diff --git a/src/BufferView_pimpl.C b/src/BufferView_pimpl.C index c73217116d..5ce24356e0 100644 --- a/src/BufferView_pimpl.C +++ b/src/BufferView_pimpl.C @@ -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); diff --git a/src/ChangeLog b/src/ChangeLog index 904f529447..e4ec0f3792 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,10 @@ +2003-12-11 Angus Leeming + + * 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 * factory.C (createInset): changes due to the changed interface to diff --git a/src/insets/ChangeLog b/src/insets/ChangeLog index fd2e2881cb..c9fcb305a8 100644 --- a/src/insets/ChangeLog +++ b/src/insets/ChangeLog @@ -1,3 +1,7 @@ +2003-12-12 Angus Leeming + + * mailinset.C (print_mailer_error): tidy up the output. + 2003-12-11 Angus Leeming * mailinset.[Ch] (print_mailer_error): new helper function. diff --git a/src/insets/mailinset.C b/src/insets/mailinset.C index 48b2cf2b48..6c63619af5 100644 --- a/src/insets/mailinset.C +++ b/src/insets/mailinset.C @@ -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; } diff --git a/src/text3.C b/src/text3.C index b42ee51d0b..75b58c7473 100644 --- a/src/text3.C +++ b/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); -- 2.39.5