From fd34bd39149f4b9d4cdb2898daa806e7c4c343e6 Mon Sep 17 00:00:00 2001 From: Abdelrazak Younes Date: Fri, 16 Nov 2007 23:00:57 +0000 Subject: [PATCH] Cosmetics and cleanup. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21649 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/TextMetrics.cpp | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/src/TextMetrics.cpp b/src/TextMetrics.cpp index b7cb0d67f0..9b576e2a92 100644 --- a/src/TextMetrics.cpp +++ b/src/TextMetrics.cpp @@ -1888,29 +1888,24 @@ void TextMetrics::draw(PainterInfo & pi, int x, int y) const void TextMetrics::drawParagraph(PainterInfo & pi, pit_type pit, int x, int y) const { -// lyxerr << " paintPar: pit: " << pit << " at y: " << y << endl; - int const ww = bv_->workHeight(); - ParagraphMetrics const & pm = par_metrics_[pit]; if (pm.rows().empty()) return; - RowList::const_iterator const rb = pm.rows().begin(); - RowList::const_iterator const re = pm.rows().end(); - Bidi bidi; - bool const original_drawing_state = pi.pain.isDrawingEnabled(); + int const ww = bv_->workHeight(); + size_t const nrows = pm.rows().size(); - size_t nrows = pm.rows().size(); for (size_t i = 0; i != nrows; ++i) { + Row const & row = pm.rows()[i]; if (i) y += row.ascent(); bool const inside = (y + row.descent() >= 0 && y - row.ascent() < ww); - // it is not needed to draw on screen if we are not inside. + // It is not needed to draw on screen if we are not inside. pi.pain.setDrawingEnabled(inside && original_drawing_state); RowPainter rp(pi, *text_, pit, row, bidi, x, y);