Get rid of LyXFunc::closeBuffer()

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23274 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Abdelrazak Younes 2008-02-27 11:05:58 +00:00
parent c0e2c0cd5c
commit 8446d3dbfc
3 changed files with 8 additions and 14 deletions

View File

@ -232,7 +232,8 @@ void LyXFunc::handleKeyFunc(kb_action action)
view()->processUpdateFlags(Update::FitCursor); 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) void LyXFunc::gotoBookmark(unsigned int idx, bool openFile, bool switchToBuffer)
{ {
BOOST_ASSERT(lyx_view_); BOOST_ASSERT(lyx_view_);
@ -833,7 +834,7 @@ void LyXFunc::dispatch(FuncRequest const & cmd)
break; break;
case LFUN_BUFFER_CLOSE: case LFUN_BUFFER_CLOSE:
closeBuffer(); lyx_view_->closeBuffer();
updateFlags = Update::None; updateFlags = Update::None;
break; 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() void LyXFunc::reloadBuffer()
{ {
FileName filename = lyx_view_->buffer()->fileName(); FileName filename = lyx_view_->buffer()->fileName();

View File

@ -129,8 +129,6 @@ private:
void sendDispatchMessage(docstring const & msg, void sendDispatchMessage(docstring const & msg,
FuncRequest const & ev); FuncRequest const & ev);
///
void closeBuffer();
/// ///
void reloadBuffer(); void reloadBuffer();
/// ///

View File

@ -1588,6 +1588,11 @@ bool GuiView::closeBuffer()
bool GuiView::closeBuffer(Buffer & buf) 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()) { if (buf.isClean() || buf.paragraphs().empty()) {
theBufferList().release(&buf); theBufferList().release(&buf);
return true; return true;