]> git.lyx.org Git - lyx.git/commitdiff
fix row breaking before display()ed insets
authorAlfredo Braunstein <abraunst@lyx.org>
Mon, 1 Mar 2004 17:25:16 +0000 (17:25 +0000)
committerAlfredo Braunstein <abraunst@lyx.org>
Mon, 1 Mar 2004 17:25:16 +0000 (17:25 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@8473 a592a061-630c-0410-9148-cb99ea01b6c8

src/ChangeLog
src/text.C

index e399c247fbf679dea533fef47f9c8ea7624c3357..b96e47b5c97ad485a497de8f25ef7e4b26253f2d 100644 (file)
@@ -1,11 +1,6 @@
 2004-03-01  Alfredo Braunstein  <abraunst@lyx.org>
 
-       * lyxtext.h:
-       * text.C:
-       * text2.C:
-       * rowpainter.C:
-       * BufferView_pimpl.C: rename textwidth -> maxwidth, 
-       prepareToPrint -> computeRowMetrics and remove textWidth accessor.
+       * text.C (rowBreakPoint): fix breaking before displayed insets
 
 2004-03-01  André Pönitz  <poenitz@gmx.net>
 
        * text2.C:
        * text3.C: adjust
 
+2004-03-01  Alfredo Braunstein  <abraunst@lyx.org>
+
+       * lyxtext.h:
+       * text.C:
+       * text2.C:
+       * rowpainter.C:
+       * BufferView_pimpl.C: rename textwidth -> maxwidth, 
+       prepareToPrint -> computeRowMetrics and remove textWidth accessor.
+
 2004-03-01  Alfredo Braunstein  <abraunst@lyx.org>
 
        * Bidi.[Ch] (computeTables): const correctness
index 3951e81102edf7c2343df372a92a5959982cad64..74ccfbef415d0244415da1b8a230f134b206f474 100644 (file)
@@ -493,23 +493,6 @@ void LyXText::rowBreakPoint(ParagraphList::iterator pit, Row & row) const
        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);
 
                {
@@ -544,6 +527,23 @@ void LyXText::rowBreakPoint(ParagraphList::iterator pit, Row & row) const
                        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)) {
@@ -554,10 +554,9 @@ void LyXText::rowBreakPoint(ParagraphList::iterator pit, Row & row) const
                }
        }
 
-       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