From 3c296efd19df779b1bbb2010d992bfc4117b7c8e Mon Sep 17 00:00:00 2001 From: Abdelrazak Younes Date: Sat, 28 Oct 2006 09:59:43 +0000 Subject: [PATCH] simplify paintText() interface. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15590 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/frontends/qt4/GuiWorkArea.C | 3 +-- src/rowpainter.C | 5 +++-- src/rowpainter.h | 3 +-- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/frontends/qt4/GuiWorkArea.C b/src/frontends/qt4/GuiWorkArea.C index 8cc2c88a6a..0fed2bf19d 100644 --- a/src/frontends/qt4/GuiWorkArea.C +++ b/src/frontends/qt4/GuiWorkArea.C @@ -594,8 +594,7 @@ void GuiWorkArea::paintEvent(QPaintEvent * ev) //lyxerr << "real drawing" << endl; QLPainter pain(viewport()); - ViewMetricsInfo const & vi = buffer_view_->viewMetricsInfo(); - paintText(*buffer_view_, vi, pain); + paintText(*buffer_view_, pain); } diff --git a/src/rowpainter.C b/src/rowpainter.C index 5eed74d9a7..c38fa06248 100644 --- a/src/rowpainter.C +++ b/src/rowpainter.C @@ -895,13 +895,14 @@ void paintPar } // namespace anon -void paintText(BufferView & bv, ViewMetricsInfo const & vi, +void paintText(BufferView & bv, Painter & pain) { BOOST_ASSERT(bv.buffer()); LyXText & text = bv.buffer()->text(); bool const select = bv.cursor().selection(); - + ViewMetricsInfo const & vi = bv.viewMetricsInfo(); + PainterInfo pi(const_cast(&bv), pain); // Should the whole screen, including insets, be refreshed? bool repaintAll = select || !vi.singlepar; diff --git a/src/rowpainter.h b/src/rowpainter.h index 21983e2f6b..d9feb9a8b9 100644 --- a/src/rowpainter.h +++ b/src/rowpainter.h @@ -26,8 +26,7 @@ class ViewMetricsInfo; namespace frontend { class Painter; } /// paint visible paragraph of main text -void paintText(BufferView & bv, ViewMetricsInfo const & vi, - frontend::Painter & painter); +void paintText(BufferView & bv, frontend::Painter & painter); /// paint the rows of a text inset void paintTextInset(LyXText const & text, PainterInfo & pi, int x, int y); -- 2.39.2