]> git.lyx.org Git - lyx.git/blob - src/errorlist.C
"Inter-word Space"
[lyx.git] / src / errorlist.C
1 /**
2  * \file errorlist.C
3  * This file is part of LyX, the document processor.
4  * Licence details can be found in the file COPYING.
5  *
6  * \author Alfredo Braunstein
7  *
8  * Full author contact details are available in file CREDITS
9  */
10
11 #include <config.h>
12
13 #include "errorlist.h"
14 #include "buffer.h"
15 #include "LaTeX.h"
16
17
18 ErrorItem::ErrorItem(string const & error, string const & description,
19                      int par_id, int pos_start, int pos_end)
20         : error(error), description(description), par_id(par_id),
21           pos_start(pos_start),  pos_end(pos_end)
22 {}
23
24
25 ErrorItem::ErrorItem()
26         : par_id(-1),  pos_start(0),  pos_end(0)
27 {}
28
29
30 ErrorList::ErrorList(Buffer const & buf, 
31                      TeXErrors const & terr) 
32 {
33         TeXErrors::Errors::const_iterator cit = terr.begin();
34         TeXErrors::Errors::const_iterator end = terr.end();
35
36         for (; cit != end; ++cit) {
37                 int par_id = -1;
38                 int posstart = -1;
39                 int const errorrow = cit->error_in_line;
40                 buf.texrow.getIdFromRow(errorrow, par_id, posstart);
41                 int posend = -1;
42                 buf.texrow.getIdFromRow(errorrow + 1, par_id, posend);
43                 push_back(ErrorItem(cit->error_desc,
44                                     cit->error_text,
45                                     par_id, posstart, posend));
46         }
47 }