Paragraph::Paragraph(Paragraph const & par)
: itemdepth(par.itemdepth), insetlist(par.insetlist),
dim_(par.dim_),
- rows_(par.rows_), layout_(par.layout_),
+ rows_(par.rows_), rowSignature_(par.rowSignature_),
+ layout_(par.layout_),
text_(par.text_), begin_of_body_(par.begin_of_body_),
pimpl_(new Paragraph::Pimpl(*par.pimpl_, this))
{
rows_ = par.rows_;
dim_ = par.dim_;
+ rowSignature_ = par.rowSignature_;
layout_ = par.layout();
text_ = par.text_;
begin_of_body_ = par.begin_of_body_;
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";
}
// Gets uninstantiated font setting at position 0
-LyXFont const Paragraph::getFirstFontSettings() const
+LyXFont const Paragraph::getFirstFontSettings(BufferParams const & bparams) const
{
if (!empty() && !pimpl_->fontlist.empty())
return pimpl_->fontlist[0].font();
- return LyXFont(LyXFont::ALL_INHERIT);
+ return LyXFont(LyXFont::ALL_INHERIT, bparams.language);
}
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;
}
Paragraph::getParLanguage(BufferParams const & bparams) const
{
if (!empty())
- return getFirstFontSettings().language();
+ return getFirstFontSettings(bparams).language();
#ifdef WITH_WARNINGS
#warning FIXME we should check the prev par as well (Lgb)
#endif
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);