top_of_text_ = top;
}
-
+
unsigned int Row::top_of_text() const
{
return top_of_text_;
}
-
+
void Row::baseline(unsigned int b)
{
baseline_ = b;
}
+bool Row::isParStart() const
+{
+ return !pos();
+}
+
+
+bool Row::isParEnd() const
+{
+ return !next() || next()->par() != par();
+}
+
+
pos_type Row::lastPos() const
{
if (!par()->size())
return 0;
- if (!next() || next()->par() != par()) {
+ if (isParEnd()) {
return par()->size() - 1;
} else {
return next()->pos() - 1;
bool nextRowIsAllInset(Row const & row, pos_type last)
{
- if (!row.next())
- return false;
-
- if (row.par() != row.next()->par())
- return false;
-
if (!row.par()->isInset(last + 1))
return false;
pos_type Row::lastPrintablePos() const
{
pos_type const last = lastPos();
- bool const ignore_space_at_last = !nextRowIsAllInset(*this, last);
- if (ignore_space_at_last && par()->isSeparator(last))
+ // if this row is an end of par, just act like lastPos()
+ if (isParEnd())
+ return last;
+
+ bool const nextrownotinset = !nextRowIsAllInset(*this, last);
+
+ if (nextrownotinset && par()->isSeparator(last))
return last - 1;
return last;
// at the beginning of a row it does not count, if it is not
// the first row of a paragaph
- if (!this->pos())
+ if (isParStart())
return true;
// in some labels it does not count