Alfredo Braunstein wrote:
> Andre Poenitz wrote:
>
>> This removes the paragraph rebreak on a changed label.
>
> Why is it so expensive? Isn't it because on every updated label the
> paragraph rebreak fires an updateRowPositions? (i.e. the thing gets a
> complexity if O(labels * pars))?
>
> If that is the case, it would suffice to call redoParagraphInternal
> instead of redoParagraph and do an updateRowPositions at the end...
With the attached I get 13 secs. on my AMD2600+ for UserGuide20.lyx
Alfredo
Index: text2.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/text2.C,v
retrieving revision 1.510
diff -u -p -u -r1.510 text2.C
--- text2.C 24 Nov 2003 17:29:08 -0000 1.510
+++ text2.C 25 Nov 2003 08:40:42 -0000
@@ -1020,6 +1020,7 @@ void LyXText::updateCounters()
ParagraphList::iterator beg = ownerParagraphs().begin();
ParagraphList::iterator end = ownerParagraphs().end();
for (ParagraphList::iterator pit = beg; pit != end; ++pit) {
+ string const oldLabel = pit->params().labelString();
size_t maxdepth = 0;
if (pit != beg)
maxdepth = boost::prior(pit)->getMaxDepthAfter();
@@ -1029,7 +1030,11 @@ void LyXText::updateCounters()
// setCounter can potentially change the labelString.
setCounter(*bv()->buffer(), pit);
+ string const & newLabel = pit->params().labelString();
+ if (oldLabel != newLabel)
+ redoParagraphInternal(pit);
}
+ updateRowPositions();
}