I can see no regressions, please inspect and report back.

Index: po/POTFILES.in
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/po/POTFILES.in,v
retrieving revision 1.324
diff -u -p -r1.324 POTFILES.in
--- po/POTFILES.in	26 Mar 2003 15:55:51 -0000	1.324
+++ po/POTFILES.in	30 Mar 2003 20:10:42 -0000
@@ -29,9 +29,10 @@ src/frontends/controllers/helper_funcs.C
 src/frontends/gnome/GLog.C
 src/frontends/LyXView.C
 src/frontends/qt2/Alert_pimpl.C
+src/frontends/qt2/BulletsModule.C
 src/frontends/qt2/Dialogs.C
 src/frontends/qt2/FileDialog.C
-src/frontends/qt2/lengthcombo.C
+src/frontends/qt2/floatplacement.C
 src/frontends/qt2/QAbout.C
 src/frontends/qt2/QBibitem.C
 src/frontends/qt2/QBibtex.C
@@ -123,7 +124,6 @@ src/frontends/xforms/FormToc.C
 src/frontends/xforms/FormUrl.C
 src/frontends/xforms/FormVCLog.C
 src/frontends/xforms/FormWrap.C
-src/frontends/xforms/input_validators.C
 src/frontends/xforms/Menubar_pimpl.C
 src/frontends/xforms/xformsBC.h
 src/frontends/xforms/xforms_helpers.C
@@ -169,7 +169,6 @@ src/lyxfont.C
 src/lyxfunc.C
 src/lyx_main.C
 src/lyxrc.C
-src/lyxtextclasslist.C
 src/lyxvc.C
 src/mathed/formulabase.C
 src/mathed/formulamacro.C
@@ -181,8 +180,6 @@ src/paragraph.C
 src/paragraph_funcs.C
 src/ParagraphParameters.C
 src/rowpainter.C
-src/support/filetools.C
-src/tabular.C
 src/text2.C
 src/text3.C
 src/text.C
Index: src/BufferView_pimpl.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/BufferView_pimpl.C,v
retrieving revision 1.356
diff -u -p -r1.356 BufferView_pimpl.C
--- src/BufferView_pimpl.C	29 Mar 2003 20:22:55 -0000	1.356
+++ src/BufferView_pimpl.C	30 Mar 2003 20:10:42 -0000
@@ -227,7 +227,7 @@ bool BufferView::Pimpl::fitCursor()
 
 	dispatch(FuncRequest(LFUN_PARAGRAPH_UPDATE));
 
-	// We need to always update, in case we did a 
+	// We need to always update, in case we did a
 	// paste and we stayed anchored to a row, but
 	// the actual height of the doc changed ...
 	updateScrollbar();
@@ -1143,7 +1143,7 @@ bool BufferView::Pimpl::dispatch(FuncReq
 		}
 	}
 	break;
-	
+
 	case LFUN_FLOAT_LIST:
 		if (tclass.floats().typeExist(ev.argument)) {
 			Inset * inset = new InsetFloatList(ev.argument);
Index: src/buffer.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/buffer.C,v
retrieving revision 1.440
diff -u -p -r1.440 buffer.C
--- src/buffer.C	29 Mar 2003 17:35:56 -0000	1.440
+++ src/buffer.C	30 Mar 2003 20:10:43 -0000
@@ -263,7 +263,7 @@ void unknownClass(string const & unknown
 			" class %1$s is unknown.")) % unknown);
 #else
 		_("Using the default document class, because the "
-		" class ") + unknown + (" is unknown."); 
+		" class ") + unknown + (" is unknown.");
 #endif
 	Alert::warning(_("Unknown document class"), msg);
 }
