]> git.lyx.org Git - features.git/commitdiff
reuse new redoParagraph in LyXText::init
authorAndré Pönitz <poenitz@gmx.net>
Fri, 1 Aug 2003 12:33:42 +0000 (12:33 +0000)
committerAndré Pönitz <poenitz@gmx.net>
Fri, 1 Aug 2003 12:33:42 +0000 (12:33 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@7472 a592a061-630c-0410-9148-cb99ea01b6c8

src/text2.C

index a1a4327721bc6ab849c4226b4066e87763c98093..e5dc042c0305470bb7e108fe9433cf4773f40c9e 100644 (file)
@@ -89,13 +89,9 @@ void LyXText::init(BufferView * bview)
        anchor_row_ = rows().end();
        anchor_row_offset_ = 0;
 
-       ParagraphList::iterator pit = ownerParagraphs().begin();
-       ParagraphList::iterator end = ownerParagraphs().end();
+       current_font = getFont(ownerParagraphs().begin(), 0);
 
-       current_font = getFont(pit, 0);
-
-       for (; pit != end; ++pit)
-               insertParagraph(pit, rowlist_.end());
+       redoParagraphs(ownerParagraphs().begin(), ownerParagraphs().end());
 
        setCursorIntern(rowlist_.begin()->par(), 0);
        selection.cursor = cursor;
@@ -642,21 +638,15 @@ void LyXText::redoParagraph(ParagraphList::iterator pit)
 {
        RowList::iterator rit = firstRow(pit);
 
-       if (rit == rows().end()) {
-               lyxerr << "LyXText::redoParagraphs: should not happen\n";
-               Assert(0);
-       }
-
-       // remove it
+       // remove paragraph from rowlist
        while (rit != rows().end() && rit->par() == pit) {
                RowList::iterator rit2 = rit++;
                removeRow(rit2);
        }
 
-       // Reinsert the paragraph.
+       // reinsert the paragraph
        insertParagraph(pit, rit);
        setHeightOfRow(rows().begin());
-       updateCounters();
 }