]> git.lyx.org Git - features.git/commitdiff
fix display when jumping to a toc entry
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Wed, 9 Feb 2005 11:27:21 +0000 (11:27 +0000)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Wed, 9 Feb 2005 11:27:21 +0000 (11:27 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@9606 a592a061-630c-0410-9148-cb99ea01b6c8

src/BufferView_pimpl.C
src/ChangeLog
src/lyxfunc.C

index ea00412459f872af0c45d6f0788eccf6b67ece07..2527b900449661f1b3802714004e85400b2ca28d 100644 (file)
@@ -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<int>(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;
index da9c5ff1f30c6e7d684b5844aded48a7abd18b6d..cdca9278365f386967d6c774a4b8d11f167e9509 100644 (file)
@@ -1,3 +1,13 @@
+2005-02-09  Jean-Marc Lasgouttes  <lasgouttes@lyx.org>
+
+       * 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  <larsbj@gullik.net>
 
        * text3.C (dispatch): size() -> depth()
index ef698a9fbef972efb0984bbb58018bf4fa07638e..6085a5bbe6174a52fb6a07b216f589d4d3305b7f 100644 (file)
@@ -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()));