2 * \file ControlErrorList.C
3 * This file is part of LyX, the document processor.
4 * Licence details can be found in the file COPYING.
6 * \author Alfredo Braunstein
8 * Full author contact details are available in file CREDITS.
13 #include "ControlErrorList.h"
15 #include "BufferView.h"
18 #include "paragraph.h"
19 #include "pariterator.h"
25 ControlErrorList::ControlErrorList(Dialog & d)
26 : Dialog::Controller(d)
30 void ControlErrorList::clearParams()
34 ErrorList const & ControlErrorList::errorList() const
40 bool ControlErrorList::initialiseParams(string const & name)
42 errorlist_ = kernel().bufferview()->getErrorList();
48 string const & ControlErrorList::name()
54 void ControlErrorList::goTo(int item)
56 ErrorItem const & err = errorlist_[item];
61 Buffer & buf = kernel().buffer();
62 ParIterator pit = buf.getParFromID(err.par_id);
64 if (pit == buf.par_iterator_end()) {
65 lyxerr << "par id not found" << endl;
69 lyx::pos_type const end = std::min(err.pos_end, pit->size());
70 lyx::pos_type const start = std::min(err.pos_start, end);
71 lyx::pos_type const range = end - start;
73 // Now make the selection.
75 #warning FIXME (goto error)
76 #warning This should be implemented using an LFUN. (Angus)
79 PosIterator const pos(pit, start);
80 kernel().bufferview()->putSelectionAt(pos, range, false);