From: Vincent van Ravesteijn Date: Mon, 25 Oct 2010 16:10:01 +0000 (+0000) Subject: Fix bug #6550: "Any Changes will be lost" even when there are no changes. X-Git-Tag: 2.0.0~2250 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=e48942bbbb48419c3d26c3edab520b31dc5e8941;p=features.git Fix bug #6550: "Any Changes will be lost" even when there are no changes. Patch from JOhn McCabe-Dansted. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@35835 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/frontends/qt4/GuiView.cpp b/src/frontends/qt4/GuiView.cpp index 5d604fca05..4213f1dc6a 100644 --- a/src/frontends/qt4/GuiView.cpp +++ b/src/frontends/qt4/GuiView.cpp @@ -3155,11 +3155,17 @@ void GuiView::dispatch(FuncRequest const & cmd, DispatchResult & dr) case LFUN_BUFFER_RELOAD: { LASSERT(doc_buffer, break); - docstring const file = makeDisplayPath(doc_buffer->absFileName(), 20); - docstring text = bformat(_("Any changes will be lost. Are you sure " - "you want to revert to the saved version of the document %1$s?"), file); - int const ret = Alert::prompt(_("Revert to saved document?"), - text, 1, 1, _("&Revert"), _("&Cancel")); + + int ret = 0; + if (!doc_buffer->isClean()) { + docstring const file = + makeDisplayPath(doc_buffer->absFileName(), 20); + docstring text = bformat(_("Any changes will be lost. " + "Are you sure you want to revert to the saved version " + "of the document %1$s?"), file); + ret = Alert::prompt(_("Revert to saved document?"), + text, 1, 1, _("&Revert"), _("&Cancel")); + } if (ret == 0) { doc_buffer->markClean();