Index: src/bufferview_funcs.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/bufferview_funcs.C,v
retrieving revision 1.67
diff -u -p -r1.67 bufferview_funcs.C
--- src/bufferview_funcs.C	29 Mar 2003 10:55:48 -0000	1.67
+++ src/bufferview_funcs.C	30 Mar 2003 20:10:44 -0000
@@ -79,7 +79,7 @@ bool string2font(string const & data, Ly
 	int Int = 0;
 	bool Bool = false;
 	string String;
-			
+
 	int nset = 0;
 	while (lex.isOK()) {
 		lex.next();
@@ -113,7 +113,7 @@ bool string2font(string const & data, Ly
 
 		if (token == "family") {
 			font.setFamily(static_cast<LyXFont::FONT_FAMILY>(Int));
-			
+
 		} else if (token == "series") {
 			font.setSeries(static_cast<LyXFont::FONT_SERIES>(Int));
 
@@ -403,7 +403,7 @@ void toggleAndShow(BufferView * bv, LyXF
 	if (font.language() != ignore_language ||
 	    font.number() != LyXFont::IGNORE) {
 		LyXCursor & cursor = text->cursor;
-		text->computeBidiTables(bv->buffer(), cursor.row());
+		text->computeBidiTables(bv->buffer(), *cursor.row());
 		if (cursor.boundary() !=
 		    text->isBoundary(bv->buffer(), cursor.par(), cursor.pos(),
 				     text->real_current_font))
Index: src/lyxtext.h
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/lyxtext.h,v
retrieving revision 1.155
diff -u -p -r1.155 lyxtext.h
--- src/lyxtext.h	30 Mar 2003 18:42:35 -0000	1.155
+++ src/lyxtext.h	30 Mar 2003 20:10:45 -0000
@@ -90,7 +90,7 @@ public:
 	/// set the y coord. of the top of the screen (relative to doc start)
 	void top_y(int newy);
 	/// set the anchoring row. top_y will be computed relative to this
-	void anchor_row(Row * row);
+	void anchor_row(RowList::iterator rit);
 	///
 	InsetText * inset_owner;
 	///
@@ -112,7 +112,7 @@ public:
 			 lyx::pos_type pos, LyXFont const & font, bool toggleall);
 
 	///
-	void breakAgainOneRow(Row * row);
+	void breakAgainOneRow(RowList::iterator rit);
 	/// what you expect when pressing <enter> at cursor position
 	void breakParagraph(ParagraphList & paragraphs, char keep_layout = 0);
 
@@ -190,7 +190,7 @@ public:
 	/**
 	 * Mark the given row at position y as needing a repaint.
 	 */
-	void postRowPaint(Row * row, int start_y);
+	void postRowPaint(RowList::iterator rit, int start_y);
 
 	///
 	Inset::RESULT dispatch(FuncRequest const & cmd);
@@ -238,7 +238,7 @@ public:
 	/** returns the column near the specified x-coordinate of the row
 	 x is set to the real beginning of this column
 	 */
-	lyx::pos_type getColumnNearX(Row * row,
+	lyx::pos_type getColumnNearX(RowList::iterator rit,
 					    int & x, bool & boundary) const;
 
 	/** returns a pointer to a specified row. y is set to the beginning
@@ -479,7 +479,7 @@ public:
 	int workWidth(Inset * inset) const;
 
 	///
-	void computeBidiTables(Buffer const *, Row * row) const;
+	void computeBidiTables(Buffer const *, Row const & row) const;
 	/// Maps positions in the visual string to positions in logical string.
 	lyx::pos_type log2vis(lyx::pos_type pos) const;
 	/// Maps positions in the logical string to positions in visual string.
@@ -515,7 +515,7 @@ private:
 	void removeRow(RowList::iterator rit);
 
 	/// remove all following rows of the paragraph of the specified row.
-	void removeParagraph(Row * row);
+	void removeParagraph(RowList::iterator rit);
 
 	/// insert the specified paragraph behind the specified row
 	void insertParagraph(Paragraph * par, RowList::iterator rowit);
@@ -571,13 +571,13 @@ public:
 	 * in LaTeX the beginning of the text fits in some cases
 	 * (for example sections) exactly the label-width.
 	 */
-	int leftMargin(Row const * row) const;
+	int leftMargin(RowList::iterator rit) const;
 	///
 	int rightMargin(Buffer const &, Row const & row) const;
 
 	/** this calculates the specified parameters. needed when setting
 	 * the cursor and when creating a visible row */
-	void prepareToPrint(Row * row, float & x,
+	void prepareToPrint(RowList::iterator rit, float & x,
 			    float & fill_separator,
 			    float & fill_hfill,
 			    float & fill_label_hfill,
Index: src/text.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/text.C,v
retrieving revision 1.332
diff -u -p -r1.332 text.C
--- src/text.C	30 Mar 2003 18:42:36 -0000	1.332
+++ src/text.C	30 Mar 2003 20:10:46 -0000
@@ -110,11 +110,11 @@ void LyXText::top_y(int newy)
 }
 
 
-void LyXText::anchor_row(Row * row)
+void LyXText::anchor_row(RowList::iterator rit)
 {
 	int old_y = top_y();
 	anchor_row_offset_ = 0;
-	anchor_row_ = row;
+	anchor_row_ = rit;
 	anchor_row_offset_ = old_y - top_y();
 	lyxerr[Debug::GUI] << "anchor_row(): changing reference to row: "
 			   << &*anchor_row_ << " offset: " << anchor_row_offset_
@@ -338,7 +338,8 @@ bool LyXText::bidi_InRange(lyx::pos_type
 }
 
 
-void LyXText::computeBidiTables(Buffer const * buf, Row * row) const
+void LyXText::computeBidiTables(Buffer const * buf,
+				Row const & row) const
 {
 	bidi_same_direction = true;
 	if (!lyxrc.rtl_support) {
@@ -346,15 +347,15 @@ void LyXText::computeBidiTables(Buffer c
 		return;
 	}
 
-	Inset * inset = row->par()->inInset();
+	Inset * inset = row.par()->inInset();
 	if (inset && inset->owner() &&
 	    inset->owner()->lyxCode() == Inset::ERT_CODE) {
 		bidi_start = -1;
 		return;
 	}
 
-	bidi_start = row->pos();
-	bidi_end = row->lastPrintablePos();
+	bidi_start = row.pos();
+	bidi_end = row.lastPrintablePos();
 
 	if (bidi_start > bidi_end) {
 		bidi_start = -1;
@@ -376,25 +377,25 @@ void LyXText::computeBidiTables(Buffer c
 
 	pos_type stack[2];
 	bool const rtl_par =
-		row->par()->isRightToLeftPar(buf->params);
+		row.par()->isRightToLeftPar(buf->params);
 	int level = 0;
 	bool rtl = false;
 	bool rtl0 = false;
-	pos_type const body_pos = row->par()->beginningOfBody();
+	pos_type const body_pos = row.par()->beginningOfBody();
 
 	for (pos_type lpos = bidi_start; lpos <= bidi_end; ++lpos) {
-		bool is_space = row->par()->isLineSeparator(lpos);
+		bool is_space = row.par()->isLineSeparator(lpos);
 		pos_type const pos =
 			(is_space && lpos + 1 <= bidi_end &&
-			 !row->par()->isLineSeparator(lpos + 1) &&
-			 !row->par()->isNewline(lpos + 1))
+			 !row.par()->isLineSeparator(lpos + 1) &&
+			 !row.par()->isNewline(lpos + 1))
 			? lpos + 1 : lpos;
-		LyXFont font = row->par()->getFontSettings(buf->params, pos);
+		LyXFont font = row.par()->getFontSettings(buf->params, pos);
 		if (pos != lpos && 0 < lpos && rtl0 && font.isRightToLeft() &&
 		    font.number() == LyXFont::ON &&
-		    row->par()->getFontSettings(buf->params, lpos - 1).number()
+		    row.par()->getFontSettings(buf->params, lpos - 1).number()
 		    == LyXFont::ON) {
-			font = row->par()->getFontSettings(buf->params, lpos);
+			font = row.par()->getFontSettings(buf->params, lpos);
 			is_space = false;
 		}
 
@@ -404,7 +405,7 @@ void LyXText::computeBidiTables(Buffer c
 		int new_level;
 
 		if (lpos == body_pos - 1
-		    && row->pos() < body_pos - 1
+		    && row.pos() < body_pos - 1
 		    && is_space) {
 			new_level = (rtl_par) ? 1 : 0;
 			new_rtl = new_rtl0 = rtl_par;
@@ -499,19 +500,19 @@ bool LyXText::isBoundary(Buffer const * 
 }
 
 
-int LyXText::leftMargin(Row const * row) const
+int LyXText::leftMargin(RowList::iterator rit) const
 {
 	Inset * ins;
 
-	if (row->pos() < row->par()->size())
-		if ((row->par()->getChar(row->pos()) == Paragraph::META_INSET) &&
-		    (ins = row->par()->getInset(row->pos())) &&
+	if (rit->pos() < rit->par()->size())
+		if ((rit->par()->getChar(rit->pos()) == Paragraph::META_INSET) &&
+		    (ins = rit->par()->getInset(rit->pos())) &&
 		    (ins->needFullRow() || ins->display()))
 			return LEFT_MARGIN;
 
 	LyXTextClass const & tclass =
 		bv()->buffer()->params.getLyXTextClass();
-	LyXLayout_ptr const & layout = row->par()->layout();
+	LyXLayout_ptr const & layout = rit->par()->layout();
 
 	string parindent = layout->parindent;
 
@@ -522,12 +523,12 @@ int LyXText::leftMargin(Row const * row)
 	// this is the way, LyX handles the LaTeX-Environments.
 	// I have had this idea very late, so it seems to be a
 	// later added hack and this is true
-	if (!row->par()->getDepth()) {
-		if (row->par()->layout() == tclass.defaultLayout()) {
+	if (!rit->par()->getDepth()) {
+		if (rit->par()->layout() == tclass.defaultLayout()) {
 			// find the previous same level paragraph
-			if (row->par()->previous()) {
-				Paragraph * newpar = row->par()
-					->depthHook(row->par()->getDepth());
+			if (rit->par()->previous()) {
+				Paragraph * newpar = rit->par()
+					->depthHook(rit->par()->getDepth());
 				if (newpar &&
 				    newpar->layout()->nextnoindent)
 					parindent.erase();
@@ -536,7 +537,7 @@ int LyXText::leftMargin(Row const * row)
 	} else {
 		// find the next level paragraph
 
-		Paragraph * newpar = row->par()->outerHook();
+		Paragraph * newpar = rit->par()->outerHook();
 
 		// make a corresponding row. Needed to call LeftMargin()
 
@@ -551,10 +552,10 @@ int LyXText::leftMargin(Row const * row)
 			// is used to clear impossible depths after changing
 			// a layout. Since there is always a redo,
 			// LeftMargin() is always called
-			row->par()->params().depth(0);
+			rit->par()->params().depth(0);
 		}
 
-		if (newpar && row->par()->layout() == tclass.defaultLayout()) {
+		if (newpar && rit->par()->layout() == tclass.defaultLayout()) {
 			if (newpar->params().noindent())
 				parindent.erase();
 			else {
@@ -564,17 +565,17 @@ int LyXText::leftMargin(Row const * row)
 		}
 	}
 
-	LyXFont const labelfont = getLabelFont(bv()->buffer(), row->par());
+	LyXFont const labelfont = getLabelFont(bv()->buffer(), rit->par());
 	switch (layout->margintype) {
 	case MARGIN_DYNAMIC:
 		if (!layout->leftmargin.empty()) {
 			x += font_metrics::signedWidth(layout->leftmargin,
 						  tclass.defaultfont());
 		}
-		if (!row->par()->getLabelstring().empty()) {
+		if (!rit->par()->getLabelstring().empty()) {
 			x += font_metrics::signedWidth(layout->labelindent,
 						  labelfont);
-			x += font_metrics::width(row->par()->getLabelstring(),
+			x += font_metrics::width(rit->par()->getLabelstring(),
 					    labelfont);
 			x += font_metrics::width(layout->labelsep, labelfont);
 		}
@@ -582,9 +583,9 @@ int LyXText::leftMargin(Row const * row)
 	case MARGIN_MANUAL:
 		x += font_metrics::signedWidth(layout->labelindent, labelfont);
 		// The width of an empty par, even with manual label, should be 0
-		if (!row->par()->empty() && row->pos() >= row->par()->beginningOfBody()) {
-			if (!row->par()->getLabelWidthString().empty()) {
-				x += font_metrics::width(row->par()->getLabelWidthString(),
+		if (!rit->par()->empty() && rit->pos() >= rit->par()->beginningOfBody()) {
+			if (!rit->par()->getLabelWidthString().empty()) {
+				x += font_metrics::width(rit->par()->getLabelWidthString(),
 					       labelfont);
 				x += font_metrics::width(layout->labelsep, labelfont);
 			}
@@ -592,23 +593,23 @@ int LyXText::leftMargin(Row const * row)
 		break;
 	case MARGIN_STATIC:
 		x += font_metrics::signedWidth(layout->leftmargin, tclass.defaultfont()) * 4
-			/ (row->par()->getDepth() + 4);
+			/ (rit->par()->getDepth() + 4);
 		break;
 	case MARGIN_FIRST_DYNAMIC:
 		if (layout->labeltype == LABEL_MANUAL) {
-			if (row->pos() >= row->par()->beginningOfBody()) {
+			if (rit->pos() >= rit->par()->beginningOfBody()) {
 				x += font_metrics::signedWidth(layout->leftmargin,
 							  labelfont);
 			} else {
 				x += font_metrics::signedWidth(layout->labelindent,
 							  labelfont);
 			}
-		} else if (row->pos()
+		} else if (rit->pos()
 			   // Special case to fix problems with
 			   // theorems (JMarc)
 			   || (layout->labeltype == LABEL_STATIC
 			       && layout->latextype == LATEX_ENVIRONMENT
-			       && ! row->par()->isFirstInSequence())) {
+			       && ! rit->par()->isFirstInSequence())) {
 			x += font_metrics::signedWidth(layout->leftmargin,
 						  labelfont);
 		} else if (layout->labeltype != LABEL_TOP_ENVIRONMENT
@@ -618,7 +619,7 @@ int LyXText::leftMargin(Row const * row)
 			x += font_metrics::signedWidth(layout->labelindent,
 						  labelfont);
 			x += font_metrics::width(layout->labelsep, labelfont);
-			x += font_metrics::width(row->par()->getLabelstring(),
+			x += font_metrics::width(rit->par()->getLabelstring(),
 					    labelfont);
 		}
 		break;
@@ -630,16 +631,17 @@ int LyXText::leftMargin(Row const * row)
 		// are *NOT* allowed in the LaTeX realisation of this layout.
 
 		// find the first row of this paragraph
-		Row const * tmprow = row;
-		while (tmprow->previous()
-		       && tmprow->previous()->par() == row->par())
-			tmprow = tmprow->previous();
-
-		int minfill = tmprow->fill();
-		while (tmprow->next() && tmprow->next()->par() == row->par()) {
-			tmprow = tmprow->next();
-			if (tmprow->fill() < minfill)
-				minfill = tmprow->fill();
+		RowList::iterator tmprit = rit;
+		while (tmprit != rows().begin()
+		       && boost::prior(tmprit)->par() == rit->par())
+			--tmprit;
+
+		int minfill = tmprit->fill();
+		while (boost::next(tmprit) != rows().end() &&
+		       boost::next(tmprit)->par() == rit->par()) {
+			++tmprit;
+			if (tmprit->fill() < minfill)
+				minfill = tmprit->fill();
 		}
 
 		x += font_metrics::signedWidth(layout->leftmargin,
@@ -650,9 +652,9 @@ int LyXText::leftMargin(Row const * row)
 	}
 
 	if ((workWidth() > 0) &&
-		!row->par()->params().leftIndent().zero())
+		!rit->par()->params().leftIndent().zero())
 	{
-		LyXLength const len = row->par()->params().leftIndent();
+		LyXLength const len = rit->par()->params().leftIndent();
 		int const tw = inset_owner ?
 			inset_owner->latexTextWidth(bv()) : workWidth();
 		x += len.inPixels(tw);
@@ -660,26 +662,26 @@ int LyXText::leftMargin(Row const * row)
 
 	LyXAlignment align; // wrong type
 
-	if (row->par()->params().align() == LYX_ALIGN_LAYOUT)
+	if (rit->par()->params().align() == LYX_ALIGN_LAYOUT)
 		align = layout->align;
 	else
-		align = row->par()->params().align();
+		align = rit->par()->params().align();
 
 	// set the correct parindent
-	if (row->pos() == 0) {
+	if (rit->pos() == 0) {
 		if ((layout->labeltype == LABEL_NO_LABEL
 		     || layout->labeltype == LABEL_TOP_ENVIRONMENT
 		     || layout->labeltype == LABEL_CENTERED_TOP_ENVIRONMENT
 		     || (layout->labeltype == LABEL_STATIC
 			 && layout->latextype == LATEX_ENVIRONMENT
-			 && ! row->par()->isFirstInSequence()))
+			 && ! rit->par()->isFirstInSequence()))
 		    && align == LYX_ALIGN_BLOCK
-		    && !row->par()->params().noindent()
+		    && !rit->par()->params().noindent()
 			// in tabulars and ert paragraphs are never indented!
-			&& (!row->par()->inInset() || !row->par()->inInset()->owner() ||
-				(row->par()->inInset()->owner()->lyxCode() != Inset::TABULAR_CODE &&
-				 row->par()->inInset()->owner()->lyxCode() != Inset::ERT_CODE))
-		    && (row->par()->layout() != tclass.defaultLayout() ||
+			&& (!rit->par()->inInset() || !rit->par()->inInset()->owner() ||
+				(rit->par()->inInset()->owner()->lyxCode() != Inset::TABULAR_CODE &&
+				 rit->par()->inInset()->owner()->lyxCode() != Inset::ERT_CODE))
+		    && (rit->par()->layout() != tclass.defaultLayout() ||
 			bv()->buffer()->params.paragraph_separation ==
 			BufferParams::PARSEP_INDENT)) {
 			x += font_metrics::signedWidth(parindent,
@@ -700,7 +702,7 @@ int LyXText::rightMargin(Buffer const & 
 
 	if (row.pos() < row.par()->size())
 		if ((row.par()->getChar(row.pos()) == Paragraph::META_INSET) &&
-		    (ins=row.par()->getInset(row.pos())) &&
+		    (ins = row.par()->getInset(row.pos())) &&
 		    (ins->needFullRow() || ins->display()))
 			return PAPER_MARGIN;
 
@@ -810,7 +812,7 @@ LyXText::rowBreakPoint(Row const & row) 
 	// or the end of the par, then choose the possible break
 	// nearest that.
 
-	int const left = leftMargin(&row);
+	int const left = leftMargin(const_cast<Row*>(&row));
 	int x = left;
 
 	// pixel width since last breakpoint
@@ -1397,43 +1399,42 @@ void LyXText::breakAgain(RowList::iterat
 
 
 // this is just a little changed version of break again
-void LyXText::breakAgainOneRow(Row * row)
+void LyXText::breakAgainOneRow(RowList::iterator rit)
 {
-	lyx::Assert(row);
+	lyx::Assert(rit != rows().end());
 
-	pos_type z = rowBreakPoint(*row);
-	Row * tmprow = row;
+	pos_type z = rowBreakPoint(*rit);
+	RowList::iterator tmprit = rit;
 
-	if (z < row->par()->size()) {
-		if (!row->next()
-		    || (row->next() && row->next()->par() != row->par())) {
+	if (z < rit->par()->size()) {
+		if (boost::next(rit) == rows().end()
+		    || (boost::next(rit) != rows().end() && boost::next(rit)->par() != rit->par())) {
 			// insert a new row
 			++z;
-			rowlist_.insert(row->next(), new Row(row->par(), z));
-			row = row->next();
+			rit = rowlist_.insert(boost::next(rit), new Row(rit->par(), z));
 		} else  {
-			row = row->next();
+			++rit;
 			++z;
-			if (row->pos() != z)
-				row->pos(z);
+			if (rit->pos() != z)
+				rit->pos(z);
 		}
 	} else {
 		// if there are some rows too much, delete them
 		// only if you broke the whole paragraph!
-		Row * tmprow2 = row;
-		while (tmprow2->next()
-		       && tmprow2->next()->par() == row->par()) {
-			tmprow2 = tmprow2->next();
-		}
-		while (tmprow2 != row) {
-			tmprow2 = tmprow2->previous();
-			removeRow(tmprow2->next());
+		RowList::iterator tmprit2 = rit;
+		while (boost::next(tmprit2) != rows().end()
+		       && boost::next(tmprit2)->par() == rit->par()) {
+			++tmprit2;
+		}
+		while (tmprit2 != rit) {
+			--tmprit2;
+			removeRow(boost::next(tmprit2));
 		}
 	}
 
 	// set the dimensions of the row
-	tmprow->fill(fill(*tmprow, workWidth()));
-	setHeightOfRow(tmprow);
+	tmprit->fill(fill(*tmprit, workWidth()));
+	setHeightOfRow(tmprit);
 }
 
 
@@ -1809,7 +1810,7 @@ void LyXText::charInserted()
 }
 
 
-void LyXText::prepareToPrint(Row * row, float & x,
+void LyXText::prepareToPrint(RowList::iterator rit, float & x,
 			     float & fill_separator,
 			     float & fill_hfill,
 			     float & fill_label_hfill,
@@ -1818,44 +1819,44 @@ void LyXText::prepareToPrint(Row * row, 
 	float nlh;
 	float ns;
 
-	float w = row->fill();
+	float w = rit->fill();
 	fill_hfill = 0;
 	fill_label_hfill = 0;
 	fill_separator = 0;
 	fill_label_hfill = 0;
 
 	bool const is_rtl =
-		row->par()->isRightToLeftPar(bv()->buffer()->params);
+		rit->par()->isRightToLeftPar(bv()->buffer()->params);
 	if (is_rtl) {
 		x = (workWidth() > 0)
-			? rightMargin(*bv()->buffer(), *row) : 0;
+			? rightMargin(*bv()->buffer(), *rit) : 0;
 	} else
 		x = (workWidth() > 0)
-			? leftMargin(row) : 0;
+			? leftMargin(rit) : 0;
 
 	// is there a manual margin with a manual label
-	LyXLayout_ptr const & layout = row->par()->layout();
+	LyXLayout_ptr const & layout = rit->par()->layout();
 
 	if (layout->margintype == MARGIN_MANUAL
 	    && layout->labeltype == LABEL_MANUAL) {
 		/// We might have real hfills in the label part
-		nlh = row->numberOfLabelHfills();
+		nlh = rit->numberOfLabelHfills();
 
 		// A manual label par (e.g. List) has an auto-hfill
 		// between the label text and the body of the
 		// paragraph too.
 		// But we don't want to do this auto hfill if the par
 		// is empty.
-		if (!row->par()->empty())
+		if (!rit->par()->empty())
 			++nlh;
 
-		if (nlh && !row->par()->getLabelWidthString().empty()) {
-			fill_label_hfill = labelFill(*row) / nlh;
+		if (nlh && !rit->par()->getLabelWidthString().empty()) {
+			fill_label_hfill = labelFill(*rit) / nlh;
 		}
 	}
 
 	// are there any hfills in the row?
-	float const nh = row->numberOfHfills();
+	float const nh = rit->numberOfHfills();
 
 	if (nh) {
 		if (w > 0)
@@ -1863,26 +1864,26 @@ void LyXText::prepareToPrint(Row * row, 
 	// we don't have to look at the alignment if it is ALIGN_LEFT and
 	// if the row is already larger then the permitted width as then
 	// we force the LEFT_ALIGN'edness!
-	} else if (static_cast<int>(row->width()) < workWidth()) {
+	} else if (static_cast<int>(rit->width()) < workWidth()) {
 		// is it block, flushleft or flushright?
 		// set x how you need it
 		int align;
-		if (row->par()->params().align() == LYX_ALIGN_LAYOUT) {
+		if (rit->par()->params().align() == LYX_ALIGN_LAYOUT) {
 			align = layout->align;
 		} else {
-			align = row->par()->params().align();
+			align = rit->par()->params().align();
 		}
 
 		// center displayed insets
 		Inset * inset;
-		if (row->pos() < row->par()->size()
-		    && row->par()->isInset(row->pos())
-		    && (inset = row->par()->getInset(row->pos()))
+		if (rit->pos() < rit->par()->size()
+		    && rit->par()->isInset(rit->pos())
+		    && (inset = rit->par()->getInset(rit->pos()))
 		    && (inset->display())) // || (inset->scroll() < 0)))
 		    align = (inset->lyxCode() == Inset::MATHMACRO_CODE)
 			? LYX_ALIGN_BLOCK : LYX_ALIGN_CENTER;
 		// ERT insets should always be LEFT ALIGNED on screen
-		inset = row->par()->inInset();
+		inset = rit->par()->inInset();
 		if (inset && inset->owner() &&
 			inset->owner()->lyxCode() == Inset::ERT_CODE)
 		{
@@ -1891,12 +1892,13 @@ void LyXText::prepareToPrint(Row * row, 
 
 		switch (align) {
 	    case LYX_ALIGN_BLOCK:
-			ns = row->numberOfSeparators();
-			if (ns && row->next() && row->next()->par() == row->par() &&
-			    !(row->next()->par()->isNewline(row->next()->pos() - 1))
-			    && !(row->next()->par()->isInset(row->next()->pos())
-				 && row->next()->par()->getInset(row->next()->pos())
-				 && row->next()->par()->getInset(row->next()->pos())->display())
+			ns = rit->numberOfSeparators();
+			if (ns && boost::next(rit) != rows().end() &&
+			    boost::next(rit)->par() == rit->par() &&
+			    !(boost::next(rit)->par()->isNewline(boost::next(rit)->pos() - 1))
+			    && !(boost::next(rit)->par()->isInset(boost::next(rit)->pos())
+				 && boost::next(rit)->par()->getInset(boost::next(rit)->pos())
+				 && boost::next(rit)->par()->getInset(boost::next(rit)->pos())->display())
 				)
 			{
 				fill_separator = w / ns;
@@ -1915,16 +1917,16 @@ void LyXText::prepareToPrint(Row * row, 
 	if (!bidi)
 		return;
 
-	computeBidiTables(bv()->buffer(), row);
+	computeBidiTables(bv()->buffer(), *rit);
 	if (is_rtl) {
-		pos_type body_pos = row->par()->beginningOfBody();
-		pos_type last = row->lastPos();
+		pos_type body_pos = rit->par()->beginningOfBody();
+		pos_type last = rit->lastPos();
 
 		if (body_pos > 0 &&
 		    (body_pos - 1 > last ||
-		     !row->par()->isLineSeparator(body_pos - 1))) {
+		     !rit->par()->isLineSeparator(body_pos - 1))) {
 			x += font_metrics::width(layout->labelsep,
-					    getLabelFont(bv()->buffer(), row->par()));
+					    getLabelFont(bv()->buffer(), rit->par()));
 			if (body_pos - 1 <= last)
 				x += fill_label_hfill;
 		}
@@ -2780,9 +2782,8 @@ LyXText::getRow(Paragraph * par, pos_typ
 {
 	y = 0;
 
-	if (rows().empty()) {
+	if (rows().empty())
 		return rows().end();
-	}
 
 	// find the first row of the specified paragraph
 	RowList::iterator rit = rows().begin();
Index: src/text2.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/text2.C,v
retrieving revision 1.309
diff -u -p -r1.309 text2.C
--- src/text2.C	30 Mar 2003 18:42:36 -0000	1.309
+++ src/text2.C	30 Mar 2003 20:10:47 -0000
@@ -292,16 +292,15 @@ void LyXText::removeRow(RowList::iterato
 
 
 // remove all following rows of the paragraph of the specified row.
-void LyXText::removeParagraph(Row * row)
+void LyXText::removeParagraph(RowList::iterator rit)
 {
-	Paragraph * tmppar = row->par();
-	row = row->next();
+	Paragraph * tmppar = rit->par();
+	++rit;
 
-	Row * tmprow;
-	while (row && row->par() == tmppar) {
-		tmprow = row->next();
-		removeRow(row);
-		row = tmprow;
+	while (rit != rows().end() && rit->par() == tmppar) {
+		RowList::iterator tmprit = boost::next(rit);
+		removeRow(rit);
+		rit = tmprit;
 	}
 }
 
@@ -1879,7 +1878,7 @@ void LyXText::setCurrentFont()
 // returns the column near the specified x-coordinate of the row
 // x is set to the real beginning of this column
 pos_type
-LyXText::getColumnNearX(Row * row, int & x,
+LyXText::getColumnNearX(RowList::iterator rit, int & x,
 			bool & boundary) const
 {
 	float tmpx = 0.0;
@@ -1887,27 +1886,27 @@ LyXText::getColumnNearX(Row * row, int &
 	float fill_hfill;
 	float fill_label_hfill;
 
-	prepareToPrint(row, tmpx, fill_separator,
+	prepareToPrint(&*rit, tmpx, fill_separator,
 		       fill_hfill, fill_label_hfill);
 
-	pos_type vc = row->pos();
-	pos_type last = row->lastPrintablePos();
+	pos_type vc = rit->pos();
+	pos_type last = rit->lastPrintablePos();
 	pos_type c = 0;
 
-	LyXLayout_ptr const & layout = row->par()->layout();
+	LyXLayout_ptr const & layout = rit->par()->layout();
 
 	bool left_side = false;
 
-	pos_type body_pos = row->par()->beginningOfBody();
+	pos_type body_pos = rit->par()->beginningOfBody();
 	float last_tmpx = tmpx;
 
 	if (body_pos > 0 &&
 	    (body_pos - 1 > last ||
-	     !row->par()->isLineSeparator(body_pos - 1)))
+	     !rit->par()->isLineSeparator(body_pos - 1)))
 		body_pos = 0;
 
 	// check for empty row
-	if (!row->par()->size()) {
+	if (!rit->par()->size()) {
 		x = int(tmpx);
 		return 0;
 	}
@@ -1915,26 +1914,26 @@ LyXText::getColumnNearX(Row * row, int &
 	while (vc <= last && tmpx <= x) {
 		c = vis2log(vc);
 		last_tmpx = tmpx;
-		if (body_pos > 0 && c == body_pos-1) {
+		if (body_pos > 0 && c == body_pos - 1) {
 			tmpx += fill_label_hfill +
 				font_metrics::width(layout->labelsep,
-					       getLabelFont(bv()->buffer(), row->par()));
-			if (row->par()->isLineSeparator(body_pos - 1))
-				tmpx -= singleWidth(row->par(), body_pos-1);
+					       getLabelFont(bv()->buffer(), rit->par()));
+			if (rit->par()->isLineSeparator(body_pos - 1))
+				tmpx -= singleWidth(rit->par(), body_pos - 1);
 		}
 
-		if (row->hfillExpansion(c)) {
-			tmpx += singleWidth(row->par(), c);
+		if (rit->hfillExpansion(c)) {
+			tmpx += singleWidth(rit->par(), c);
 			if (c >= body_pos)
 				tmpx += fill_hfill;
 			else
 				tmpx += fill_label_hfill;
-		} else if (row->par()->isSeparator(c)) {
-			tmpx += singleWidth(row->par(), c);
+		} else if (rit->par()->isSeparator(c)) {
+			tmpx += singleWidth(rit->par(), c);
 			if (c >= body_pos)
 				tmpx+= fill_separator;
 		} else {
-			tmpx += singleWidth(row->par(), c);
+			tmpx += singleWidth(rit->par(), c);
 		}
 		++vc;
 	}
@@ -1950,17 +1949,18 @@ LyXText::getColumnNearX(Row * row, int &
 	boundary = false;
 	bool const lastrow = lyxrc.rtl_support // This is not needed, but gives
 					 // some speedup if rtl_support=false
-		&& (!row->next() || row->next()->par() != row->par());
+		&& (boost::next(rit) == rows().end() ||
+		    boost::next(rit)->par() != rit->par());
 	bool const rtl = (lastrow)
-		? row->par()->isRightToLeftPar(bv()->buffer()->params)
+		? rit->par()->isRightToLeftPar(bv()->buffer()->params)
 		: false; // If lastrow is false, we don't need to compute
 			 // the value of rtl.
 
 	if (lastrow &&
-		 ((rtl &&  left_side && vc == row->pos() && x < tmpx - 5) ||
+		 ((rtl &&  left_side && vc == rit->pos() && x < tmpx - 5) ||
 		   (!rtl && !left_side && vc == last + 1   && x > tmpx + 5)))
 		c = last + 1;
-	else if (vc == row->pos()) {
+	else if (vc == rit->pos()) {
 		c = vis2log(vc);
 		if (bidi_level(c) % 2 == 1)
 			++c;
@@ -1969,20 +1969,20 @@ LyXText::getColumnNearX(Row * row, int &
 		bool const rtl = (bidi_level(c) % 2 == 1);
 		if (left_side == rtl) {
 			++c;
-			boundary = isBoundary(bv()->buffer(), row->par(), c);
+			boundary = isBoundary(bv()->buffer(), rit->par(), c);
 		}
 	}
 
-	if (row->pos() <= last && c > last
-	    && row->par()->isNewline(last)) {
+	if (rit->pos() <= last && c > last
+	    && rit->par()->isNewline(last)) {
 		if (bidi_level(last) % 2 == 0)
-			tmpx -= singleWidth(row->par(), last);
+			tmpx -= singleWidth(rit->par(), last);
 		else
-			tmpx += singleWidth(row->par(), last);
+			tmpx += singleWidth(rit->par(), last);
 		c = last;
 	}
 
-	c -= row->pos();
+	c -= rit->pos();
 	x = int(tmpx);
 	return c;
 }
@@ -2424,7 +2424,7 @@ void LyXText::postPaint(int start_y)
 
 // FIXME: we should probably remove this y parameter,
 // make refresh_y be 0, and use row->y etc.
-void LyXText::postRowPaint(Row * row, int start_y)
+void LyXText::postRowPaint(RowList::iterator rit, int start_y)
 {
 	if (refresh_status_ != REFRESH_NONE && refresh_y < start_y) {
 		refresh_status_ = REFRESH_AREA;
@@ -2437,7 +2437,7 @@ void LyXText::postRowPaint(Row * row, in
 		return;
 
 	refresh_status_ = REFRESH_ROW;
-	refresh_row = row;
+	refresh_row = rit;
 
 	if (!inset_owner)
 		return;
-- 
        Lgb

Reply via email to