+2003-03-29 Lars Gullik Bjønnes <larsbj@gullik.net>
+
+ * text2.C (init): use rowlist_.end() and not 0.
+ (insertRow): change to take a RowList::iterator as arg, adjust
+ for this.
+ (insertParagraph): change to take a RowList::iterator as arg,
+ adjust for this.
+ (redoParagraphs): remove some debug msgs.
+
+ * text.C (appendParagraph): change to take a RowList::iterator
+ arg, adjust for this.
+ (breakAgain): add an assert
+ (breakAgainOneRow): ditto
+
2003-03-29 John Levon <levon@movementarian.org>
* text2.C: do not clear selection after inc/decDepth
* lyxfunc.C: remove a couple of silly questions,
use Alert::prompt
-
+
2003-03-28 John Levon <levon@movementarian.org>
* text2.C: fix bug 974 (End on empty par)
* BufferView_pimpl.C:
* LyXAction.C:
* lfuns.h: remove do-nothing math greek lfuns
-
+
2003-03-27 Lars Gullik Bjønnes <larsbj@gullik.net>
* lyxgluelength.h (isValidGlueLength): add default arg on
/** inserts a new row behind the specified row, increments
the touched counters */
- void insertRow(Row * row, Paragraph * par, lyx::pos_type pos);
-
+ RowList::iterator
+ insertRow(RowList::iterator rowit,
+ Paragraph * par, lyx::pos_type pos);
/// removes the row and reset the touched counters
void removeRow(Row * row);
void removeParagraph(Row * row);
/// insert the specified paragraph behind the specified row
- void insertParagraph(Paragraph * par, Row * row);
+ void insertParagraph(Paragraph * par, RowList::iterator rowit);
/** appends the implizit specified paragraph behind the specified row,
* start at the implizit given position */
- void appendParagraph(Row * row);
+ void appendParagraph(RowList::iterator rowit);
///
void breakAgain(Row * row);
// Appends the implicit specified paragraph before the specified row,
// start at the implicit given position
-void LyXText::appendParagraph(Row * row)
+void LyXText::appendParagraph(RowList::iterator rowit)
{
- pos_type const last = row->par()->size();
+ lyx::Assert(rowit != rowlist_.end());
+
+ pos_type const last = rowit->par()->size();
bool done = false;
do {
- pos_type z = rowBreakPoint(*row);
+ pos_type z = rowBreakPoint(*rowit);
- Row * tmprow = row;
+ RowList::iterator tmprow = rowit;
if (z < last) {
++z;
- insertRow(row, row->par(), z);
- row = row->next();
+ rowit = insertRow(rowit, rowit->par(), z);
} else {
done = true;
}
// fixed fill setting now by calling inset->update() in
// SingleWidth when needed!
tmprow->fill(fill(*tmprow, workWidth()));
- setHeightOfRow(tmprow);
+ setHeightOfRow(&*tmprow);
} while (!done);
}
void LyXText::breakAgain(Row * row)
{
+ lyx::Assert(row);
+
bool not_ready = true;
do {
// this is just a little changed version of break again
void LyXText::breakAgainOneRow(Row * row)
{
+ lyx::Assert(row);
+
pos_type z = rowBreakPoint(*row);
Row * tmprow = row;
while (par) {
if (rowlist_.empty())
- insertParagraph(par, 0);
+ insertParagraph(par, rowlist_.end());
else
insertParagraph(par, lastRow());
par = par->next();
// inserts a new row before the specified row, increments
// the touched counters
-void LyXText::insertRow(Row * row, Paragraph * par,
- pos_type pos)
+RowList::iterator
+ LyXText::insertRow(RowList::iterator rowit, Paragraph * par,
+ pos_type pos)
{
Row * tmprow = new Row;
tmprow->par(par);
tmprow->pos(pos);
- if (!row) {
- rowlist_.insert(rowlist_.begin(), tmprow);
- } else {
- rowlist_.insert(row->next(), tmprow);
- }
+ if (rowit == rowlist_.end())
+ return rowlist_.insert(rowlist_.begin(), tmprow);
+ else
+ return rowlist_.insert(boost::next(rowit), tmprow);
}
}
-void LyXText::insertParagraph(Paragraph * par, Row * row)
+void LyXText::insertParagraph(Paragraph * par, RowList::iterator rowit)
{
// insert a new row, starting at position 0
- insertRow(row, par, 0);
+ RowList::iterator rit = insertRow(rowit, par, 0);
// and now append the whole paragraph before the new row
- if (!row) {
- appendParagraph(firstRow());
- } else {
- appendParagraph(row->next());
- }
+ appendParagraph(rit);
}
// the ownerParagrah() so the paragraph inside the row is NOT
// my really first par anymore. Got it Lars ;) (Jug 20011206)
first_phys_par = ownerParagraph();
- lyxerr << "ownerParagraph" << endl;
-
} else {
first_phys_par = tmprow->par();
- lyxerr << "tmprow->par()" << endl;
// Find first row of this paragraph.
while (tmprow->previous()
do {
if (tmppar) {
insertParagraph(tmppar, tmprow);
+
if (!tmprow) {
tmprow = firstRow();
}