lyx::time_type const curtime(lyx::current_time());
int column = 0;
- for (pos_type i = 0; i < size(); ++i) {
+ for (pos_type i = 0; i <= size(); ++i) {
Change change = pimpl_->lookupChangeFull(i);
Changes::lyxMarkChange(os, column, curtime, running_change, change);
running_change = change;
+ if (i == size())
+ break;
+
// Write font changes
LyXFont font2 = getFontSettings(bparams, i);
if (font2 != font1) {
}
}
- // to make reading work properly
- if (!size()) {
- running_change = pimpl_->lookupChange(0);
- Changes::lyxMarkChange(os, column, curtime,
- Change(Change::UNCHANGED), running_change);
- }
- Changes::lyxMarkChange(os, column, curtime,
- running_change, Change(Change::UNCHANGED));
-
os << "\n\\end_layout\n";
}
return 0;
int i = 0;
- while (!empty() && (isNewline(0) || isLineSeparator(0))) {
- // Set Change::Type to Change::INSERTED to quietly remove it
- setChange(0, Change::INSERTED);
+ while (!empty() && (isNewline(0) || isLineSeparator(0))
+ && (lookupChange(0) != Change::DELETED)) {
erase(0);
++i;
}
Change::Type Paragraph::lookupChange(lyx::pos_type pos) const
{
- BOOST_ASSERT(empty() || pos < size());
+ BOOST_ASSERT(pos <= size());
return pimpl_->lookupChange(pos);
}
Change const Paragraph::lookupChangeFull(lyx::pos_type pos) const
{
- BOOST_ASSERT(empty() || pos < size());
+ BOOST_ASSERT(pos <= size());
return pimpl_->lookupChangeFull(pos);
}
}
+void Paragraph::setChangeFull(lyx::pos_type pos, Change change)
+{
+ pimpl_->setChangeFull(pos, change);
+}
+
+
void Paragraph::markErased(bool erased)
{
pimpl_->markErased(erased);