]> git.lyx.org Git - features.git/blobdiff - src/TextMetrics.cpp
Fix bug #6327: Crash in new file and press PgUp button.
[features.git] / src / TextMetrics.cpp
index 8a7d281e713c95164d29471835c22ecece403394..466942de1e7cfe4bb66475a0e52ebe64e2775ad8 100644 (file)
@@ -1462,7 +1462,7 @@ Row const & TextMetrics::getPitAndRowNearY(int & y, pit_type & pit,
                        if (rit != rlast) {
                                y = yy + rit->height();
                                ++rit;
-                       } else if (pit != int(par_metrics_.size())) {
+                       } else if (pit < int(text_->paragraphs().size()) - 1) {
                                ++pit;
                                newParMetricsDown();
                                ParagraphMetrics const & pm2 = par_metrics_[pit];