38 files changed, 132 insertions(+), 455 deletions(-)

This fixes bug 791 (regression in 1.3 release) and probably several
cases of bug 818. Things are not noticably slower and I have not
observed any drawing regressions (though it is but lightly tested).

Basically, we remove any attempt to work out whether a section has been
cleared and replace it with a simple test of text != bv.text

I might be able to remove more yet, it's hard to say, because insettext
etc. are still unreadable to me. Unfortunately this hasn't quite removed
the CHANGED_IN_DRAW stuff yet, that needs more smarts.

Comments ?

john


Index: rowpainter.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/rowpainter.C,v
retrieving revision 1.6
diff -u -p -r1.6 rowpainter.C
--- rowpainter.C        13 Mar 2003 19:55:39 -0000      1.6
+++ rowpainter.C        16 Mar 2003 16:37:26 -0000
@@ -114,7 +116,7 @@ bool RowPainter::paintInset(pos_type con
        LyXFont const & font = getFont(pos);
 
        inset->update(perv(bv_), font, false);
-       inset->draw(perv(bv_), font, yo_ + row_.baseline(), x_, cleared_);
+       inset->draw(perv(bv_), font, yo_ + row_.baseline(), x_);
 
        // return true if something changed when we drew an inset
 
@@ -305,63 +307,12 @@ bool RowPainter::paintFromPos(pos_type &
 }
 
 
-bool RowPainter::paintBackground()
+void RowPainter::paintBackground()
 {
-       pos_type const last = row_.lastPrintablePos();
-       bool clear_area = true;
-       Inset const * inset = 0;
-
-       if (!bv_.screen().forceClear() && last == row_.pos()
-           && row_.pos() < par_.size()
-           && par_.isInset(row_.pos())) {
-               inset = par_.getInset(row_.pos());
-               clear_area = inset->doClearArea();
-       }
-
-       if (cleared_) {
-               return true;
-       }
-
-       if (clear_area) {
-               int const x = xo_;
-               int const y = yo_ < 0 ? 0 : yo_;
-               int const h = yo_ < 0 ? row_.height() + yo_ : row_.height();
-               pain_.fillRectangle(x, y, width_, h, text_.backgroundColor());
-               return true;
-       }
-
-       if (!inset)
-               return false;
-
-       LyXFont font(LyXFont::ALL_SANE);
-
-       // FIXME
-       BufferView * bv = perv(bv_);
-
-       int h = row_.baseline() - inset->ascent(bv, font);
-
-       // first clear the whole row above the inset!
-       if (h > 0) {
-               pain_.fillRectangle(xo_, yo_, width_, h, text_.backgroundColor());
-       }
-
-       // clear the space below the inset!
-       h += inset->ascent(bv, font) + inset->descent(bv, font);
-       if ((row_.height() - h) > 0) {
-               pain_.fillRectangle(xo_, yo_ + h,
-                       width_, row_.height() - h, text_.backgroundColor());
-       }
-
-       // clear the space behind the inset, if needed
-       if (!inset->display() && !inset->needFullRow()) {
-               int const xp = int(x_) + inset->width(bv, font);
-               if (width_ - xp > 0) {
-                       pain_.fillRectangle(xp, yo_, width_ - xp,
-                               row_.height(), text_.backgroundColor());
-               }
-       }
-
-       return false;
+       int const x = xo_;
+       int const y = yo_ < 0 ? 0 : yo_;
+       int const h = yo_ < 0 ? row_.height() + yo_ : row_.height();
+       pain_.fillRectangle(x, y, width_, h, text_.backgroundColor());
 }
 
 
@@ -1021,12 +972,11 @@ bool RowPainter::paintText()
 }
 
 
