]> git.lyx.org Git - lyx.git/commitdiff
fix bug 668
authorLars Gullik Bjønnes <larsbj@gullik.org>
Tue, 5 Nov 2002 18:25:53 +0000 (18:25 +0000)
committerLars Gullik Bjønnes <larsbj@gullik.org>
Tue, 5 Nov 2002 18:25:53 +0000 (18:25 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@5585 a592a061-630c-0410-9148-cb99ea01b6c8

src/ChangeLog
src/text2.C

index c03ba88b3c6c280afb2b4a484843f2103efd5d7b..75a7292dbee529737c5e9f0446dfe1ef52111e7b 100644 (file)
@@ -1,3 +1,7 @@
+2002-11-05  Lars Gullik Bjønnes  <larsbj@birdstep.com>
+
+       * text2.C (updateCounters): fix bug 668
+
 2002-11-04  Dekel Tsur  <dekelts@tau.ac.il>
 
        * text3.C (dispatch): Do not make the buffer dirty when moving the
index 720abda3605a34d17cd702d135ad09788fd0801f..fc29b3646d6384c05a52d95b661e8164a5a4140a 100644 (file)
@@ -1362,8 +1362,7 @@ void LyXText::setCounter(Buffer const * buf, Paragraph * par) 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 * bview) const
                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();
+               string const & newLabel = par->params().labelString();
 
-               if (layout->margintype == MARGIN_DYNAMIC
-                   || layout->labeltype == LABEL_SENSITIVE) {
-                       // Rebreak the paragraph
+               if (oldLabel.empty() && !newLabel.empty()) {
                        removeParagraph(row);
                        appendParagraph(bview, row);
                }
+
                par = par->next();
        }
 }