diff --git a/src/BufferView_pimpl.C b/src/BufferView_pimpl.C index ea00412459..2527b90044 100644 --- a/src/BufferView_pimpl.C +++ b/src/BufferView_pimpl.C @@ -965,6 +965,7 @@ FuncStatus BufferView::Pimpl::getStatus(FuncRequest const & cmd) case LFUN_INSERT_LABEL: case LFUN_BOOKMARK_SAVE: case LFUN_REF_GOTO: + case LFUN_GOTO_PARAGRAPH: case LFUN_WORD_FIND: case LFUN_WORD_REPLACE: case LFUN_MARK_OFF: @@ -1088,6 +1089,26 @@ bool BufferView::Pimpl::dispatch(FuncRequest const & cmd) break; } + case LFUN_GOTO_PARAGRAPH: { + int const id = convert(cmd.argument); + ParIterator par = buffer_->getParFromID(id); + if (par == buffer_->par_iterator_end()) { + lyxerr[Debug::INFO] << "No matching paragraph found! [" + << id << ']' << endl; + break; + } else { + lyxerr[Debug::INFO] << "Paragraph " << par->id() + << " found." << endl; + } + + // Set the cursor + bv_->setCursor(par, 0); + + update(); + switchKeyMap(); + break; + } + case LFUN_TRACK_CHANGES: trackChanges(); break; diff --git a/src/ChangeLog b/src/ChangeLog index da9c5ff1f3..cdca927836 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,13 @@ +2005-02-09 Jean-Marc Lasgouttes + + * BufferView_pimpl.C (dispatch): handle LFUN_GOTO_PARAGRAPH here, + but use update() to get correct screen display; use convert + instead of istringstream. + (getStatus): handle LFUN_GOTO_PARAGRAPH + + * lyxfunc.C (dispatch, getStatus): do not handle + LFUN_GOTO_PARAGRAPH here. + 2005-02-08 Lars Gullik Bjonnes * text3.C (dispatch): size() -> depth() diff --git a/src/lyxfunc.C b/src/lyxfunc.C index ef698a9fbe..6085a5bbe6 100644 --- a/src/lyxfunc.C +++ b/src/lyxfunc.C @@ -547,7 +547,6 @@ FuncStatus LyXFunc::getStatus(FuncRequest const & cmd) const case LFUN_GETNAME: case LFUN_NOTIFY: case LFUN_GOTOFILEROW: - case LFUN_GOTO_PARAGRAPH: case LFUN_DIALOG_SHOW_NEXT_INSET: case LFUN_DIALOG_HIDE: case LFUN_DIALOG_DISCONNECT_INSET: @@ -1101,32 +1100,6 @@ void LyXFunc::dispatch(FuncRequest const & cmd) break; } - case LFUN_GOTO_PARAGRAPH: { - istringstream is(argument); - int id; - is >> id; - ParIterator par = owner->buffer()->getParFromID(id); - if (par == owner->buffer()->par_iterator_end()) { - lyxerr[Debug::INFO] << "No matching paragraph found! [" - << id << ']' << endl; - break; - } else { - lyxerr[Debug::INFO] << "Paragraph " << par->id() - << " found." << endl; - } - - // Set the cursor - view()->setCursor(par, 0); - - view()->switchKeyMap(); - owner->view_state_changed(); - - view()->center(); - // see BufferView_pimpl::center() - view()->updateScrollbar(); - break; - } - case LFUN_DIALOG_SHOW: { string const name = cmd.getArg(0); string data = trim(cmd.argument.substr(name.size()));