Accept dirty buffer if the document has not been saved to disk (part of bug 6645).

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@34114 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Enrico Forestieri 2010-04-10 14:30:59 +00:00
parent 19947bfc83
commit 5aa69caae5

View File

@ -61,10 +61,12 @@ Buffer * checkAndLoadLyXFile(FileName const & filename, bool const acceptDirty)
// File already open? // File already open?
Buffer * checkBuffer = theBufferList().getBuffer(filename); Buffer * checkBuffer = theBufferList().getBuffer(filename);
if (checkBuffer) { if (checkBuffer) {
// sometimes (when setting the master buffer from a child) // Sometimes (when setting the master buffer from a child)
// we accept a dirty buffer right away (otherwise we'd get // we accept a dirty buffer right away (otherwise we'd get
// an infinite loop (bug 5514) // an infinite loop (bug 5514).
if (checkBuffer->isClean() || acceptDirty) // We also accept a dirty buffer when the document has not
// yet been saved to disk.
if (checkBuffer->isClean() || acceptDirty || !filename.exists())
return checkBuffer; return checkBuffer;
docstring const file = makeDisplayPath(filename.absFilename(), 20); docstring const file = makeDisplayPath(filename.absFilename(), 20);
docstring const text = bformat(_( docstring const text = bformat(_(