]> git.lyx.org Git - lyx.git/commitdiff
Extracted from r14281
authorLars Gullik Bjønnes <larsbj@gullik.org>
Sat, 8 Jul 2006 21:16:21 +0000 (21:16 +0000)
committerLars Gullik Bjønnes <larsbj@gullik.org>
Sat, 8 Jul 2006 21:16:21 +0000 (21:16 +0000)
* 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

src/frontends/WorkArea.C
src/rowpainter.C
src/rowpainter.h

index c372fc3f8959a22a4026ffccec3ec383aefc30bf..52318b89dbd1a3f89543c8a03515edfa8974e8eb 100644 (file)
@@ -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);
 
index 681ff7ef13954ca4e6df36eccea9fc069c875e4c..46aa7beb869e6c7f7f31b95ee3b8530a67135e83 100644 (file)
@@ -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();
 
index fd62d1cf9c3bce143881c6df13048e36d0ed7d9c..2551fec92d59c344751a54deb7bfb13daf425c98 100644 (file)
@@ -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);