Not too important anymore...

Andre'

-- 
Those who desire to give up Freedom in order to gain Security, will not have,
nor do they deserve, either one.     (T. Jefferson or B. Franklin or both...)
Index: insetcollapsable.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetcollapsable.C,v
retrieving revision 1.161
diff -u -p -r1.161 insetcollapsable.C
--- insetcollapsable.C  2 Aug 2003 11:30:26 -0000       1.161
+++ insetcollapsable.C  4 Aug 2003 15:49:46 -0000
@@ -229,7 +229,6 @@ void InsetCollapsable::lfunMouseRelease(
 
        if (collapsed_ && cmd.button() != mouse_button::button3) {
                collapsed_ = false;
-               inset.setUpdateStatus(InsetText::FULL);
                bv->updateInset(this);
                bv->buffer()->markDirty();
                return;
@@ -239,7 +238,6 @@ void InsetCollapsable::lfunMouseRelease(
        {
                if (collapsed_) {
                        collapsed_ = false;
-                       inset.setUpdateStatus(InsetText::FULL);
                        bv->updateInset(this);
                        bv->buffer()->markDirty();
                } else {
@@ -300,7 +298,6 @@ InsetOld::RESULT InsetCollapsable::local
                                        lyxerr << "branch collapsed_" << endl;
                                        collapsed_ = false;
                                        if (bv->lockInset(this)) {
-                                               inset.setUpdateStatus(InsetText::FULL);
                                                bv->updateInset(this);
                                                bv->buffer()->markDirty();
                                                inset.localDispatch(cmd);
Index: insetert.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetert.C,v
retrieving revision 1.145
diff -u -p -r1.145 insetert.C
--- insetert.C  3 Aug 2003 21:42:44 -0000       1.145
+++ insetert.C  4 Aug 2003 15:49:46 -0000
@@ -585,8 +585,6 @@ void InsetERT::status(BufferView * bv, E
                status_ = st;
                switch (st) {
                case Inlined:
-                       if (bv)
-                               inset.setUpdateStatus(InsetText::INIT);
                        break;
                case Open:
                        collapsed_ = false;
Index: insettext.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insettext.C,v
retrieving revision 1.466
diff -u -p -r1.466 insettext.C
--- insettext.C 4 Aug 2003 15:41:27 -0000       1.466
+++ insettext.C 4 Aug 2003 15:49:46 -0000
@@ -169,7 +169,6 @@ void InsetText::init(InsetText const * i
                 boost::bind(&Paragraph::setInsetOwner, _1, this));
        top_y = 0;
        no_selection = true;
-       need_update = FULL;
        drawTextXOffset = 0;
        drawTextYOffset = 0;
        locked = false;
@@ -188,7 +187,6 @@ void InsetText::clear(bool just_mark_era
                for (; it != end; ++it) {
                        it->markErased();
                }
-               need_update = FULL;
                return;
        }
 
@@ -201,7 +199,6 @@ void InsetText::clear(bool just_mark_era
        paragraphs.begin()->layout(old_layout);
 
        reinitLyXText();
-       need_update = INIT;
 }
 
 
@@ -270,7 +267,6 @@ void InsetText::read(Buffer const * buf,
                lex.printError("Missing \\end_inset at this point. "
                                           "Read: `$$Token'");
        }
-       need_update = FULL;
 }
 
 
@@ -314,7 +310,6 @@ void InsetText::draw(PainterInfo & pi, i
        // no draw is necessary !!!
        if (drawFrame_ == LOCKED && !locked && paragraphs.begin()->empty()) {
                top_baseline = baseline;
-               need_update = NONE;
                return;
        }
 
@@ -326,10 +321,8 @@ void InsetText::draw(PainterInfo & pi, i
        top_baseline = baseline;
        top_y = baseline - dim_.asc;
 
-       if (last_drawn_width != dim_.wid) {
-               need_update |= FULL;
+       if (last_drawn_width != dim_.wid)
                last_drawn_width = dim_.wid;
-       }
 
        if (the_locking_inset && cpar() == inset_par && cpos() == inset_pos) {
                inset_x = cix() - x + drawTextXOffset;
@@ -365,9 +358,6 @@ void InsetText::draw(PainterInfo & pi, i
 
        if (drawFrame_ == ALWAYS || (drawFrame_ == LOCKED && locked))
                drawFrame(pain, int(start_x));
-
-       if (need_update != INIT)
-               need_update = NONE;
 }
 
 
@@ -383,12 +373,6 @@ void InsetText::drawFrame(Painter & pain
 }
 
 
-void InsetText::setUpdateStatus(int what) const
-{
-       need_update |= what;
-}
-
-
 void InsetText::updateLocal(BufferView * bv, bool mark_dirty)
 {
        if (!bv)
@@ -398,8 +382,7 @@ void InsetText::updateLocal(BufferView *
                collapseParagraphs(bv);
 
        text_.partialRebreak();
-       setUpdateStatus(FULL);
-       bool flag = mark_dirty || need_update != NONE || text_.selection.set();
+       bool flag = mark_dirty || text_.selection.set();
        if (!text_.selection.set())
                text_.selection.cursor = text_.cursor;
 
@@ -433,11 +416,9 @@ void InsetText::insetUnlock(BufferView *
        }
        no_selection = true;
        locked = false;
-       int code = NONE;
 
        if (text_.selection.set()) {
                text_.clearSelection();
-               code = FULL;
        } else if (owner()) {
                bv->owner()->setLayout(owner()->getLyXText(bv)
                                       ->cursor.par()->layout()->name());
@@ -450,8 +431,6 @@ void InsetText::insetUnlock(BufferView *
        } else if (paragraphs.size() > 1) {
                text_.setCursor(boost::next(first_par), 0);
        }
-       if (code != NONE)
-               setUpdateStatus(code);
 }
 
 
@@ -474,7 +453,6 @@ void InsetText::lockInset(BufferView * b
                font.setLanguage(bv->getParentLanguage(this));
                setFont(bv, font, false);
        }
-       setUpdateStatus(FULL);
 }
 
 
@@ -591,13 +569,11 @@ bool InsetText::updateInsetInInset(Buffe
                        found = tl_inset->updateInsetInInset(bv, inset);
                } else {
                        text_.updateInset(tl_inset);
-                       setUpdateStatus(FULL);
                }
                return found;
        }
        bool found = text_.updateInset(inset);
        if (found) {
-               setUpdateStatus(FULL);
                if (the_locking_inset &&
                    cpar() == inset_par && cpos() == inset_pos)
                {
@@ -1223,7 +1199,7 @@ InsetOld::RESULT InsetText::localDispatc
        if (result >= FINISHED)
                bv->unlockInset(this);
 
-       if (result == DISPATCHED_NOUPDATE && (need_update & FULL))
+       if (result == DISPATCHED_NOUPDATE)
                result = DISPATCHED;
        return result;
 }
@@ -1479,8 +1455,7 @@ void InsetText::fitInsetCursor(BufferVie
        int const asc = font_metrics::maxAscent(font);
        int const desc = font_metrics::maxDescent(font);
 
-       if (bv->fitLockedInsetCursor(cx(), cy(), asc, desc))
-               need_update |= FULL;
+       bv->fitLockedInsetCursor(cx(), cy(), asc, desc);
 }
 
 
@@ -1727,7 +1702,6 @@ void InsetText::setParagraphData(Paragra
        }
 
        reinitLyXText();
-       need_update = INIT;
 }
 
 
@@ -1761,7 +1735,6 @@ void InsetText::setAutoBreakRows(bool fl
                autoBreakRows = flag;
                if (!flag)
                        removeNewlines();
-               need_update = INIT;
        }
 }
 
@@ -1905,8 +1878,6 @@ void InsetText::resizeLyXText(BufferView
                const_cast<InsetText*>(this)->updateLocal(bv, false);
                // this will scroll the screen such that the cursor becomes visible
                bv->updateScrollbar();
-       } else {
-               need_update |= FULL;
        }
 #endif
 }
@@ -1935,8 +1906,6 @@ void InsetText::reinitLyXText() const
        if (!owner()) {
                // this will scroll the screen such that the cursor becomes visible
                bv->updateScrollbar();
-       } else {
-               need_update = FULL;
        }
 }
 
@@ -1993,7 +1962,6 @@ void InsetText::clearInset(BufferView * 
        if (top_x + drawTextXOffset + w > pain.paperWidth())
                w = pain.paperWidth();
        pain.fillRectangle(start_x + 1, ty + 1, w - 3, h - 1, backgroundColor());
-       need_update = FULL;
 }
 
 
Index: insettext.h
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insettext.h,v
retrieving revision 1.190
diff -u -p -r1.190 insettext.h
--- insettext.h 4 Aug 2003 15:41:27 -0000       1.190
+++ insettext.h 4 Aug 2003 15:49:46 -0000
@@ -44,17 +44,6 @@ class Paragraph;
 class InsetText : public UpdatableInset {
 public:
        ///
-       /// numbers need because of test if codeA < codeB
-       ///
-       enum UpdateCodes {
-               ///
-               NONE = 0,
-               ///
-               FULL = 16,
-               ///
-               INIT = 32
-       };
-       ///
        enum DrawFrame {
                ///
                NEVER = 0,
@@ -84,8 +73,6 @@ public:
        ///
        void draw(PainterInfo & pi, int x, int y) const;
        ///
-       void setUpdateStatus(int what) const;
-       ///
        string const editMessage() const;
        ///
        bool isTextInset() const { return true; }
@@ -217,11 +204,7 @@ public:
        ///
        void addPreview(lyx::graphics::PreviewLoader &) const;
 
-       //
-       // Public structures and variables
        ///
-       mutable int need_update;
-
        bool haveParagraphs() const {
                return true;
        }

Reply via email to