#include "Buffer.h"
#include "BufferView.h"
-#include "debug.h"
-#include "gettext.h"
+#include "support/debug.h"
+#include "support/gettext.h"
#include "Text.h"
#include "ParIterator.h"
#include "qt_helpers.h"
-// FIXME: those two headers are needed because of the
-// WorkArea::redraw() call below.
-#include "frontends/LyXView.h"
-#include "frontends/WorkArea.h"
-
#include "support/lstrings.h"
#include <QListWidget>
#include <QPushButton>
#include <QCloseEvent>
-using std::endl;
-using std::string;
-
+using namespace std;
+using namespace lyx::support;
namespace lyx {
namespace frontend {
-using support::bformat;
-
-GuiErrorList::GuiErrorList(LyXView & lv)
- : GuiDialog(lv, "errorlist")
+GuiErrorList::GuiErrorList(GuiView & lv)
+ : GuiDialog(lv, "errorlist", qt_("Error List"))
{
setupUi(this);
void GuiErrorList::updateContents()
{
- setViewTitle(name_);
+ setTitle(toqstr(name_));
errorsLW->clear();
descriptionTB->setPlainText(QString());
return;
Buffer & buf = buffer();
- ParIterator pit = buf.getParFromID(err.par_id);
+ DocIterator dit = buf.getParFromID(err.par_id);
- if (pit == buf.par_iterator_end()) {
- lyxerr << "par id " << err.par_id << " not found" << endl;
+ if (dit == doc_iterator_end(buf.inset())) {
+ LYXERR0("par id " << err.par_id << " not found");
return;
}
// Now make the selection.
- // This should be implemented using an LFUN. (Angus)
// if pos_end is 0, this means it is end-of-paragraph
- pos_type const end = err.pos_end ? std::min(err.pos_end, pit->size())
- : pit->size();
- pos_type const start = std::min(err.pos_start, end);
+ pos_type const s = dit.paragraph().size();
+ pos_type const end = err.pos_end ? min(err.pos_end, s) : s;
+ pos_type const start = min(err.pos_start, end);
pos_type const range = end - start;
- DocIterator const dit = makeDocIterator(pit, start);
+ dit.pos() = start;
bufferview()->putSelectionAt(dit, range, false);
// FIXME: If we used an LFUN, we would not need this line:
bufferview()->processUpdateFlags(Update::Force | Update::FitCursor);
}
-Dialog * createGuiErrorList(LyXView & lv) { return new GuiErrorList(lv); }
+Dialog * createGuiErrorList(GuiView & lv) { return new GuiErrorList(lv); }
} // namespace frontend
} // namespace lyx