From: Lars Gullik Bjønnes Date: Tue, 5 Nov 2002 18:25:53 +0000 (+0000) Subject: fix bug 668 X-Git-Tag: 1.6.10~18022 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=176b5ef3577e06b95448d28a55dce9858e4273ad;p=lyx.git fix bug 668 git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@5585 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/ChangeLog b/src/ChangeLog index c03ba88b3c..75a7292dbe 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2002-11-05 Lars Gullik Bjønnes + + * text2.C (updateCounters): fix bug 668 + 2002-11-04 Dekel Tsur * text3.C (dispatch): Do not make the buffer dirty when moving the diff --git a/src/text2.C b/src/text2.C index 720abda360..fc29b3646d 100644 --- a/src/text2.C +++ b/src/text2.C @@ -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(); } }