- boost::crc_32_type crc;
- for (pos_type i = row.pos(); i < row.endpos(); ++i) {
- char_type const b[] = { par_->getChar(i) };
- crc.process_bytes(b, 1);
- if (bparams.trackChanges) {
- Change change = par_->lookupChange(i);
- char_type const b[] = { change.type };
- crc.process_bytes(b, 1);
- }
- }
- row.setCrc(crc.checksum());
-}
-
-
-Row & ParagraphMetrics::getRow(pos_type pos, bool boundary)
-{
- BOOST_ASSERT(!rows().empty());
-
- // If boundary is set we should return the row on which
- // the character before is inside.
- if (pos > 0 && boundary)
- --pos;
-
- RowList::iterator rit = rows_.end();
- RowList::iterator const begin = rows_.begin();
-
- for (--rit; rit != begin && rit->pos() > pos; --rit)
- ;
-
- return *rit;