]> git.lyx.org Git - lyx.git/blobdiff - src/buffer_funcs.C
minimal effort implementation of:
[lyx.git] / src / buffer_funcs.C
index 5c545cbcddc603302ed301696f09d3ab738122c7..22544c76dc8cc90155cba751aca63b808bc87725 100644 (file)
@@ -194,7 +194,8 @@ Buffer * newFile(string const & filename, string const & templatename,
                        string const file = makeDisplayPath(tname, 50);
                        string const text  = bformat(_("The specified document template\n%1$s\ncould not be read."), file);
                        Alert::error(_("Could not read template"), text);
-                       // no template, start with empty buffer
+                       bufferlist.release(b);
+                       return 0;
                }
        }
 
@@ -211,7 +212,8 @@ Buffer * newFile(string const & filename, string const & templatename,
 }
 
 
-void bufferErrors(Buffer const & buf, TeXErrors const & terr)
+void bufferErrors(Buffer const & buf, TeXErrors const & terr,
+                                 ErrorList & errorList)
 {
        TeXErrors::Errors::const_iterator cit = terr.begin();
        TeXErrors::Errors::const_iterator end = terr.end();
@@ -230,23 +232,15 @@ void bufferErrors(Buffer const & buf, TeXErrors const & terr)
                                                          pos_end);
                } while (found && id_start == id_end && pos_start == pos_end);
 
-               buf.error(ErrorItem(cit->error_desc, cit->error_text,
-                                   id_start, pos_start, pos_end));
+               errorList.push_back(ErrorItem(cit->error_desc,
+                       cit->error_text, id_start, pos_start, pos_end));
        }
 }
 
 
-void bufferErrors(Buffer const & buf, ErrorList const & el)
-{
-       for_each(el.begin(), el.end(), bind(ref(buf.error), _1));
-}
-
-
 string const bufferFormat(Buffer const & buffer)
 {
-       if (buffer.isLinuxDoc())
-               return "linuxdoc";
-       else if (buffer.isDocBook())
+       if (buffer.isDocBook())
                return "docbook";
        else if (buffer.isLiterate())
                return "literate";