mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-23 21:40:19 +00:00
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:
parent
c0e2c0cd5c
commit
8446d3dbfc
@ -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();
|
||||
|
@ -129,8 +129,6 @@ private:
|
||||
void sendDispatchMessage(docstring const & msg,
|
||||
FuncRequest const & ev);
|
||||
|
||||
///
|
||||
void closeBuffer();
|
||||
///
|
||||
void reloadBuffer();
|
||||
///
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user