]> git.lyx.org Git - features.git/commitdiff
fix row breaking
authorAndré Pönitz <poenitz@gmx.net>
Tue, 21 Oct 2003 17:16:01 +0000 (17:16 +0000)
committerAndré Pönitz <poenitz@gmx.net>
Tue, 21 Oct 2003 17:16:01 +0000 (17:16 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@7944 a592a061-630c-0410-9148-cb99ea01b6c8

src/text.C

index c89e60e6362367bbab0e5658ca30e15a8172656f..2c76feea3cd58306415d7a960e28e14796f93a1b 100644 (file)
@@ -717,10 +717,9 @@ pos_type LyXText::rowBreakPoint(ParagraphList::iterator pit,
                }
 
                x += thiswidth;
+               //lyxerr << "i: " << i << " x: " << x << " width: " << width << endl;
                chunkwidth += thiswidth;
 
-               InsetOld * in = pit->getInset(i);
-
                // break before a character that will fall off
                // the right of the row
                if (x >= width) {
@@ -728,11 +727,12 @@ pos_type LyXText::rowBreakPoint(ParagraphList::iterator pit,
                        if (point == last || chunkwidth >= width - left) {
                                if (pos < i) {
                                        point = i - 1;
-                                       break;
                                }
                        }
+                       break;
                }
 
+               InsetOld * in = pit->getInset(i);
                if (!in || in->isChar()) {
                        // some insets are line separators too
                        if (pit->isLineSeparator(i)) {
@@ -2143,6 +2143,7 @@ int LyXText::redoParagraphInternal(ParagraphList::iterator pit)
                Row row(z);
                z = rowBreakPoint(pit, row) + 1;
                row.end(z);
+               lyxerr << "break point at " << z << "/" << pit->size() << endl;
                pit->rows.push_back(row);
                RowList::iterator rit = boost::prior(pit->rows.end());
                int const f = fill(pit, *rit, ww);