]> git.lyx.org Git - lyx.git/blobdiff - src/bufferlist.C
Fix small bug in reading \set_color in lyxrc
[lyx.git] / src / bufferlist.C
index 6490d0d01675c91f4d10780651cd8e075c09c5d3..448a01af271a29df14080adb4aea393389d46044 100644 (file)
@@ -31,6 +31,7 @@
 #include "lyxrc.h"
 #include "lyxtext.h"
 #include "lyx_cb.h"
+#include "bufferview_funcs.h"
 #include "gettext.h"
 #include "LyXView.h"
 #include "vc-backend.h"
@@ -38,6 +39,7 @@
 
 extern BufferView * current_view; // called too many times in this file...
 
+using std::vector;
 using std::find;
 using std::endl;
 
@@ -149,10 +151,13 @@ void BufferList::resize()
 
 bool BufferList::close(Buffer * buf)
 {
-        if (buf->getUser()) buf->getUser()->insetUnlock();
+       // CHECK
+       // Trace back why we need to use buf->getUser here.
+       // Perhaps slight rewrite is in order? (Lgb)
        
+        if (buf->getUser()) buf->getUser()->insetUnlock();
        if (buf->paragraph && !buf->isLyxClean() && !quitting) {
-               ProhibitInput();
+               if (buf->getUser()) ProhibitInput(buf->getUser());
                 switch(AskConfirmation(_("Changes in document:"),
                                       MakeDisplayPath(buf->fileName(), 50),
                                       _("Save document?"))){
@@ -160,15 +165,15 @@ bool BufferList::close(Buffer * buf)
                        if (buf->save()) {
                                lastfiles->newFile(buf->fileName());
                        } else {
-                               AllowInput();
+                               if (buf->getUser()) AllowInput(buf->getUser());
                                return false;
                        }
                         break;
                case 3: // Cancel
-                        AllowInput();
+                        if (buf->getUser()) AllowInput(buf->getUser());
                         return false;
                 }
-               AllowInput();
+               if (buf->getUser()) AllowInput(buf->getUser());
        }
 
        bstore.release(buf);
@@ -223,8 +228,7 @@ void BufferList::updateIncludedTeXfiles(string const & mastertmpdir)
                if (!(*it)->isDepClean(mastertmpdir)) {
                        string writefile = mastertmpdir;
                        writefile += '/';
-                       writefile += ChangeExtension((*it)->fileName(),
-                                                    ".tex", true);
+                       writefile += (*it)->getLatexName();
                        (*it)->makeLaTeXFile(writefile, mastertmpdir,
                                             false, true);
                        (*it)->markDepClean(mastertmpdir);
@@ -464,7 +468,7 @@ Buffer * BufferList::loadLyXFile(string const & filename, bool tolastfiles)
                if (LyXVC::file_not_found_hook(s)) {
                        // Ask if the file should be checked out for
                        // viewing/editing, if so: load it.
-                       if (AskQuestion(_("Do you want to retrive file under version control?"))) {
+                       if (AskQuestion(_("Do you want to retrieve file under version control?"))) {
                                // How can we know _how_ to do the checkout?
                                // With the current VC support it has to be,
                                // a RCS file since CVS do not have special ,v files.