Use the Buffer::reload() function also in buffer_func.cpp::checkAndLoadLyXFile().

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@33265 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Vincent van Ravesteijn 2010-01-29 21:09:59 +00:00
parent 3410d6ad3e
commit 8c5626cf13

View File

@ -67,18 +67,16 @@ Buffer * checkAndLoadLyXFile(FileName const & filename, bool const acceptDirty)
if (checkBuffer->isClean() || acceptDirty) if (checkBuffer->isClean() || acceptDirty)
return checkBuffer; return checkBuffer;
docstring const file = makeDisplayPath(filename.absFilename(), 20); docstring const file = makeDisplayPath(filename.absFilename(), 20);
docstring text = bformat(_( docstring const text = bformat(_(
"The document %1$s is already loaded and has unsaved changes.\n" "The document %1$s is already loaded and has unsaved changes.\n"
"Do you want to abandon your changes and reload the version on disk?"), file); "Do you want to abandon your changes and reload the version on disk?"), file);
if (Alert::prompt(_("Reload saved document?"), if (!Alert::prompt(_("Reload saved document?"),
text, 0, 1, _("&Reload"), _("&Keep Changes"))) text, 0, 1, _("&Reload"), _("&Keep Changes"))) {
return checkBuffer; // reload the document
if (!checkBuffer->reload())
// FIXME: should be LFUN_REVERT return 0;
checkBuffer->markClean(); }
theBufferList().release(checkBuffer); return checkBuffer;
// Load it again.
return checkAndLoadLyXFile(filename);
} }
if (filename.exists()) { if (filename.exists()) {