[EMAIL PROTECTED] (Lars Gullik Bjønnes) writes:

| Jean-Marc Lasgouttes <[EMAIL PROTECTED]> writes:
>
| | I took a look at bug 668 and here are my findings (as added to the bug
| | itself). Lars, I hope this is enough to get you started...
>
| Ok, I have two patches for this one. Two different ones that both seem
| to fix the problem.
>
| I fear that one of them only fixes this special case, but I hope that
| other one is generic enough to fix all such problems:

Ok I think the generic one is good enough, and this is my final patch
for this problem:

diff -u -p -r1.264 text2.C
--- src/text2.C 4 Nov 2002 02:12:30 -0000       1.264
+++ src/text2.C 5 Nov 2002 18:21:55 -0000
@@ -1362,8 +1362,7 @@ void LyXText::setCounter(Buffer const *
 }


-// Updates all counters BEHIND the row. Changed paragraphs
-// with a dynamic left margin will be rebroken.
+// Updates all counters. Paragraphs with changed label string will be rebroken
 void LyXText::updateCounters(BufferView * bview) const
 {
        Paragraph * par;
@@ -1378,18 +1377,17 @@ void LyXText::updateCounters(BufferView
                while (row->par() != par)
                        row = row->next();

+               string const oldLabel = par->params().labelString();
+
                setCounter(bview->buffer(), par);

-               // now check for the headline layouts. remember that they
-               // have a dynamic left margin
-               LyXLayout_ptr const & layout = par->layout();
-
-               if (layout->margintype == MARGIN_DYNAMIC
-                   || layout->labeltype == LABEL_SENSITIVE) {
-                       // Rebreak the paragraph
+               string const & newLabel = par->params().labelString();
+
+               if (oldLabel.empty() && !newLabel.empty()) {
                        removeParagraph(row);
                        appendParagraph(bview, row);
                }
+
                par = par->next();
        }
 }

-- 
        Lgb

Reply via email to