-// removes the row and reset the touched counters
-void LyXText::removeRow(RowList::iterator rit)
-{
- if (anchor_row_ == rit) {
- if (rit != rows().begin()) {
- anchor_row_ = boost::prior(rit);
- anchor_row_offset_ += anchor_row_->height();
- } else {
- anchor_row_ = boost::next(rit);
- anchor_row_offset_ -= rit->height();
- }
- }
-
- // the text becomes smaller
- height -= rit->height();
-
- rowlist_.erase(rit);
-}
-
-
-// remove all following rows of the paragraph of the specified row.
-void LyXText::removeParagraph(RowList::iterator rit)
-{
- ParagraphList::iterator tmppit = getPar(rit);
- ++rit;
-
- while (rit != rows().end() && getPar(rit) == tmppit) {
- RowList::iterator tmprit = boost::next(rit);
- removeRow(rit);
- rit = tmprit;
- }
-}
-
-
-void LyXText::insertParagraph(ParagraphList::iterator pit,
- RowList::iterator rit)
-{
- // insert a new row, starting at position 0
- rit = rowlist_.insert(rit, Row(0));
-
- // and now append the whole paragraph before the new row
-
- pos_type const last = pit->size();
- bool done = false;
-
- do {
- pos_type z = rowBreakPoint(pit, *rit);
-
- RowList::iterator tmprow = rit;
-
- if (z < last) {
- ++z;
- rit = rowlist_.insert(boost::next(rit), Row(z));
- } else {
- done = true;
- }
-
- // Set the dimensions of the row
- // fixed fill setting now by calling inset->update() in
- // SingleWidth when needed!
- tmprow->fill(fill(tmprow, workWidth()));
- setHeightOfRow(tmprow);
-
- } while (!done);
-}
-
-