2005-07-15 <lgb@tandberg.net>
+ * text.C (setCursorFromCoordinates): add a debug statement
+
+ * text2.C (getColumnNearX): bug 1825 make sure that we don't
+ return a pos that is not on the row
+
* output_latex.C (TeXDeeper): get rid of potential dereferencing
of past the end iterator
bool bound = false;
int xx = x;
pos_type const pos = row.pos() + getColumnNearX(pit, row, xx, bound);
+
+ lyxerr[Debug::DEBUG]
+ << BOOST_CURRENT_FUNCTION
+ << ": setting cursor pit: " << pit
+ << " pos: " << pos
+ << endl;
+
setCursor(cur, pit, pos, true, bound);
}
using std::endl;
using std::ostringstream;
using std::string;
+using std::min;
LyXText::LyXText(BufferView * bv)
}
x = int(tmpx) + xo;
- return c - row.pos();
+
+ if (end == par.size())
+ return c - row.pos();
+
+ return min(c - row.pos(), end - 1 - row.pos());
}