-bool RowPainter::paint(int y_offset, int x_offset, int y, bool cleared)
+bool RowPainter::paint(int y_offset, int x_offset, int y)
 {
        xo_ = x_offset;
        yo_ = y_offset;
        y_ = y;
-       cleared_ = cleared;
        width_ = text_.isInInset()
                ? text_.inset_owner->textWidth(perv(bv_), true) : bv_.workWidth();
 
@@ -1041,8 +991,10 @@ bool RowPainter::paint(int y_offset, int
                x_ = 0;
        x_ += xo_;
 
-       // clear to background if necessary
-       cleared_ = paintBackground();
+       // If we're *not* at the top-level of rows, then the
+       // background has already been cleared.
+       if (&text_ == bv_.text)
+               paintBackground();
 
        // paint the selection background
        if (text_.selection.set()) {
Index: rowpainter.h
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/rowpainter.h,v
retrieving revision 1.3
diff -u -p -r1.3 rowpainter.h
--- rowpainter.h        13 Mar 2003 19:55:39 -0000      1.3
+++ rowpainter.h        16 Mar 2003 16:37:26 -0000
@@ -34,11 +34,11 @@ public:
        RowPainter(BufferView const & bv, LyXText const & text, Row const & row);
 
        /// paint the row. Returns true if CHANGED_IN_DRAW (e.g. image was loaded)
-       bool paint(int y_offset, int x_offset, int y, bool cleared = false);
+       bool paint(int y_offset, int x_offset, int y);
 
 private:
        // paint various parts
-       bool paintBackground();
+       void paintBackground();
        void paintSelection();
        void paintAppendix();
        void paintDepthBar();
@@ -94,7 +94,6 @@ private:
        int yo_;
        float x_;
        int y_;
-       bool cleared_;
        int width_;
        float separator_;
        float hfill_;
Index: frontends/screen.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/screen.C,v
retrieving revision 1.31
diff -u -p -r1.31 screen.C
--- frontends/screen.C  6 Mar 2003 20:21:18 -0000       1.31
+++ frontends/screen.C  16 Mar 2003 16:37:27 -0000
@@ -111,7 +111,7 @@ SplashScreen::SplashScreen()
 
 
 LyXScreen::LyXScreen()
-       : cursor_visible_(false), force_clear_(true), greyed_out_(true)
+       : cursor_visible_(false), greyed_out_(true)
 {
        // Start loading the pixmap as soon as possible
        if (lyxrc.show_banner) {
@@ -459,7 +459,6 @@ void LyXScreen::drawFromTo(LyXText * tex
                y += row->height();
                row = row->next();
        }
-       force_clear_ = false;
 
        // maybe we have to clear the screen at the bottom
        if ((y < y2) && text->isTopLevel()) {
@@ -482,5 +481,4 @@ void LyXScreen::drawOneRow(LyXText * tex
                if (rp.paint(y, xo, y + text->top_y()))
                        text->markChangeInDraw(bv, row, prev);
        }
-       force_clear_ = false;
 }
Index: frontends/screen.h
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/screen.h,v
retrieving revision 1.12
diff -u -p -r1.12 screen.h
--- frontends/screen.h  26 Feb 2003 12:49:01 -0000      1.12
+++ frontends/screen.h  16 Mar 2003 16:37:27 -0000
@@ -139,9 +139,6 @@ public:
        virtual void toggleToggle(LyXText *, BufferView *,
                          int y_offset = 0, int x_offset = 0);
 
-       /// FIXME
-       virtual bool forceClear() const { return force_clear_; }
-
 protected:
        /// cause the display of the given area of the work area
        virtual void expose(int x, int y, int w, int h) = 0;
@@ -163,9 +160,6 @@ protected:
 private:
        /// grey out (no buffer)
        void greyOut();
-
-       /// FIXME ?
-       bool force_clear_;
 
        /// is the screen displaying text or the splash screen?
        bool greyed_out_;
Index: insets/inset.h
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/inset.h,v
retrieving revision 1.77
diff -u -p -r1.77 inset.h
--- insets/inset.h      13 Mar 2003 10:06:11 -0000      1.77
+++ insets/inset.h      16 Mar 2003 16:37:30 -0000
@@ -162,8 +162,7 @@ public:
        ///
        virtual int width(BufferView *, LyXFont const &) const = 0;
        ///
-       virtual void draw(BufferView *, LyXFont const &,
-                         int baseline, float & x, bool cleared) const = 0;
+       virtual void draw(BufferView *, LyXFont const &, int baseline, float & x) 
const = 0;
        /// update the inset representation
        virtual void update(BufferView *, LyXFont const &, bool = false)
                {}
@@ -177,8 +176,6 @@ public:
        virtual EDITABLE editable() const;
        ///
        virtual bool isTextInset() const { return false; }
-       ///
-       virtual bool doClearArea() const { return true; }
        /// return true if the inset should be removed automatically
        virtual bool autoDelete() const;
        /// returns true the inset can hold an inset of given type
Index: insets/insetbutton.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetbutton.C,v
retrieving revision 1.23
diff -u -p -r1.23 insetbutton.C
--- insets/insetbutton.C        3 Mar 2003 15:59:08 -0000       1.23
+++ insets/insetbutton.C        16 Mar 2003 16:37:30 -0000
@@ -93,7 +93,7 @@ int InsetButton::width(BufferView * bv, 
 
 
 void InsetButton::draw(BufferView * bv, LyXFont const &,
-                       int baseline, float & x, bool) const
+                       int baseline, float & x) const
 {
        lyx::Assert(bv);
        cache(bv);
Index: insets/insetbutton.h
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetbutton.h,v
retrieving revision 1.14
diff -u -p -r1.14 insetbutton.h
--- insets/insetbutton.h        25 Feb 2003 14:51:36 -0000      1.14
+++ insets/insetbutton.h        16 Mar 2003 16:37:30 -0000
@@ -30,7 +30,7 @@ public:
        ///
        int width(BufferView *, LyXFont const &) const;
        ///
-       void draw(BufferView *, LyXFont const &, int, float &, bool) const;
+       void draw(BufferView *, LyXFont const &, int, float &) const;
 
 protected:
        ///
Index: insets/insetcaption.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetcaption.C,v
retrieving revision 1.23
diff -u -p -r1.23 insetcaption.C
--- insets/insetcaption.C       13 Feb 2003 16:53:01 -0000      1.23
+++ insets/insetcaption.C       16 Mar 2003 16:37:31 -0000
@@ -66,7 +66,7 @@ string const InsetCaption::editMessage()
 
 
 void InsetCaption::draw(BufferView * bv, LyXFont const & f,
-                       int baseline, float & x, bool cleared) const
+                       int baseline, float & x) const
 {
        // We must draw the label, we should get the label string
        // from the enclosing float inset.
@@ -101,7 +101,7 @@ void InsetCaption::draw(BufferView * bv,
        pain.text(int(x), baseline, label, f);
        x += w;
 
-       InsetText::draw(bv, f, baseline, x, cleared);
+       InsetText::draw(bv, f, baseline, x);
 }
 
 
Index: insets/insetcaption.h
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetcaption.h,v
retrieving revision 1.10
diff -u -p -r1.10 insetcaption.h
--- insets/insetcaption.h       13 Feb 2003 16:53:02 -0000      1.10
+++ insets/insetcaption.h       16 Mar 2003 16:37:31 -0000
@@ -40,7 +40,7 @@ public:
        ///
        virtual
        void draw(BufferView * bv, LyXFont const & f,
-                         int baseline, float & x, bool cleared) const;
+                         int baseline, float & x) const;
        ///
        virtual
        int latex(Buffer const * buf, std::ostream & os,
Index: insets/insetcollapsable.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetcollapsable.C,v
retrieving revision 1.127
diff -u -p -r1.127 insetcollapsable.C
--- insets/insetcollapsable.C   5 Mar 2003 19:46:08 -0000       1.127
+++ insets/insetcollapsable.C   16 Mar 2003 16:37:32 -0000
@@ -183,7 +183,7 @@ void InsetCollapsable::draw_collapsed(Pa
 
 
 void InsetCollapsable::draw(BufferView * bv, LyXFont const & f,
-                           int baseline, float & x, bool cleared) const
+                           int baseline, float & x) const
 {
        lyx::Assert(bv);
        cache(bv);
@@ -214,18 +214,6 @@ void InsetCollapsable::draw(BufferView *
        if (!owner())
                x += static_cast<float>(scroll());
 
-       if (!cleared && (inset.need_update == InsetText::FULL ||
-                        inset.need_update == InsetText::INIT ||
-                        top_x != int(x) ||
-                        top_baseline != baseline))
-       {
-               // we don't need anymore to clear here we just have to tell
-               // the underlying LyXText that it should do the RowClear!
-               inset.setUpdateStatus(bv, InsetText::FULL);
-               bv->text->status(bv, LyXText::CHANGED_IN_DRAW);
-               return;
-       }
-
        top_x = int(x);
        topx_set = true;
        top_baseline = baseline;
@@ -233,9 +221,7 @@ void InsetCollapsable::draw(BufferView *
        int const bl = baseline - ascent(bv, f) + ascent_collapsed();
 
        draw_collapsed(pain, bl, old_x);
-       inset.draw(bv, f,
-                          bl + descent_collapsed() + inset.ascent(bv, f),
-                          x, cleared);
+       inset.draw(bv, f, bl + descent_collapsed() + inset.ascent(bv, f), x);
        if (x < (top_x + button_length + TEXT_TO_INSET_OFFSET))
                x = top_x + button_length + TEXT_TO_INSET_OFFSET;
 }
@@ -560,12 +546,6 @@ void InsetCollapsable::setFont(BufferVie
                               bool toggleall, bool selectall)
 {
        inset.setFont(bv, font, toggleall, selectall);
-}
-
-
-bool InsetCollapsable::doClearArea() const
-{
-       return inset.doClearArea();
 }
 
 
Index: insets/insetcollapsable.h
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetcollapsable.h,v
retrieving revision 1.93
diff -u -p -r1.93 insetcollapsable.h
--- insets/insetcollapsable.h   25 Feb 2003 14:51:37 -0000      1.93
+++ insets/insetcollapsable.h   16 Mar 2003 16:37:32 -0000
@@ -56,7 +56,7 @@ public:
        ///
        int width(BufferView *, LyXFont const &) const;
        ///
-       void draw(BufferView *, const LyXFont &, int , float &, bool) const;
+       void draw(BufferView *, const LyXFont &, int , float &) const;
        ///
        void update(BufferView *, LyXFont const &, bool =false);
        ///
@@ -73,8 +73,6 @@ public:
        }
        ///
        bool isTextInset() const { return true; }
-       ///
-       bool doClearArea() const;
        ///
        void insetUnlock(BufferView *);
        ///
Index: insets/inseterror.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/inseterror.C,v
retrieving revision 1.50
diff -u -p -r1.50 inseterror.C
--- insets/inseterror.C 12 Mar 2003 22:17:50 -0000      1.50
+++ insets/inseterror.C 16 Mar 2003 16:37:33 -0000
@@ -81,7 +81,7 @@ int InsetError::width(BufferView *, LyXF
 
 
 void InsetError::draw(BufferView * bv, LyXFont const & font,
-                     int baseline, float & x, bool) const
+                     int baseline, float & x) const
 {
        lyx::Assert(bv);
        cache(bv);
Index: insets/inseterror.h
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/inseterror.h,v
retrieving revision 1.50
diff -u -p -r1.50 inseterror.h
--- insets/inseterror.h 9 Mar 2003 09:38:47 -0000       1.50
+++ insets/inseterror.h 16 Mar 2003 16:37:33 -0000
@@ -37,7 +37,7 @@ public:
        ///
        int width(BufferView *, LyXFont const &) const;
        ///
-       void draw(BufferView *, LyXFont const &, int, float &, bool) const;
+       void draw(BufferView *, LyXFont const &, int, float &) const;
        ///
        void write(Buffer const *, std::ostream &) const {}
        ///
Index: insets/insetert.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetert.C,v
retrieving revision 1.107
diff -u -p -r1.107 insetert.C
--- insets/insetert.C   12 Mar 2003 19:16:41 -0000      1.107
+++ insets/insetert.C   16 Mar 2003 16:37:34 -0000
@@ -567,7 +567,7 @@ int InsetERT::width(BufferView * bv, LyX
 
 
 void InsetERT::draw(BufferView * bv, LyXFont const & f,
-                   int baseline, float & x, bool cleared) const
+                   int baseline, float & x) const
 {
        lyx::Assert(bv);
        cache(bv);
@@ -589,18 +589,6 @@ void InsetERT::draw(BufferView * bv, LyX
        if (!owner())
                x += static_cast<float>(scroll());
 
-       if (!cleared && (inset.need_update == InsetText::FULL ||
-                        inset.need_update == InsetText::INIT ||
-                        top_x != int(x) ||
-                        top_baseline != baseline))
-       {
-               // we don't need anymore to clear here we just have to tell
-               // the underlying LyXText that it should do the RowClear!
-               inset.setUpdateStatus(bv, InsetText::FULL);
-               bv->text->status(bv, LyXText::CHANGED_IN_DRAW);
-               return;
-       }
-
        top_x = int(x);
        topx_set = true;
        top_baseline = baseline;
@@ -608,12 +596,10 @@ void InsetERT::draw(BufferView * bv, LyX
        int const bl = baseline - ascent(bv, f) + ascent_collapsed();
 
        if (inlined()) {
-               inset.draw(bv, f, baseline, x, cleared);
+               inset.draw(bv, f, baseline, x);
        } else {
                draw_collapsed(pain, bl, old_x);
-               inset.draw(bv, f,
-                                  bl + descent_collapsed() + inset.ascent(bv, f),
-                                  x, cleared);
+               inset.draw(bv, f, bl + descent_collapsed() + inset.ascent(bv, f), x);
        }
        need_update = NONE;
 }
Index: insets/insetert.h
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetert.h,v
retrieving revision 1.63
diff -u -p -r1.63 insetert.h
--- insets/insetert.h   12 Mar 2003 19:16:41 -0000      1.63
+++ insets/insetert.h   16 Mar 2003 16:37:34 -0000
@@ -109,7 +109,7 @@ public:
        ///
        int width(BufferView *, LyXFont const &) const;
        ///
-       void draw(BufferView *, const LyXFont &, int , float &, bool) const;
+       void draw(BufferView *, const LyXFont &, int , float &) const;
        /// set the status of the inset
        void status(BufferView *, ERTStatus const st) const;
        ///
Index: insets/insetgraphics.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetgraphics.C,v
retrieving revision 1.158
diff -u -p -r1.158 insetgraphics.C
--- insets/insetgraphics.C      10 Mar 2003 22:12:07 -0000      1.158
+++ insets/insetgraphics.C      16 Mar 2003 16:37:36 -0000
@@ -344,7 +344,7 @@ BufferView * InsetGraphics::view() const
 
 
 void InsetGraphics::draw(BufferView * bv, LyXFont const & font,
-                        int baseline, float & x, bool) const
+                        int baseline, float & x) const
 {
        // MakeAbsPath returns params().filename unchanged if it absolute
        // already.
Index: insets/insetgraphics.h
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetgraphics.h,v
retrieving revision 1.59
diff -u -p -r1.59 insetgraphics.h
--- insets/insetgraphics.h      10 Mar 2003 13:33:39 -0000      1.59
+++ insets/insetgraphics.h      16 Mar 2003 16:37:36 -0000
@@ -43,7 +43,7 @@ public:
        ///
        int width(BufferView *, LyXFont const &) const;
        ///
-       void draw(BufferView *, LyXFont const &, int, float &, bool) const;
+       void draw(BufferView *, LyXFont const &, int, float &) const;
        ///
        void edit(BufferView *, int, int, mouse_button::state);
        ///
Index: insets/insetinclude.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetinclude.C,v
retrieving revision 1.104
diff -u -p -r1.104 insetinclude.C
--- insets/insetinclude.C       10 Mar 2003 22:12:07 -0000      1.104
+++ insets/insetinclude.C       16 Mar 2003 16:37:37 -0000
@@ -557,11 +557,11 @@ int InsetInclude::width(BufferView * bv,
 
 
 void InsetInclude::draw(BufferView * bv, LyXFont const & font, int y,
-                       float & xx, bool b) const
+                       float & xx) const
 {
        cache(bv);
        if (!preview_->previewReady()) {
-               InsetButton::draw(bv, font, y, xx, b);
+               InsetButton::draw(bv, font, y, xx);
                return;
        }
 
Index: insets/insetinclude.h
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetinclude.h,v
retrieving revision 1.58
diff -u -p -r1.58 insetinclude.h
--- insets/insetinclude.h       10 Mar 2003 13:33:39 -0000      1.58
+++ insets/insetinclude.h       16 Mar 2003 16:37:37 -0000
@@ -67,7 +67,7 @@ public:
        ///
        int width(BufferView *, LyXFont const &) const;
        ///
-       void draw(BufferView *, LyXFont const &, int, float &, bool) const;
+       void draw(BufferView *, LyXFont const &, int, float &) const;
 
        /// get the parameters
        Params const & params(void) const;
Index: insets/insetlatexaccent.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetlatexaccent.C,v
retrieving revision 1.60
diff -u -p -r1.60 insetlatexaccent.C
--- insets/insetlatexaccent.C   17 Feb 2003 16:16:48 -0000      1.60
+++ insets/insetlatexaccent.C   16 Mar 2003 16:37:38 -0000
@@ -360,7 +360,7 @@ bool InsetLatexAccent::displayISO8859_9(
 
 
 void InsetLatexAccent::draw(BufferView * bv, LyXFont const & font0,
-                           int baseline, float & x, bool) const
+                           int baseline, float & x) const
 {
        Painter & pain = bv->painter();
 
Index: insets/insetlatexaccent.h
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetlatexaccent.h,v
retrieving revision 1.42
diff -u -p -r1.42 insetlatexaccent.h
--- insets/insetlatexaccent.h   17 Feb 2003 16:16:49 -0000      1.42
+++ insets/insetlatexaccent.h   16 Mar 2003 16:37:38 -0000
@@ -40,7 +40,7 @@ public:
        ///
        int width(BufferView *, LyXFont const &) const;
        ///
-       void draw(BufferView *, LyXFont const &, int, float &, bool) const;
+       void draw(BufferView *, LyXFont const &, int, float &) const;
        ///
        int lbearing(LyXFont const & font) const;
        ///
Index: insets/insetnewline.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetnewline.C,v
retrieving revision 1.1
diff -u -p -r1.1 insetnewline.C
--- insets/insetnewline.C       12 Mar 2003 19:16:41 -0000      1.1
+++ insets/insetnewline.C       16 Mar 2003 16:37:38 -0000
@@ -88,7 +88,7 @@ int InsetNewline::docbook(Buffer const *
 
 
 void InsetNewline::draw(BufferView * bv, LyXFont const & font,
-                       int baseline, float & x, bool) const
+                       int baseline, float & x) const
 {
        Painter & pain(bv->painter());
 
Index: insets/insetnewline.h
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetnewline.h,v
retrieving revision 1.1
diff -u -p -r1.1 insetnewline.h
--- insets/insetnewline.h       12 Mar 2003 19:16:41 -0000      1.1
+++ insets/insetnewline.h       16 Mar 2003 16:37:39 -0000
@@ -33,7 +33,7 @@ public:
        virtual int width(BufferView *, LyXFont const &) const;
 
        virtual void draw(BufferView *, LyXFont const &,
-                         int baseline, float & x, bool cleared) const;
+                         int baseline, float & x) const;
 
        virtual int latex(Buffer const *, std::ostream &, bool fragile, bool free_spc) 
const;
 
Index: insets/insetquotes.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetquotes.C,v
retrieving revision 1.81
diff -u -p -r1.81 insetquotes.C
--- insets/insetquotes.C        12 Mar 2003 19:16:41 -0000      1.81
+++ insets/insetquotes.C        16 Mar 2003 16:37:39 -0000
@@ -218,7 +218,7 @@ LyXFont const InsetQuotes::convertFont(L
 
 
 void InsetQuotes::draw(BufferView * bv, LyXFont const & font,
-                      int baseline, float & x, bool) const
+                      int baseline, float & x) const
 {
        string const text = dispString(font.language());
 
Index: insets/insetquotes.h
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetquotes.h,v
retrieving revision 1.41
diff -u -p -r1.41 insetquotes.h
--- insets/insetquotes.h        13 Feb 2003 16:53:05 -0000      1.41
+++ insets/insetquotes.h        16 Mar 2003 16:37:39 -0000
@@ -76,7 +76,7 @@ public:
        ///
        int width(BufferView *, LyXFont const &) const;
        ///
-       void draw(BufferView *, LyXFont const &, int, float &, bool) const;
+       void draw(BufferView *, LyXFont const &, int, float &) const;
 #if 0
        ///
        LyXFont const convertFont(LyXFont const & font) const;
Index: insets/insetspecialchar.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetspecialchar.C,v
retrieving revision 1.57
diff -u -p -r1.57 insetspecialchar.C
--- insets/insetspecialchar.C   11 Mar 2003 15:01:29 -0000      1.57
+++ insets/insetspecialchar.C   16 Mar 2003 16:37:40 -0000
@@ -85,7 +85,7 @@ int InsetSpecialChar::width(BufferView *
 
 
 void InsetSpecialChar::draw(BufferView * bv, LyXFont const & f,
-                           int baseline, float & x, bool) const
+                           int baseline, float & x) const
 {
        Painter & pain = bv->painter();
        LyXFont font(f);
Index: insets/insetspecialchar.h
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetspecialchar.h,v
retrieving revision 1.43
diff -u -p -r1.43 insetspecialchar.h
--- insets/insetspecialchar.h   11 Mar 2003 15:01:29 -0000      1.43
+++ insets/insetspecialchar.h   16 Mar 2003 16:37:40 -0000
@@ -54,7 +54,7 @@ public:
        ///
        int width(BufferView *, LyXFont const &) const;
        ///
-       void draw(BufferView *, LyXFont const &, int, float &, bool) const;
+       void draw(BufferView *, LyXFont const &, int, float &) const;
        ///
        void write(Buffer const *, std::ostream &) const;
        /// Will not be used when lyxf3
Index: insets/insettabular.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insettabular.C,v
retrieving revision 1.246
diff -u -p -r1.246 insettabular.C
--- insets/insettabular.C       13 Mar 2003 13:56:24 -0000      1.246
+++ insets/insettabular.C       16 Mar 2003 16:37:44 -0000
@@ -261,11 +261,10 @@ int InsetTabular::width(BufferView *, Ly
 
 
 void InsetTabular::draw(BufferView * bv, LyXFont const & font, int baseline,
-                       float & x, bool cleared) const
+                       float & x) const
 {
        if (nodraw()) {
-               if (cleared)
-                       need_update = FULL;
+               need_update = FULL;
                return;
        }
 #if 0
@@ -282,173 +281,53 @@ void InsetTabular::draw(BufferView * bv,
        int nx;
 
 #if 0
-       UpdatableInset::draw(bv, font, baseline, x, cleared);
+       UpdatableInset::draw(bv, font, baseline, x);
 #else
        if (!owner())
                x += static_cast<float>(scroll());
 #endif
-       if (!cleared && ((need_update == INIT) || (need_update == FULL) ||
-                        (top_x != int(x)) || (top_baseline != baseline)))
-       {
-               int h = ascent(bv, font) + descent(bv, font);
-               int const tx = display() || !owner() ? 0 : top_x;
-               int w =  tx ? width(bv, font) : pain.paperWidth();
-               int ty = baseline - ascent(bv, font);
-
-               if (ty < 0)
-                       ty = 0;
-               if ((ty + h) > pain.paperHeight())
-                       h = pain.paperHeight();
-               if ((top_x + w) > pain.paperWidth())
-                       w = pain.paperWidth();
-               pain.fillRectangle(tx, ty, w, h, backgroundColor());
-               need_update = FULL;
-               cleared = true;
-       }
+
        top_x = int(x);
        topx_set = true;
        top_baseline = baseline;
        x += ADD_TO_TABULAR_WIDTH;
-       if (cleared) {
-               int cell = 0;
-               float cx;
-               first_visible_cell = -1;
-               for (i = 0; i < tabular->rows(); ++i) {
-                       nx = int(x);
-                       cell = tabular->GetCellNumber(i, 0);
-                       if (!((baseline + tabular->GetDescentOfRow(i)) > 0) &&
-                               (baseline - 
tabular->GetAscentOfRow(i))<pain.paperHeight())
-                       {
-                               baseline += tabular->GetDescentOfRow(i) +
-                                       tabular->GetAscentOfRow(i + 1) +
-                                       tabular->GetAdditionalHeight(i + 1);
-                               continue;
-                       }
-                       for (j = 0; j < tabular->columns(); ++j) {
-                               if (nx > bv->workWidth())
-                                       break;
-                               if (tabular->IsPartOfMultiColumn(i, j))
-                                       continue;
-                               cx = nx + tabular->GetBeginningOfTextInCell(cell);
-                               if (first_visible_cell < 0)
-                                       first_visible_cell = cell;
-                               if (hasSelection()) {
-                                       drawCellSelection(pain, nx, baseline, i, j, 
cell);
-                               }
 
-                               tabular->GetCellInset(cell)->draw(bv, font, baseline, 
cx, cleared);
-                               drawCellLines(pain, nx, baseline, i, cell);
-                               nx += tabular->GetWidthOfColumn(cell);
-                               ++cell;
-                       }
-                       baseline += tabular->GetDescentOfRow(i) +
+       int cell = 0;
+       float cx;
+       first_visible_cell = -1;
+       for (i = 0; i < tabular->rows(); ++i) {
+               nx = int(x);
+               cell = tabular->GetCellNumber(i, 0);
+               if (!((baseline + tabular->GetDescentOfRow(i)) > 0) &&
+                       (baseline - tabular->GetAscentOfRow(i))<pain.paperHeight())
+               {
+               baseline += tabular->GetDescentOfRow(i) +
                                tabular->GetAscentOfRow(i + 1) +
                                tabular->GetAdditionalHeight(i + 1);
+                       continue;
                }
-       } else if (need_update == CELL) {
-               int cell = 0;
-               nx = int(x);
-               if (the_locking_inset &&
-                       tabular->GetCellInset(actcell) != the_locking_inset)
-               {
-                       Inset * inset = tabular->GetCellInset(cell);
-                       for (i = 0;
-                            inset != the_locking_inset && i < tabular->rows();
-                            ++i)
-                       {
-                               for (j = 0;
-                                    inset != the_locking_inset && j < 
tabular->columns();
-                                    ++j)
-                               {
-                                       if (tabular->IsPartOfMultiColumn(i, j))
-                                               continue;
-                                       nx += tabular->GetWidthOfColumn(cell);
-                                       ++cell;
-                                       inset = tabular->GetCellInset(cell);
-                               }
-                               if (tabular->row_of_cell(cell) > i) {
-                                       nx = int(x);
-                                       baseline += tabular->GetDescentOfRow(i) +
-                                               tabular->GetAscentOfRow(i + 1) +
-                                               tabular->GetAdditionalHeight(i + 1);
-                               }
-                       }
-               } else {
-                       // compute baseline for actual row
-                       for (i = 0; i < actrow; ++i) {
-                               baseline += tabular->GetDescentOfRow(i) +
-                                       tabular->GetAscentOfRow(i + 1) +
-                                       tabular->GetAdditionalHeight(i + 1);
-                       }
-                       // now compute the right x position
-                       cell = tabular->GetCellNumber(actrow, 0);
-                       for (j = 0; (cell < actcell) && (j < tabular->columns()); ++j) 
{
-                                       if (tabular->IsPartOfMultiColumn(actrow, j))
-                                               continue;
-                                       nx += tabular->GetWidthOfColumn(cell);
-                                       ++cell;
+               for (j = 0; j < tabular->columns(); ++j) {
+                       if (nx > bv->workWidth())
+                               break;
+                       if (tabular->IsPartOfMultiColumn(i, j))
+                               continue;
+                       cx = nx + tabular->GetBeginningOfTextInCell(cell);
+                       if (first_visible_cell < 0)
+                               first_visible_cell = cell;
+                       if (hasSelection()) {
+                               drawCellSelection(pain, nx, baseline, i, j, cell);
                        }
+
+                       tabular->GetCellInset(cell)->draw(bv, font, baseline, cx);
+                       drawCellLines(pain, nx, baseline, i, cell);
+                       nx += tabular->GetWidthOfColumn(cell);
+                       ++cell;
                }
-               i = tabular->row_of_cell(cell);
-               if (the_locking_inset != tabular->GetCellInset(cell)) {
-                       lyxerr[Debug::INSETTEXT] << "ERROR this shouldn't happen\n";
-                       return;
-               }
-               float dx = nx + tabular->GetBeginningOfTextInCell(cell);
-               float cx = dx;
-               tabular->GetCellInset(cell)->draw(bv, font, baseline, dx, false);
-               //
-               // Here we use rectangular backgroundColor patches to clean up
-               // within a cell around the cell's red inset box. As follows:
-               //
-               //  +--------------------+
-               //  |         C          |   The rectangles are A, B and C
-               //  | A |------------| B |   below, origin top left (tx, ty),
-               //  |   |  inset box |   |   dimensions w(idth), h(eight).
-               //  +---+------------+---+   x grows rightward, y downward
-               //  |         D          |
-               //  +--------------------+
-               //
-#if 0
-               // clear only if we didn't have a change
-               if (bv->text->status() != LyXText::CHANGED_IN_DRAW) {
-#endif
-                       // clear before the inset
-                       int tx, ty, w, h;
-                       tx = nx + 1;
-                       ty = baseline - tabular->GetAscentOfRow(i) + 1;
-                       w = int(cx - nx - 1);
-                       h = tabular->GetAscentOfRow(i) +
-                               tabular->GetDescentOfRow(i) - 1;
-                       pain.fillRectangle(tx, ty, w, h, backgroundColor());
-                       // clear behind the inset
-                       tx = int(cx + the_locking_inset->width(bv,font) + 1);
-                       ty = baseline - tabular->GetAscentOfRow(i) + 1;
-                       w = tabular->GetWidthOfColumn(cell) -
-                               tabular->GetBeginningOfTextInCell(cell) -
-                               the_locking_inset->width(bv,font) -
-                               tabular->GetAdditionalWidth(cell) - 1;
-                       h = tabular->GetAscentOfRow(i) + tabular->GetDescentOfRow(i) - 
1;
-                       pain.fillRectangle(tx, ty, w, h, backgroundColor());
-                       // clear below the inset
-                       tx = nx + 1;
-                       ty = baseline + the_locking_inset->descent(bv, font) + 1;
-                       w = tabular->GetWidthOfColumn(cell) -
-                               tabular->GetAdditionalWidth(cell) - 1;
-                       h = tabular->GetDescentOfRow(i) -
-                               the_locking_inset->descent(bv, font) - 1;
-                       pain.fillRectangle(tx, ty, w, h, backgroundColor());
-                       // clear above the inset
-                       tx = nx + 1;
-                       ty = baseline - tabular->GetAscentOfRow(i) + 1;
-                       w = tabular->GetWidthOfColumn(cell) -
-                               tabular->GetAdditionalWidth(cell) - 1;
-                       h = tabular->GetAscentOfRow(i) - the_locking_inset->ascent(bv, 
font);
-                       pain.fillRectangle(tx, ty, w, h, backgroundColor());
-#if 0
-               }
-#endif
+               baseline += tabular->GetDescentOfRow(i) +
+                       tabular->GetAscentOfRow(i + 1) +
+                       tabular->GetAdditionalHeight(i + 1);
        }
+
        x -= ADD_TO_TABULAR_WIDTH;
        x += width(bv, font);
        if (bv->text->status() == LyXText::CHANGED_IN_DRAW) {
@@ -2671,12 +2550,6 @@ int InsetTabular::scroll(bool recursive)
                sx += the_locking_inset->scroll(recursive);
 
        return sx;
-}
-
-
-bool InsetTabular::doClearArea() const
-{
-       return !locked || (need_update & (FULL|INIT));
 }
 
 
Index: insets/insettabular.h
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insettabular.h,v
retrieving revision 1.107
diff -u -p -r1.107 insettabular.h
--- insets/insettabular.h       10 Mar 2003 13:33:39 -0000      1.107
+++ insets/insettabular.h       16 Mar 2003 16:37:45 -0000
@@ -92,7 +92,7 @@ public:
        ///
        int width(BufferView *, LyXFont const & f) const;
        ///
-       void draw(BufferView *, const LyXFont &, int , float &, bool) const;
+       void draw(BufferView *, const LyXFont &, int , float &) const;
        ///
        void update(BufferView *, LyXFont const &, bool = false);
        ///
@@ -101,9 +101,7 @@ public:
        void edit(BufferView *, int x, int y, mouse_button::state);
        ///
        void edit(BufferView * bv, bool front = true);
-       ///
-       bool doClearArea() const;
-       ///
+       //
        void insetUnlock(BufferView *);
        ///
        void updateLocal(BufferView *, UpdateCodes, bool mark_dirty) const;
Index: insets/insettext.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insettext.C,v
retrieving revision 1.357
diff -u -p -r1.357 insettext.C
--- insets/insettext.C  16 Mar 2003 00:45:30 -0000      1.357
+++ insets/insettext.C  16 Mar 2003 16:37:49 -0000
@@ -194,7 +194,6 @@ void InsetText::init(InsetText const * i
        locked = false;
        old_par = 0;
        last_drawn_width = -1;
-       frame_is_visible = false;
        cached_bview = 0;
        sstate.lpar = 0;
        in_insetAllowed = false;
@@ -346,7 +345,7 @@ int InsetText::textWidth(BufferView * bv
 
 
 void InsetText::draw(BufferView * bv, LyXFont const & f,
-                    int baseline, float & x, bool cleared) const
+                    int baseline, float & x) const
 {
        if (nodraw())
                return;
@@ -356,7 +355,6 @@ void InsetText::draw(BufferView * bv, Ly
        // this is the first thing we have to ask because if the x pos
        // changed we have to do a complete rebreak of the text as we
        // may have few space to draw in. Well we should check on this too
-       int old_x = top_x;
        if (top_x != int(x)) {
                top_x = int(x);
                topx_set = true;
@@ -376,16 +374,13 @@ void InsetText::draw(BufferView * bv, Ly
        descent(bv, f);
 
        // repaint the background if needed
-       if (cleared && backgroundColor() != LColor::background) {
-               clearInset(bv, baseline, cleared);
-       }
+       if (backgroundColor() != LColor::background)
+               clearInset(bv, baseline);
 
        // no draw is necessary !!!
        if ((drawFrame_ == LOCKED) && !locked && paragraphs.begin()->empty()) {
                top_baseline = baseline;
                x += width(bv, f);
-               if (need_update & CLEAR_FRAME)
-                       clearFrame(pain, cleared);
                need_update = NONE;
                return;
        }
@@ -393,31 +388,10 @@ void InsetText::draw(BufferView * bv, Ly
        if (!owner())
                x += static_cast<float>(scroll());
 
-       // if top_x differs we did it already
-       if (!cleared && (old_x == int(x))
-           && ((need_update&(INIT|FULL)) || (top_baseline != baseline)
-               ||(last_drawn_width != insetWidth)))
-       {
-               // Condition necessary to eliminate bug 59 attachment 37
-               if (baseline > 0)
-                       clearInset(bv, baseline, cleared);
-       }
-
-       if (cleared)
-               frame_is_visible = false;
-
-       if (!cleared && (need_update == NONE)) {
-               if (locked)
-                       drawFrame(pain, cleared);
-               return;
-       }
-
        top_baseline = baseline;
        top_y = baseline - insetAscent;
 
        if (last_drawn_width != insetWidth) {
-               if (!cleared)
-                       clearInset(bv, baseline, cleared);
                need_update |= FULL;
                last_drawn_width = insetWidth;
        }
@@ -427,13 +401,7 @@ void InsetText::draw(BufferView * bv, Ly
                inset_x = cix(bv) - top_x + drawTextXOffset;
                inset_y = ciy(bv) + drawTextYOffset;
        }
-       if (!cleared && (need_update == CURSOR)
-           && !getLyXText(bv)->selection.set()) {
-               drawFrame(pain, cleared);
-               x += insetWidth;
-               need_update = NONE;
-               return;
-       }
+
        bool clear = false;
        if (!lt) {
                lt = getLyXText(bv);
@@ -459,62 +427,38 @@ void InsetText::draw(BufferView * bv, Ly
                lt->top_y(first);
                first = 0;
        }
-       if (cleared || (need_update&(INIT|FULL))) {
-               int yf = y_offset + first;
-               y = 0;
-               while ((row != 0) && (yf < ph)) {
-                       Row * prev = row->previous();
-                       RowPainter rp(*bv, *lt, *row);
-                       if (rp.paint(y + y_offset + first, int(x), y + lt->top_y(), 
cleared))
-                               lt->markChangeInDraw(bv, row, prev);
-                       if (bv->text->status() == LyXText::CHANGED_IN_DRAW) {
-                               lt->need_break_row = row;
-                               lt->fullRebreak(bv);
-                               lt->setCursor(bv, lt->cursor.par(),
-                                             lt->cursor.pos());
-                               if (lt->selection.set()) {
-                                       lt->setCursor(bv, lt->selection.start,
-                                                     lt->selection.start.par(),
-                                                     lt->selection.start.pos());
-                                       lt->setCursor(bv, lt->selection.end,
-                                                     lt->selection.end.par(),
-                                                     lt->selection.end.pos());
-                               }
-                               break;
+
+       int yf = y_offset + first;
+       y = 0;
+       while ((row != 0) && (yf < ph)) {
+               Row * prev = row->previous();
+               RowPainter rp(*bv, *lt, *row);
+               if (rp.paint(y + y_offset + first, int(x), y + lt->top_y()))
+                       lt->markChangeInDraw(bv, row, prev);
+               if (bv->text->status() == LyXText::CHANGED_IN_DRAW) {
+                       lt->need_break_row = row;
+                       lt->fullRebreak(bv);
+                       lt->setCursor(bv, lt->cursor.par(),
+                                     lt->cursor.pos());
+                       if (lt->selection.set()) {
+                               lt->setCursor(bv, lt->selection.start,
+                                             lt->selection.start.par(),
+                                             lt->selection.start.pos());
+                               lt->setCursor(bv, lt->selection.end,
+                                             lt->selection.end.par(),
+                                             lt->selection.end.pos());
                        }
-                       y += row->height();
-                       yf += row->height();
-                       row = row->next();
-               }
-       } else if (!locked) {
-               if (need_update & CURSOR) {
-                       bv->screen().toggleSelection(lt, bv, true, y_offset,int(x));
-                       lt->clearSelection();
-                       lt->selection.cursor = lt->cursor;
-               }
-               bv->screen().update(lt, bv, y_offset, int(x));
-       } else {
-               locked = false;
-               if (need_update & SELECTION) {
-                       bv->screen().toggleToggle(lt, bv, y_offset, int(x));
-               } else if (need_update & CURSOR) {
-                       bv->screen().toggleSelection(lt, bv, true, y_offset,int(x));
-                       lt->clearSelection();
-                       lt->selection.cursor = lt->cursor;
+                       break;
                }
-               bv->screen().update(lt, bv, y_offset, int(x));
-               locked = true;
+               y += row->height();
+               yf += row->height();
+               row = row->next();
        }
 
        lt->refresh_y = 0;
        lt->status(bv, LyXText::UNCHANGED);
-       if ((drawFrame_ == ALWAYS) ||
-               ((cleared || (need_update != CURSOR_PAR)) &&
-                (drawFrame_ == LOCKED) && locked))
-       {
-               drawFrame(pain, cleared);
-       } else if (need_update & CLEAR_FRAME) {
-               clearFrame(pain, cleared);
+       if ((drawFrame_ == ALWAYS) || (drawFrame_ == LOCKED && locked)) {
+               drawFrame(pain);
        }
 
        x += insetWidth - TEXT_TO_INSET_OFFSET;
@@ -529,30 +473,15 @@ void InsetText::draw(BufferView * bv, Ly
 }
 
 
-void InsetText::drawFrame(Painter & pain, bool cleared) const
+void InsetText::drawFrame(Painter & pain) const
 {
        static int const ttoD2 = TEXT_TO_INSET_OFFSET / 2;
-       if (!frame_is_visible || cleared) {
-               frame_x = top_x + ttoD2;
-               frame_y = top_baseline - insetAscent + ttoD2;
-               frame_w = insetWidth - TEXT_TO_INSET_OFFSET;
-               frame_h = insetAscent + insetDescent - TEXT_TO_INSET_OFFSET;
-               pain.rectangle(frame_x, frame_y, frame_w, frame_h,
-                              frame_color);
-               frame_is_visible = true;
-       }
-}
-
-
-void InsetText::clearFrame(Painter & pain, bool cleared) const
-{
-       if (frame_is_visible) {
-               if (!cleared) {
-                       pain.rectangle(frame_x, frame_y, frame_w, frame_h,
-                                      backgroundColor());
-               }
-               frame_is_visible = false;
-       }
+       frame_x = top_x + ttoD2;
+       frame_y = top_baseline - insetAscent + ttoD2;
+       frame_w = insetWidth - TEXT_TO_INSET_OFFSET;
+       frame_h = insetAscent + insetDescent - TEXT_TO_INSET_OFFSET;
+       pain.rectangle(frame_x, frame_y, frame_w, frame_h,
+                      frame_color);
 }
 
 
@@ -791,16 +720,8 @@ void InsetText::insetUnlock(BufferView *
        no_selection = true;
        locked = false;
        int code = NONE;
-#if 0
-       if (drawFrame_ == LOCKED)
-               code = CURSOR|CLEAR_FRAME;
-       else
-               code = CURSOR;
-#else
-       if (drawFrame_ == LOCKED)
-               code = CLEAR_FRAME;
-#endif
        bool clear = false;
+
        if (!lt) {
                lt = getLyXText(bv);
                clear = true;
@@ -2470,12 +2391,6 @@ int InsetText::scroll(bool recursive) co
 }
 
 
-bool InsetText::doClearArea() const
-{
-       return !locked || (need_update & (FULL|INIT));
-}
-
-
 void InsetText::selectAll(BufferView * bv)
 {
        getLyXText(bv)->cursorTop(bv);
@@ -2491,7 +2406,7 @@ void InsetText::clearSelection(BufferVie
 }
 
 
-void InsetText::clearInset(BufferView * bv, int baseline, bool & cleared) const
+void InsetText::clearInset(BufferView * bv, int baseline) const
 {
        Painter & pain = bv->painter();
        int w = insetWidth;
@@ -2508,9 +2423,7 @@ void InsetText::clearInset(BufferView * 
                w = pain.paperWidth();
 //     w -= TEXT_TO_INSET_OFFSET;
        pain.fillRectangle(top_x + 1, ty + 1, w - 1, h - 1, backgroundColor());
-       cleared = true;
        need_update = FULL;
-       frame_is_visible = false;
 }
 
 
Index: insets/insettext.h
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insettext.h,v
retrieving revision 1.143
diff -u -p -r1.143 insettext.h
--- insets/insettext.h  16 Mar 2003 14:51:03 -0000      1.143
+++ insets/insettext.h  16 Mar 2003 16:37:51 -0000
@@ -47,17 +47,15 @@ public:
                ///
                CURSOR = 1,
                ///
-               CLEAR_FRAME = 2,
+               DRAW_FRAME = 2,
                ///
-               DRAW_FRAME = 4,
+               SELECTION = 4,
                ///
-               SELECTION = 8,
+               CURSOR_PAR = 8,
                ///
-               CURSOR_PAR = 16,
+               FULL = 16,
                ///
-               FULL = 32,
-               ///
-               INIT = 64
+               INIT = 32
        };
        ///
        enum DrawFrame {
@@ -94,7 +92,7 @@ public:
        ///
        int textWidth(BufferView *, bool fordraw = false) const;
        ///
-       void draw(BufferView *, LyXFont const &, int , float &, bool) const;
+       void draw(BufferView *, LyXFont const &, int , float &) const;
        ///
        void update(BufferView *, LyXFont const &, bool = false);
        ///
@@ -108,8 +106,6 @@ public:
        ///
        bool isTextInset() const { return true; }
        ///
-       bool doClearArea() const;
-       ///
        void insetUnlock(BufferView *);
        ///
        bool lockInsetInInset(BufferView *, UpdatableInset *);
@@ -346,11 +342,9 @@ private:
        ///
        Row * crow(BufferView *) const;
        ///
-       void drawFrame(Painter &, bool cleared) const;
+       void drawFrame(Painter &) const;
        ///
-       void clearFrame(Painter &, bool cleared) const;
-       ///
-       void clearInset(BufferView *, int baseline, bool & cleared) const;
+       void clearInset(BufferView *, int baseline) const;
        ///
        void saveLyXTextState(LyXText *) const;
        ///
@@ -393,8 +387,6 @@ private:
        mutable Cache cache;
        ///
        mutable int last_drawn_width;
-       ///
-       mutable bool frame_is_visible;
        ///
        mutable BufferView * cached_bview;
        ///
Index: insets/updatableinset.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/updatableinset.C,v
retrieving revision 1.3
diff -u -p -r1.3 updatableinset.C
--- insets/updatableinset.C     26 Feb 2003 17:04:10 -0000      1.3
+++ insets/updatableinset.C     16 Mar 2003 16:37:51 -0000
@@ -73,8 +73,7 @@ void UpdatableInset::edit(BufferView *, 
 
 
 void UpdatableInset::draw(BufferView *, LyXFont const &,
-                         int /* baseline */, float & x,
-                         bool/*cleared*/) const
+                         int /* baseline */, float & x) const
 {
        x += float(scx);
        // ATTENTION: don't do the following here!!!
Index: insets/updatableinset.h
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/updatableinset.h,v
retrieving revision 1.3
diff -u -p -r1.3 updatableinset.h
--- insets/updatableinset.h     21 Feb 2003 12:11:53 -0000      1.3
+++ insets/updatableinset.h     16 Mar 2003 16:37:51 -0000
@@ -75,7 +75,7 @@ public:
        virtual void edit(BufferView *, bool front = true);
        ///
        virtual void draw(BufferView *, LyXFont const &,
-                         int baseline, float & x, bool cleared) const;
+                         int baseline, float & x) const;
        ///
        virtual bool insertInset(BufferView *, Inset *) { return false; }
        ///
Index: mathed/formula.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/formula.C,v
retrieving revision 1.252
diff -u -p -r1.252 formula.C
--- mathed/formula.C    26 Feb 2003 13:10:16 -0000      1.252
+++ mathed/formula.C    16 Mar 2003 16:37:52 -0000
@@ -194,7 +194,7 @@ void InsetFormula::read(Buffer const *, 
 
 
 void InsetFormula::draw(BufferView * bv, LyXFont const & font,
-                       int y, float & xx, bool) const
+                       int y, float & xx) const
 {
        cache(bv);
        // This initiates the loading of the preview, so should come
Index: mathed/formula.h
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/formula.h,v
retrieving revision 1.78
diff -u -p -r1.78 formula.h
--- mathed/formula.h    13 Feb 2003 16:53:08 -0000      1.78
+++ mathed/formula.h    16 Mar 2003 16:37:52 -0000
@@ -41,7 +41,7 @@ public:
        ///
        int width(BufferView *, LyXFont const &) const;
        ///
-       void draw(BufferView *, LyXFont const &, int, float &, bool) const;
+       void draw(BufferView *, LyXFont const &, int, float &) const;
 
        ///
        void write(Buffer const *, std::ostream &) const;
Index: mathed/formulabase.h
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/formulabase.h,v
retrieving revision 1.60
diff -u -p -r1.60 formulabase.h
--- mathed/formulabase.h        6 Mar 2003 08:10:50 -0000       1.60
+++ mathed/formulabase.h        16 Mar 2003 16:37:54 -0000
@@ -37,7 +37,7 @@ public:
        ///
        virtual int width(BufferView *, LyXFont const &) const = 0;
        ///
-       virtual void draw(BufferView *,LyXFont const &, int, float &, bool) const = 0;
+       virtual void draw(BufferView *,LyXFont const &, int, float &) const = 0;
        /// lowest x coordinate
        virtual int xlow() const;
        /// highest x coordinate
Index: mathed/formulamacro.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/formulamacro.C,v
retrieving revision 1.110
diff -u -p -r1.110 formulamacro.C
--- mathed/formulamacro.C       13 Feb 2003 16:53:08 -0000      1.110
+++ mathed/formulamacro.C       16 Mar 2003 16:37:54 -0000
@@ -171,7 +171,7 @@ Inset::Code InsetFormulaMacro::lyxCode()
 
 
 void InsetFormulaMacro::draw(BufferView * bv, LyXFont const & f,
-                            int y, float & xx, bool /*cleared*/) const
+                            int y, float & xx) const
 {
        // label
        LyXFont font(f);
Index: mathed/formulamacro.h
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/formulamacro.h,v
retrieving revision 1.57
diff -u -p -r1.57 formulamacro.h
--- mathed/formulamacro.h       13 Feb 2003 16:53:08 -0000      1.57
+++ mathed/formulamacro.h       16 Mar 2003 16:37:54 -0000
@@ -39,7 +39,7 @@ public:
        ///
        int width(BufferView *, LyXFont const &) const;
        ///
-       void draw(BufferView *, LyXFont const &, int, float &, bool) const;
+       void draw(BufferView *, LyXFont const &, int, float &) const;
 
        ///
        void read(Buffer const *, LyXLex & lex);

Reply via email to