[EMAIL PROTECTED] schrieb:
Modified: lyx-devel/trunk/src/TextMetrics.C
URL: http://www.lyx.org/trac/file/lyx-devel/trunk/src/TextMetrics.C?rev=16452
==============================================================================
--- lyx-devel/trunk/src/TextMetrics.C (original)
+++ lyx-devel/trunk/src/TextMetrics.C Mon Jan 1 10:46:12 2007
@@ -84,16 +84,18 @@
int numberOfHfills(Paragraph const & par, Row const & row)
{
- pos_type const last = row.endpos();
+ pos_type last = row.endpos();
pos_type first = row.pos();
+ pos_type const par_size = par.size();
// hfill *DO* count at the beginning of paragraphs!
if (first) {
- while (first < last && par.isHfill(first))
+ while (first < last && first < par_size && par.isHfill(first))
++first;
}
first = max(first, par.beginOfBody());
+ last = min(last, par_size);
int n = 0;
for (pos_type p = first; p < last; ++p) {
Is this a real bug fix (addressing a cause) or just a workaround (curing
the effect)?
In the latter case, as a minimum I ask for an additional lyxerr message
that states that something went terribly wrong. Otherwise, we will never
be able to find the cause.
Michael