diff --git a/src/LyXFunc.cpp b/src/LyXFunc.cpp index e5d0d392c4..986d7de426 100644 --- a/src/LyXFunc.cpp +++ b/src/LyXFunc.cpp @@ -232,7 +232,8 @@ void LyXFunc::handleKeyFunc(kb_action action) view()->processUpdateFlags(Update::FitCursor); } - +//FIXME: bookmark handling is a frontend issue. This code should be transferred +// to GuiView and be GuiView and be window dependent. void LyXFunc::gotoBookmark(unsigned int idx, bool openFile, bool switchToBuffer) { BOOST_ASSERT(lyx_view_); @@ -833,7 +834,7 @@ void LyXFunc::dispatch(FuncRequest const & cmd) break; case LFUN_BUFFER_CLOSE: - closeBuffer(); + lyx_view_->closeBuffer(); updateFlags = Update::None; break; @@ -1794,16 +1795,6 @@ void LyXFunc::sendDispatchMessage(docstring const & msg, FuncRequest const & cmd } -void LyXFunc::closeBuffer() -{ - // goto bookmark to update bookmark pit. - for (size_t i = 0; i < LyX::ref().session().bookmarks().size(); ++i) - gotoBookmark(i+1, false, false); - - lyx_view_->closeBuffer(); -} - - void LyXFunc::reloadBuffer() { FileName filename = lyx_view_->buffer()->fileName(); diff --git a/src/LyXFunc.h b/src/LyXFunc.h index c2d5af9b69..a97d85b2c6 100644 --- a/src/LyXFunc.h +++ b/src/LyXFunc.h @@ -129,8 +129,6 @@ private: void sendDispatchMessage(docstring const & msg, FuncRequest const & ev); - /// - void closeBuffer(); /// void reloadBuffer(); /// diff --git a/src/frontends/qt4/GuiView.cpp b/src/frontends/qt4/GuiView.cpp index 4454a4652e..b999ceb546 100644 --- a/src/frontends/qt4/GuiView.cpp +++ b/src/frontends/qt4/GuiView.cpp @@ -1588,6 +1588,11 @@ bool GuiView::closeBuffer() bool GuiView::closeBuffer(Buffer & buf) { + // goto bookmark to update bookmark pit. + //FIXME: we should update only the bookmarks related to this buffer! + for (size_t i = 0; i < LyX::ref().session().bookmarks().size(); ++i) + theLyXFunc().gotoBookmark(i+1, false, false); + if (buf.isClean() || buf.paragraphs().empty()) { theBufferList().release(&buf); return true;