diff --git a/src/BufferView.cpp b/src/BufferView.cpp index 4ce8ddb0a2..85ac21a8e3 100644 --- a/src/BufferView.cpp +++ b/src/BufferView.cpp @@ -1055,7 +1055,8 @@ bool BufferView::dispatch(FuncRequest const & cmd) } case LFUN_PARAGRAPH_GOTO: { - int const id = convert(to_utf8(cmd.argument())); + int const id = convert(cmd.getArg(0)); + int const pos = convert(cmd.getArg(1)); int i = 0; for (Buffer * b = &buffer_; i == 0 || b != &buffer_; b = theBufferList().next(b)) { @@ -1072,6 +1073,7 @@ bool BufferView::dispatch(FuncRequest const & cmd) if (b == &buffer_) { // Set the cursor + dit.pos() = pos; setCursor(dit); processUpdateFlags(Update::Force | Update::FitCursor); } else { diff --git a/src/TocBackend.cpp b/src/TocBackend.cpp index 984eb1ab65..f2fabd9bdc 100644 --- a/src/TocBackend.cpp +++ b/src/TocBackend.cpp @@ -76,7 +76,9 @@ docstring const TocItem::asString() const FuncRequest TocItem::action() const { - return FuncRequest(LFUN_PARAGRAPH_GOTO, convert(id())); + string const arg = convert(dit_.paragraph().id()) + + ' ' + convert(dit_.pos()); + return FuncRequest(LFUN_PARAGRAPH_GOTO, arg); } diff --git a/src/frontends/qt4/TocModel.cpp b/src/frontends/qt4/TocModel.cpp index 670cb5541d..5acee8fd83 100644 --- a/src/frontends/qt4/TocModel.cpp +++ b/src/frontends/qt4/TocModel.cpp @@ -219,13 +219,9 @@ void TocModels::goTo(int type, QModelIndex const & index) const } LASSERT(type >= 0 && type < int(models_.size()), /**/); - TocIterator const it = models_[type]->tocIterator(index); - LYXERR(Debug::GUI, "TocModels::goTo " << it->str()); - - string const tmp = convert(it->id()); - dispatch(FuncRequest(LFUN_PARAGRAPH_GOTO, tmp)); + dispatch(it->action()); }