]> git.lyx.org Git - features.git/commitdiff
Enable use of Row::changed()
authorAbdelrazak Younes <younes@lyx.org>
Wed, 29 Aug 2007 21:33:11 +0000 (21:33 +0000)
committerAbdelrazak Younes <younes@lyx.org>
Wed, 29 Aug 2007 21:33:11 +0000 (21:33 +0000)
* TextMetrics::redoParagraph(): crop the RowList if it is too big.
* ParagraphMetrics::reset():  don't clear its RowList.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19897 a592a061-630c-0410-9148-cb99ea01b6c8

src/ParagraphMetrics.cpp
src/TextMetrics.cpp

index deae1fdd95763d60792d16f0ae0453e80a98ed6a..65aedd2c1c29c831623b0e887f17b64fcac54c75 100644 (file)
@@ -90,7 +90,6 @@ void ParagraphMetrics::reset(Paragraph const & par)
 {
        par_ = &par;
        dim_ = Dimension();
-       rows_.clear();
 }
 
 
index 036af6327dcec4e139ef52e8650ab3ae029d50e8..5bdd4c2755f98f286ff6b5ad31cc1dd073ed01ed 100644 (file)
@@ -259,6 +259,9 @@ bool TextMetrics::redoParagraph(pit_type const pit)
                pm.dim().des += dim.height();
        } while (first < par.size());
 
+       if (row_index < pm.rows().size())
+               pm.rows().resize(row_index);
+
        // Make sure that if a par ends in newline, there is one more row
        // under it
        if (first > 0 && par.isNewline(first - 1)) {