From: Lars Gullik Bjønnes Date: Sat, 8 Jul 2006 21:16:21 +0000 (+0000) Subject: Extracted from r14281 X-Git-Tag: 1.6.10~12981 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=34eb5e241e3f3a041c844d12a1c55968b9406c62;p=lyx.git Extracted from r14281 * rowpainter: - paintText: take the painter as an argument git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@14384 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/frontends/WorkArea.C b/src/frontends/WorkArea.C index c372fc3f89..52318b89db 100644 --- a/src/frontends/WorkArea.C +++ b/src/frontends/WorkArea.C @@ -169,14 +169,17 @@ void WorkArea::redraw() greyed_out_ = false; ViewMetricsInfo const & vi = buffer_view_->viewMetricsInfo(); - getPainter().start(); - paintText(*buffer_view_, vi); + + Painter & pain = getPainter(); + + pain.start(); + paintText(*buffer_view_, vi, pain); lyxerr[Debug::DEBUG] << "Redraw screen" << endl; int const ymin = std::max(vi.y1, 0); int const ymax = ( vi.p2 < vi.size - 1 ? vi.y2 : height() ); expose(0, ymin, width(), ymax - ymin); - getPainter().end(); + pain.end(); //theCoords.doneUpdating(); buffer_view_->needsRedraw(false); diff --git a/src/rowpainter.C b/src/rowpainter.C index 681ff7ef13..46aa7beb86 100644 --- a/src/rowpainter.C +++ b/src/rowpainter.C @@ -882,9 +882,9 @@ void paintPar } // namespace anon -void paintText(BufferView const & bv, ViewMetricsInfo const & vi) +void paintText(BufferView const & bv, ViewMetricsInfo const & vi, + Painter & pain) { - Painter & pain = bv.owner()->workArea()->getPainter(); LyXText * const text = bv.text(); bool const select = bv.cursor().selection(); diff --git a/src/rowpainter.h b/src/rowpainter.h index fd62d1cf9c..2551fec92d 100644 --- a/src/rowpainter.h +++ b/src/rowpainter.h @@ -21,9 +21,16 @@ class BufferView; class PainterInfo; class ViewMetricsInfo; +namespace lyx { +namespace frontend { +class Painter; +} +} + /// paint visible paragraph of main text -void paintText(BufferView const & bv, ViewMetricsInfo const & vi); +void paintText(BufferView const & bv, ViewMetricsInfo const & vi, + lyx::frontend::Painter & pain); /// paint the rows of a text inset void paintTextInset(LyXText const & text, PainterInfo & pi, int x, int y);