From 8c5626cf13a048b0ae83e6b5b47be347dff14458 Mon Sep 17 00:00:00 2001 From: Vincent van Ravesteijn Date: Fri, 29 Jan 2010 21:09:59 +0000 Subject: [PATCH] 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 --- src/buffer_funcs.cpp | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/src/buffer_funcs.cpp b/src/buffer_funcs.cpp index 8224241ee1..3f27588ce7 100644 --- a/src/buffer_funcs.cpp +++ b/src/buffer_funcs.cpp @@ -67,18 +67,16 @@ Buffer * checkAndLoadLyXFile(FileName const & filename, bool const acceptDirty) if (checkBuffer->isClean() || acceptDirty) return checkBuffer; 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" "Do you want to abandon your changes and reload the version on disk?"), file); - if (Alert::prompt(_("Reload saved document?"), - text, 0, 1, _("&Reload"), _("&Keep Changes"))) - return checkBuffer; - - // FIXME: should be LFUN_REVERT - checkBuffer->markClean(); - theBufferList().release(checkBuffer); - // Load it again. - return checkAndLoadLyXFile(filename); + if (!Alert::prompt(_("Reload saved document?"), + text, 0, 1, _("&Reload"), _("&Keep Changes"))) { + // reload the document + if (!checkBuffer->reload()) + return 0; + } + return checkBuffer; } if (filename.exists()) { -- 2.39.5