]> git.lyx.org Git - features.git/commitdiff
Fix issue noted by Julien: With new files especially, we will find
authorRichard Heck <rgheck@comcast.net>
Tue, 13 Dec 2011 19:18:09 +0000 (19:18 +0000)
committerRichard Heck <rgheck@comcast.net>
Tue, 13 Dec 2011 19:18:09 +0000 (19:18 +0000)
the name we are trying to write in the BufferList, since the file
gets a name when it is created.

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

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"