]> git.lyx.org Git - features.git/commitdiff
Fix bug #6550: "Any Changes will be lost" even when there are no changes.
authorVincent van Ravesteijn <vfr@lyx.org>
Mon, 25 Oct 2010 16:10:01 +0000 (16:10 +0000)
committerVincent van Ravesteijn <vfr@lyx.org>
Mon, 25 Oct 2010 16:10:01 +0000 (16:10 +0000)
Patch from JOhn McCabe-Dansted.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@35835 a592a061-630c-0410-9148-cb99ea01b6c8

src/frontends/qt4/GuiView.cpp

index 5d604fca05f88f0f346607c4c493a935e9155dcd..4213f1dc6a3fe4c4f66f00ddd977894bf1d54ad6 100644 (file)
@@ -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();