]> git.lyx.org Git - lyx.git/blobdiff - src/buffer.C
move some selection related stuff over to textcursor.C
[lyx.git] / src / buffer.C
index 2b724aa8a2ff163450e7bb1ae4bb17d18e07dfc9..658cc859c46c22d4c999a79b182cdb9a1ebbed2f 100644 (file)
@@ -11,6 +11,7 @@
 #include <config.h>
 
 #include "buffer.h"
+#include "buffer_funcs.h"
 #include "bufferlist.h"
 #include "LyXAction.h"
 #include "lyxrc.h"
@@ -273,6 +274,7 @@ int Buffer::readHeader(LyXLex & lex)
                lyxerr[Debug::PARSER] << "Handling header token: `"
                                      << token << '\'' << endl;
 
+
                string unknown = params.readToken(lex, token);
                if (!unknown.empty()) {
                        if (unknown[0] != '\\') {
@@ -306,6 +308,7 @@ bool Buffer::readBody(LyXLex & lex, ParagraphList::iterator pit)
        bool the_end_read = false;
 
        if (paragraphs.empty()) {
+               readHeader(lex);
                if (!params.getLyXTextClass().load()) {
                        string theclass = params.getLyXTextClass().name();
                        Alert::error(_("Can't load document class"), bformat(
@@ -1144,8 +1147,6 @@ void Buffer::makeLinuxDocFile(string const & fname, bool nice, bool body_only)
        string item_name;
        vector<string> environment_stack(5);
 
-       users->resetErrorList();
-
        ParagraphList::iterator pit = paragraphs.begin();
        ParagraphList::iterator pend = paragraphs.end();
        for (; pit != pend; ++pit) {
@@ -1274,8 +1275,6 @@ void Buffer::makeLinuxDocFile(string const & fname, bool nice, bool body_only)
 
        // we want this to be true outside previews (for insetexternal)
        niceFile = true;
-
-       users->showErrorList(_("LinuxDoc"));
 }
 
 
@@ -1592,8 +1591,6 @@ void Buffer::makeDocBookFile(string const & fname, bool nice, bool only_body)
        string item_name;
        string command_name;
 
-       users->resetErrorList();
-
        ParagraphList::iterator par = paragraphs.begin();
        ParagraphList::iterator pend = paragraphs.end();
 
@@ -1809,7 +1806,6 @@ void Buffer::makeDocBookFile(string const & fname, bool nice, bool only_body)
 
        // we want this to be true outside previews (for insetexternal)
        niceFile = true;
-       users->showErrorList(_("DocBook"));
 }
 
 
@@ -1935,9 +1931,7 @@ int Buffer::runChktex()
                             _("Could not run chktex successfully."));
        } else if (res > 0) {
                // Insert all errors as errors boxes
-               ErrorList el (*this, terr);
-               users->setErrorList(el);
-               users->showErrorList(_("ChkTeX"));
+               parseErrors(*this, terr);
        }
 
        users->owner()->busy(false);