void LyXText::deleteEmptyParagraphMechanism(pit_type first, pit_type last, bool trackChanges)
{
+ BOOST_ASSERT(first >= 0 && first <= last && last < (int) pars_.size());
+
for (pit_type pit = first; pit <= last; ++pit) {
Paragraph & par = pars_[pit];
}
}
- // don't delete anything if this is the ONLY paragraph
- if (pars_.size() == 1)
+ // don't delete anything if this is the only remaining paragraph within the given range
+ // note: LyXText::acceptOrRejectChanges() sets the cursor to 'first' after calling DEPM
+ if (first == last)
continue;
// don't delete empty paragraphs with keepempty set