]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/GuiView.cpp
Fix issue noted by Julien: With new files especially, we will find
[lyx.git] / src / frontends / qt4 / GuiView.cpp
index b84c6f310e760e7c6531528a0744d91372d95acd..1b3df11a79f29e42105dfe3590d128117e05074b 100644 (file)
@@ -2282,8 +2282,9 @@ bool GuiView::renameBuffer(Buffer & b, docstring const & newname)
        // fname is now the new Buffer location.
 
        // if there is already a Buffer open with this name, we do not want
-       // to have another one.
-       if (theBufferList().exists(fname)) {
+       // to have another one. (the second test makes sure we're not just
+       // trying to overwrite ourselves, which is fine.)
+       if (theBufferList().exists(fname) && fname != oldname) {
                docstring const text = 
                        bformat(_("The file\n%1$s\nis already open in your current session.\n"
                            "Please close it before attempting to overwrite it.\n"