mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-26 19:25:39 +00:00
Explicitly pass to closeBuffer whether the tab should only be hidden or that the buffer should be released.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@30993 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
3ac3ab1a78
commit
5ba1f471c7
@ -607,7 +607,7 @@ bool GuiView::closeBufferAll(bool tolastopened)
|
|||||||
if (b->parent()) {
|
if (b->parent()) {
|
||||||
// This is a child document, just close the tab
|
// This is a child document, just close the tab
|
||||||
// after saving but keep the file loaded.
|
// after saving but keep the file loaded.
|
||||||
if (!closeBuffer(*b, tolastopened, is_active_wa))
|
if (!closeBuffer(*b, false, tolastopened, is_active_wa))
|
||||||
return false;
|
return false;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -620,7 +620,8 @@ bool GuiView::closeBufferAll(bool tolastopened)
|
|||||||
Buffer * c = *it;
|
Buffer * c = *it;
|
||||||
// If a child is dirty, do not close
|
// If a child is dirty, do not close
|
||||||
// without user intervention
|
// without user intervention
|
||||||
if (!closeBuffer(*c, false))
|
//FIXME: should buffers be closed or not?
|
||||||
|
if (!closeBuffer(*c, false, false))
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -644,7 +645,7 @@ bool GuiView::closeBufferAll(bool tolastopened)
|
|||||||
}
|
}
|
||||||
// closeBuffer() needs buffer workArea still alive and
|
// closeBuffer() needs buffer workArea still alive and
|
||||||
// set as currrent one, and destroys it
|
// set as currrent one, and destroys it
|
||||||
if (b && !closeBuffer(*b, tolastopened, is_active_wa))
|
if (b && !closeBuffer(*b, true, tolastopened, is_active_wa))
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1925,11 +1926,12 @@ bool GuiView::saveBuffer(Buffer & b)
|
|||||||
bool GuiView::closeBuffer()
|
bool GuiView::closeBuffer()
|
||||||
{
|
{
|
||||||
Buffer * buf = buffer();
|
Buffer * buf = buffer();
|
||||||
return buf && closeBuffer(*buf);
|
return buf && closeBuffer(*buf, !buf->parent());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool GuiView::closeBuffer(Buffer & buf, bool tolastopened, bool mark_active)
|
bool GuiView::closeBuffer(Buffer & buf, bool close_buffer,
|
||||||
|
bool tolastopened, bool mark_active)
|
||||||
{
|
{
|
||||||
// goto bookmark to update bookmark pit.
|
// goto bookmark to update bookmark pit.
|
||||||
//FIXME: we should update only the bookmarks related to this buffer!
|
//FIXME: we should update only the bookmarks related to this buffer!
|
||||||
@ -1943,8 +1945,7 @@ bool GuiView::closeBuffer(Buffer & buf, bool tolastopened, bool mark_active)
|
|||||||
// is opened as well
|
// is opened as well
|
||||||
if (tolastopened)
|
if (tolastopened)
|
||||||
theSession().lastOpened().add(buf.fileName(), mark_active);
|
theSession().lastOpened().add(buf.fileName(), mark_active);
|
||||||
if (buf.parent())
|
if (!close_buffer)
|
||||||
// Don't close child documents.
|
|
||||||
removeWorkArea(currentMainWorkArea());
|
removeWorkArea(currentMainWorkArea());
|
||||||
else
|
else
|
||||||
theBufferList().release(&buf);
|
theBufferList().release(&buf);
|
||||||
|
@ -294,8 +294,8 @@ private:
|
|||||||
///
|
///
|
||||||
bool saveBuffer(Buffer & b);
|
bool saveBuffer(Buffer & b);
|
||||||
///
|
///
|
||||||
bool closeBuffer(Buffer & buf, bool tolastopened = false,
|
bool closeBuffer(Buffer & buf, bool keep_buffer,
|
||||||
bool mark_active = false);
|
bool tolastopened = false, bool mark_active = false);
|
||||||
///
|
///
|
||||||
bool saveBufferIfNeeded(Buffer & buf);
|
bool saveBufferIfNeeded(Buffer & buf);
|
||||||
///
|
///
|
||||||
|
Loading…
Reference in New Issue
Block a user