Load UG, go to 5.1.5 Sums and integrals. The note inset extends to the right
into wonderland. 

The problem is that after it there is a displayed math inset, and the
rebreak code just jumps into breaking before that displayed inset, not
realizing that it should break even before the note.

So just re-ordering rowBreakPoint a bit to put first the "too long for this
row" condition that breaks /before/ the current char, and after that all
conditions that could break /after/ the current char gets us going.

Alfredo

? PosIterator.C-save
? PosIterator.h-save
? all.diff
? bfs.cpp
? files
? save
? frontends/screen.C-save
Index: text.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/text.C,v
retrieving revision 1.544
diff -u -p -u -r1.544 text.C
--- text.C	1 Mar 2004 10:46:58 -0000	1.544
+++ text.C	1 Mar 2004 11:22:18 -0000
@@ -486,23 +486,6 @@ void LyXText::rowBreakPoint(ParagraphLis
 	pos_type point = end;
 	pos_type i = pos;
 	for ( ; i < end; ++i, ++fi) {
-		if (pit->isNewline(i)) {
-			point = i + 1;
-			break;
-		}
-		// Break before...
-		if (i + 1 < end) {
-			if (pit->isInset(i + 1) && pit->getInset(i + 1)->display()) {
-				point = i + 1;
-				break;
-			}
-			// ...and after.
-			if (pit->isInset(i) && pit->getInset(i)->display()) {
-				point = i + 1;
-				break;
-			}
-		}
-
 		char const c = pit->getChar(i);
 
 		{
@@ -537,6 +520,23 @@ void LyXText::rowBreakPoint(ParagraphLis
 			break;
 		}
 
+		if (pit->isNewline(i)) {
+			point = i + 1;
+			break;
+		}
+		// Break before...
+		if (i + 1 < end) {
+			if (pit->isInset(i + 1) && pit->getInset(i + 1)->display()) {
+				point = i + 1;
+				break;
+			}
+			// ...and after.
+			if (pit->isInset(i) && pit->getInset(i)->display()) {
+				point = i + 1;
+				break;
+			}
+		}
+		
 		if (!pit->isInset(i) || pit->getInset(i)->isChar()) {
 			// some insets are line separators too
 			if (pit->isLineSeparator(i)) {
@@ -547,10 +547,9 @@ void LyXText::rowBreakPoint(ParagraphLis
 		}
 	}
 
-	if (i == end && x < width) {
-		// maybe found one, but the par is short enough.
+	// maybe found one, but the par is short enough.
+	if (i == end && x < width)
 		point = end;
-	}
 
 	// manual labels cannot be broken in LaTeX. But we
 	// want to make our on-screen rendering of footnotes

Reply via email to