#include "support/textutils.h"
using lyx::pos_type;
-using lyx::par_type;
+using lyx::pit_type;
using std::endl;
using std::max;
public:
/// initialise and run painter
RowPainter(BufferView const & bv, Painter & pain, LyXText const & text,
- par_type pit, RowList::iterator rit, int y);
+ pit_type pit, RowList::iterator rit, int y);
private:
// paint various parts
void paintBackground();
Row & row_;
/// Row's paragraph
- par_type const pit_;
+ pit_type const pit_;
Paragraph const & par_;
// Looks ugly - is
RowPainter::RowPainter(BufferView const & bv, Painter & pain,
- LyXText const & text, par_type pit, RowList::iterator rit, int y)
+ LyXText const & text, pit_type pit, RowList::iterator rit, int y)
: bv_(bv), pain_(pain), text_(text), pars_(text.paragraphs()),
rit_(rit), row_(*rit), pit_(pit), par_(text.paragraphs()[pit]),
xo_(text_.xo_), yo_(y), width_(text_.width())
LCursor const & cur = bv_.cursor();
int const starty = text_.cursorY(cur.selBegin());
int const endy = text_.cursorY(cur.selEnd());
- par_type startpit = cur.selBegin().par();
- par_type endpit = cur.selEnd().par();
+ pit_type startpit = cur.selBegin().pit();
+ pit_type endpit = cur.selEnd().pit();
RowList::iterator startrow = pars_[startpit].getRow(cur.selBegin().pos());
RowList::iterator endrow = pars_[endpit].getRow(cur.selEnd().pos());
int const h = row_.height();
Paragraph::depth_type prev_depth = 0;
if (!text_.isFirstRow(pit_, row_)) {
- par_type pit2 = pit_;
+ pit_type pit2 = pit_;
if (row_.pos() == 0)
--pit2;
prev_depth = pars_[pit2].getDepth();
Paragraph::depth_type next_depth = 0;
if (!text_.isLastRow(pit_, row_)) {
- par_type pit2 = pit_;
+ pit_type pit2 = pit_;
if (row_.endpos() >= pars_[pit2].size())
++pit2;
next_depth = pars_[pit2].getDepth();
int paintPars(BufferView const & bv, Painter & pain,
- LyXText const & text, par_type pit, par_type end)
+ LyXText const & text, pit_type pit, pit_type end)
{
//lyxerr << " paintRows: pit: " << &*pit << endl;
ParagraphList & pars = text.paragraphs();
} // namespace anon
-void refreshPar(BufferView const & bv, LyXText const & text, par_type pit)
+void refreshPar(BufferView const & bv, LyXText const & text, pit_type pit)
{
static NullPainter nop;
paintPars(bv, nop, text, pit, pit + 1);
int paintText(BufferView const & bv)
{
- par_type pit, end;
+ pit_type pit, end;
getParsInRange(bv.text()->paragraphs(), bv.top_y(),
bv.top_y() + bv.workHeight(), pit, end);
//lyxerr << "top_y: " << bv.top_y() << " y: " << pit->y << endl;