From d4bf8e0a21cc4d90c178aa992ee48c202d64ea89 Mon Sep 17 00:00:00 2001 From: Abdelrazak Younes Date: Wed, 5 Sep 2007 21:26:17 +0000 Subject: [PATCH] * TextMetrics::drawSelection(): use parMetrics() instead of direct access just in case. Should fix crash on selection with PageUp. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@20081 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/TextMetrics.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/TextMetrics.cpp b/src/TextMetrics.cpp index d717d96626..2c6ec96c6d 100644 --- a/src/TextMetrics.cpp +++ b/src/TextMetrics.cpp @@ -1913,12 +1913,12 @@ void TextMetrics::drawParagraph(PainterInfo & pi, pit_type pit, int x, int y) co } -// only used for inset right now. should also be used for main text +// FIXME: only take care of one row! void TextMetrics::drawSelection(PainterInfo & pi, DocIterator const & beg, DocIterator const & end, int x) const { - ParagraphMetrics const & pm1 = par_metrics_[beg.pit()]; - ParagraphMetrics const & pm2 = par_metrics_[end.pit()]; + ParagraphMetrics const & pm1 = parMetrics(beg.pit()); + ParagraphMetrics const & pm2 = parMetrics(end.pit()); Row const & row1 = pm1.getRow(beg.pos(), beg.boundary()); Row const & row2 = pm2.getRow(end.pos(), end.boundary());