+2003-09-04 Lars Gullik Bjønnes <larsbj@lyx.org>
+
+ * text2.C (cursorEnd): simplify
+ (setCursor): adjust
+ (getColumnNearX): adjust
+
+ * text.C (computeBidiTables): adjust
+ (fill): adjust
+
+ * rowpainter.C (paintChars): adjust
+ (paintSelection): adjust
+ (paintChangeBar): adjust
+ (paintText): adjust
+
+ * lyxrow_funcs.C (lastPrintablePos): remove, all users now call
+ lastPos instead.
+ (numberOfSeparators): adjust
+
2003-09-03 Martin Vermeer <martin.vermeer@hut.fi>
* LyXAction.C:
return boost::next(rit) == par.rows.end();
}
-
+#if 1
pos_type lastPos(Paragraph const & par, RowList::iterator rit)
{
if (par.empty())
}
return boost::next(rit)->pos() - 1;
}
-
-
-pos_type lastPrintablePos(Paragraph const & par, RowList::iterator rit)
+#else
+pos_type lastPos(Paragraph const &, RowList::iterator rit)
{
- pos_type const last = lastPos(par, rit);
-
- // if this row is an end of par, just act like lastPos()
- if (isParEnd(par, rit))
- return last;
-
- return last;
+ return rit->end() - 1;
}
+#endif
int numberOfSeparators(Paragraph const & par, RowList::iterator rit)
{
- pos_type const last = lastPrintablePos(par, rit);
+ pos_type const last = lastPos(par, rit);
int n = 0;
pos_type p = max(rit->pos(), par.beginningOfBody());
for ( ; p < last; ++p)
lyx::pos_type lastPos(Paragraph const & par, RowList::iterator rit);
-lyx::pos_type lastPrintablePos(Paragraph const & par, RowList::iterator rit);
-
int numberOfSeparators(Paragraph const & par, RowList::iterator rit);
int numberOfHfills(Paragraph const & par, RowList::iterator rit);
void RowPainter::paintChars(pos_type & vpos, bool hebrew, bool arabic)
{
pos_type pos = text_.vis2log(vpos);
- pos_type const last = lastPrintablePos(*pit_, row_);
+ pos_type const last = lastPos(*pit_, row_);
LyXFont orig_font = getFont(pos);
// first character
int(x_), row_->height(), LColor::selection);
pos_type const body_pos = pit_->beginningOfBody();
- pos_type const last = lastPrintablePos(*pit_, row_);
+ pos_type const last = lastPos(*pit_, row_);
double tmpx = x_;
for (pos_type vpos = row_->pos(); vpos <= last; ++vpos) {
void RowPainter::paintChangeBar()
{
pos_type const start = row_->pos();
- pos_type const end = lastPrintablePos(*pit_, row_);
+ pos_type const end = lastPos(*pit_, row_);
if (!pit_->isChanged(start, end))
return;
void RowPainter::paintText()
{
- pos_type const last = lastPrintablePos(*pit_, row_);
+ pos_type const last = lastPos(*pit_, row_);
pos_type body_pos = pit_->beginningOfBody();
if (body_pos > 0 &&
(body_pos - 1 > last || !pit_->isLineSeparator(body_pos - 1))) {
}
bidi_start = row->pos();
- bidi_end = lastPrintablePos(*pit, row);
+ bidi_end = lastPos(*pit, row);
if (bidi_start > bidi_end) {
bidi_start = -1;
int w;
// get the pure distance
- pos_type const last = lastPrintablePos(*pit, row);
+ pos_type const last = lastPos(*pit, row);
LyXLayout_ptr const & layout = pit->layout();
void LyXText::cursorEnd()
{
- if (cursor.par()->empty())
- return;
-
- RowList::iterator rit = cursorRow();
- ParagraphList::iterator pit = cursor.par();
- pos_type pos = lastPos(*pit, rit);
- /* cursor should be before a hard newline only */
- if (!pit->isNewline(pos))
- ++pos;
- setCursor(pit, pos);
+ setCursor(cursor.par(), cursorRow()->end() - 1);
}
// y is now the cursor baseline
cur.y(y);
- pos_type last = lastPrintablePos(*pit, row);
+ pos_type last = lastPos(*pit, row);
// None of these should happen, but we're scaredy-cats
if (pos > pit->size()) {
double fill_label_hfill = rit->fill_label_hfill();
pos_type vc = rit->pos();
- pos_type last = lastPrintablePos(*pit, rit);
+ pos_type last = lastPos(*pit, rit);
pos_type c = 0;
LyXLayout_ptr const & layout = pit->layout();