- rows_.clear();
-}
-
-
-size_type ParagraphMetrics::calculateRowSignature(Row const & row,
- BufferParams const & bparams)
-{
- 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);
- }
- }
- return crc.checksum();
-}
-
-
-void ParagraphMetrics::updateRowChangeStatus(BufferParams const & bparams)
-{
- size_t const size = rows_.size();
- row_change_status_.resize(size);
- row_signature_.resize(size);
-
- for (size_t i = 0; i != size; ++i) {
- // Row signature; has row changed since last update?
- size_type const row_sig = calculateRowSignature(rows_[i], bparams);
- row_change_status_[i] = row_signature_[i] != row_sig;
- row_signature_[i] = row_sig;
- }